b0340d8a2275a635a5a68508ac1a59e0910f8b55.svn-base 68 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615
  1. <template>
  2. <div class="app-container">
  3. <!-- 配方模板表 -->
  4. <div ref="template" class="template">
  5. <div class="recipeTemplate">
  6. <p>日执行计划</p>
  7. </div>
  8. <div class="operation" style="margin-bottom: 10px;">
  9. <el-button class="success" @click="handleCreate">新生成</el-button>
  10. <el-button class="success" @click="handleRevisePlan">修改计划</el-button>
  11. <el-button class="success" @click="handleCopy">复制计划</el-button>
  12. <el-button v-if="isOrder" class="success" @click="handleChangeOrder">更改顺序</el-button>
  13. <div v-else style="margin-left: 10px;display: inline-block;">
  14. <el-button class="success" @click="saveChangeOrder">保存</el-button>
  15. <el-button class="success" @click="cancelChangeOrder">取消</el-button>
  16. </div>
  17. </div>
  18. <div class="search">
  19. <el-date-picker v-model="table.getdataListParm.parammaps.mydate" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :clearable="false" @change="changeDate" />
  20. <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
  21. <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
  22. <el-select v-model="table.getdataListParm.parammaps.lpplantype" filterable placeholder="计划类型" class="filter-item" clearable style="width: 120px;" @change="changePlanType">
  23. <el-option v-for="item in planTypeList" :key="item.value" :label="item.lable" :value="item.value" />
  24. </el-select>
  25. <el-select v-model="table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;" clearable @change="changeFrequency">
  26. <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
  27. </el-select>
  28. <el-select v-model="table.getdataListParm.parammaps.enable" filterable placeholder="打印类型" class="filter-item" clearable style="width: 120px;">
  29. <el-option v-for="item in printingTypeList" :key="item.value" :label="item.label" :value="item.value" />
  30. </el-select>
  31. <el-select v-model="table.getdataListParm.parammaps.enable" filterable placeholder="计划维度" class="filter-item" style="width: 120px;" clearable>
  32. <el-option v-for="item in planningDimensionList" :key="item.value" :label="item.label" :value="item.value" />
  33. </el-select>
  34. <el-select v-model="table.getdataListParm.parammaps.enable" filterable placeholder="导出类型" class="filter-item" style="width: 120px;" clearable>
  35. <el-option v-for="item in exportTypeList" :key="item.value" :label="item.label" :value="item.value" />
  36. </el-select>
  37. <el-button class="export" @click="handleExport">导出</el-button>
  38. </div>
  39. <!-- 日执行计划 -->
  40. <div class="table">
  41. <el-table
  42. id="table1"
  43. ref="parent"
  44. :key="table.tableKey"
  45. v-loading="table.listLoading"
  46. element-loading-text="给我一点时间"
  47. :data="table.list"
  48. border
  49. fit
  50. highlight-current-row
  51. style="width: 98%;"
  52. row-key="sort"
  53. :row-style="rowStyle"
  54. :cell-style="cellStyle"
  55. class="elTable table-fixed"
  56. :row-class-name="tableRowClassName"
  57. :height="370"
  58. @row-click="tableRowClick"
  59. >
  60. <el-table-column label="序号" align="center" prop="sort" width="50px" />
  61. <el-table-column label="计划名称" min-width="110px" align="center">
  62. <template slot-scope="scope">
  63. <span>{{ scope.row.projname }}</span>
  64. </template>
  65. </el-table-column>
  66. <el-table-column label="计划类型" prop="weight" min-width="110px" align="center" :formatter="lpplantype" />
  67. <el-table-column label="TMR编号" min-width="110px" align="center">
  68. <template slot-scope="scope">
  69. <span>{{ scope.row.tmrtname }}</span>
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="驾驶员" min-width="90px" align="center">
  73. <template slot-scope="scope">
  74. <span>{{ scope.row.driver }}</span>
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="已执行" min-width="90px" align="center">
  78. <template slot-scope="scope">
  79. <span v-if="scope.row.havebutton == 0">否</span>
  80. <span v-else>是</span>
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="班次" min-width="110px" align="center">
  84. <template slot-scope="scope">
  85. <span>{{ scope.row.times }}</span>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="理论量" min-width="110px" align="center">
  89. <template slot-scope="scope">
  90. <span>{{ scope.row.lweight }}</span>
  91. </template>
  92. </el-table-column>
  93. <el-table-column label="时间" min-width="180px" align="center">
  94. <template slot-scope="scope">
  95. <span>{{ scope.row.plantime }}</span>
  96. </template>
  97. </el-table-column>
  98. <el-table-column label="发料位" min-width="180px" align="left">
  99. <template slot-scope="scope">
  100. <span>{{ scope.row.barnames }}</span>
  101. </template>
  102. </el-table-column>
  103. </el-table>
  104. </div>
  105. </div>
  106. <!-- 预混料 -->
  107. <div v-if="table3.getdataListParm.parammaps.lpplantype == 4" class="content">
  108. <div class="table2">
  109. <div class="contentOperation">
  110. <p>计划内容<br>操作详情</p>
  111. </div>
  112. <div class="content-table">
  113. <el-table
  114. :key="table2.tableKey"
  115. v-loading="table2.listLoading"
  116. element-loading-text="给我一点时间"
  117. :data="table2.list"
  118. fit
  119. highlight-current-row
  120. style="width: 100%;"
  121. height="450"
  122. :row-style="rowStyle"
  123. :cell-style="cellStyle"
  124. class="elTable table-fixed"
  125. >
  126. <el-table-column label="操作序号" min-width="130px" align="center">
  127. <template slot-scope="scope">
  128. <span>{{ scope.row.sort }}</span>
  129. </template>
  130. </el-table-column>
  131. <el-table-column label="饲料名称" prop="fname" min-width="130px" align="center">
  132. <template slot-scope="scope">
  133. <span>{{ scope.row.fname }}</span>
  134. </template>
  135. </el-table-column>
  136. <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
  137. <template slot-scope="scope">
  138. <span>{{ scope.row.weight }}</span>
  139. </template>
  140. </el-table-column>
  141. </el-table>
  142. </div>
  143. </div>
  144. </div>
  145. <!-- 撒料 -->
  146. <div v-if="table3.getdataListParm.parammaps.lpplantype == 0" class="content">
  147. <div class="table2">
  148. <div class="contentOperation">
  149. <p>计划内容<br>操作详情</p>
  150. </div>
  151. <div class="content-table">
  152. <el-table
  153. :key="table2.tableKey"
  154. v-loading="table2.listLoading"
  155. element-loading-text="给我一点时间"
  156. :data="table2.list"
  157. fit
  158. highlight-current-row
  159. style="width: 100%;"
  160. height="450"
  161. :row-style="rowStyle"
  162. :cell-style="cellStyle"
  163. class="elTable table-fixed"
  164. >
  165. <el-table-column label="操作序号" min-width="130px" align="center">
  166. <template slot-scope="scope">
  167. <span>{{ scope.row.sort }}</span>
  168. </template>
  169. </el-table-column>
  170. <el-table-column label="饲料名称" prop="fname" min-width="130px" align="center">
  171. <template slot-scope="scope">
  172. <span>{{ scope.row.fname }}</span>
  173. </template>
  174. </el-table-column>
  175. <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
  176. <template slot-scope="scope">
  177. <span>{{ scope.row.weight }}</span>
  178. </template>
  179. </el-table-column>
  180. </el-table>
  181. </div>
  182. </div>
  183. <div class="table3">
  184. <div class="contentOperation">
  185. <p>计划内容<br>栏舍详情</p>
  186. </div>
  187. <div class="content-table">
  188. <el-table
  189. :key="table3.tableKey"
  190. v-loading="table3.listLoading"
  191. element-loading-text="给我一点时间"
  192. :data="table3.list"
  193. height="450"
  194. fit
  195. highlight-current-row
  196. style="width: 100%;"
  197. :row-style="rowStyle"
  198. :cell-style="cellStyle"
  199. class="elTable table-fixed"
  200. >
  201. <el-table-column label=" 操作序号" min-width="130px" align="center">
  202. <template slot-scope="scope">
  203. <span>{{ scope.row.sort }}</span>
  204. </template>
  205. </el-table-column>
  206. <el-table-column label="栏舍" min-width="130px" align="center">
  207. <template slot-scope="scope">
  208. <span>{{ scope.row.fname }}</span>
  209. </template>
  210. </el-table-column>
  211. <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
  212. <template slot-scope="scope">
  213. <span>{{ scope.row.weight }}</span>
  214. </template>
  215. </el-table-column>
  216. </el-table>
  217. </div>
  218. </div>
  219. </div>
  220. <!-- 剩料 -->
  221. <div v-if="table3.getdataListParm.parammaps.lpplantype == 3" class="content">
  222. <div class="table2">
  223. <div class="contentOperation">
  224. <p>计划内容<br>操作详情</p>
  225. </div>
  226. <div class="content-table">
  227. <el-table
  228. :key="table2.tableKey"
  229. v-loading="table2.listLoading"
  230. element-loading-text="给我一点时间"
  231. :data="table2.list"
  232. fit
  233. highlight-current-row
  234. style="width: 100%;"
  235. height="450"
  236. :row-style="rowStyle"
  237. :cell-style="cellStyle"
  238. class="elTable table-fixed"
  239. >
  240. <el-table-column label="操作序号" min-width="130px" align="center">
  241. <template slot-scope="scope">
  242. <span>{{ scope.row.sort }}</span>
  243. </template>
  244. </el-table-column>
  245. <el-table-column label="取料栏舍" prop="fname" min-width="130px" align="center">
  246. <template slot-scope="scope">
  247. <span>{{ scope.row.fname }}</span>
  248. </template>
  249. </el-table-column>
  250. <el-table-column label="处理方式" prop="useinbar" min-width="130px" align="center">
  251. <template slot-scope="scope">
  252. <span>{{ scope.row.useinbar }}</span>
  253. </template>
  254. </el-table-column>
  255. </el-table>
  256. </div>
  257. </div>
  258. <div class="table3">
  259. <div class="contentOperation">
  260. <p>计划内容<br>栏舍详情</p>
  261. </div>
  262. <div class="content-table">
  263. <el-table
  264. :key="table3.tableKey"
  265. v-loading="table3.listLoading"
  266. element-loading-text="给我一点时间"
  267. :data="table3.list"
  268. height="450"
  269. fit
  270. highlight-current-row
  271. style="width: 100%;"
  272. :row-style="rowStyle"
  273. :cell-style="cellStyle"
  274. class="elTable table-fixed"
  275. >
  276. <el-table-column label="操作序号" min-width="130px" align="center">
  277. <template slot-scope="scope">
  278. <span>{{ scope.row.sort }}</span>
  279. </template>
  280. </el-table-column>
  281. <el-table-column label="转投栏舍" min-width="130px" align="center">
  282. <template slot-scope="scope">
  283. <span>{{ scope.row.fname }}</span>
  284. </template>
  285. </el-table-column>
  286. </el-table>
  287. </div>
  288. </div>
  289. </div>
  290. <!-- 撒料计划-混料 -->
  291. <div v-if="table3.getdataListParm.parammaps.lpplantype == 1 || table3.getdataListParm.parammaps.lpplantype == 5" class="content">
  292. <div class="table2">
  293. <div class="contentOperation">
  294. <p>计划内容<br>操作详情</p>
  295. </div>
  296. <div class="content-table">
  297. <el-table
  298. :key="table2.tableKey"
  299. v-loading="table2.listLoading"
  300. element-loading-text="给我一点时间"
  301. :data="table2.list"
  302. fit
  303. highlight-current-row
  304. style="width: 100%;"
  305. height="450"
  306. :row-style="rowStyle"
  307. :cell-style="cellStyle"
  308. class="elTable table-fixed"
  309. >
  310. <el-table-column label="操作序号" min-width="130px" align="center">
  311. <template slot-scope="scope">
  312. <span>{{ scope.row.sort }}</span>
  313. </template>
  314. </el-table-column>
  315. <el-table-column label="饲料名称" prop="fname" min-width="130px" align="center">
  316. <template slot-scope="scope">
  317. <span>{{ scope.row.fname }}</span>
  318. </template>
  319. </el-table-column>
  320. <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
  321. <template slot-scope="scope">
  322. <span>{{ scope.row.weight }}</span>
  323. </template>
  324. </el-table-column>
  325. </el-table>
  326. </div>
  327. </div>
  328. <div class="table3">
  329. <div class="contentOperation">
  330. <p>计划内容<br>栏舍详情</p>
  331. </div>
  332. <div class="content-table">
  333. <el-table
  334. :key="table3.tableKey"
  335. v-loading="table3.listLoading"
  336. element-loading-text="给我一点时间"
  337. :data="table3.list"
  338. height="450"
  339. fit
  340. highlight-current-row
  341. style="width: 100%;"
  342. :row-style="rowStyle"
  343. :cell-style="cellStyle"
  344. class="elTable table-fixed"
  345. >
  346. <el-table-column label=" 操作序号" min-width="130px" align="center">
  347. <template slot-scope="scope">
  348. <span>{{ scope.row.sort }}</span>
  349. </template>
  350. </el-table-column>
  351. <el-table-column label="撒料车辆" min-width="130px" align="center">
  352. <template slot-scope="scope">
  353. <span>{{ scope.row.fname }}</span>
  354. </template>
  355. </el-table-column>
  356. <el-table-column label="设计重量(KG)" min-width="130px" align="center">
  357. <template slot-scope="scope">
  358. <span>{{ scope.row.weight }}</span>
  359. </template>
  360. </el-table-column>
  361. </el-table>
  362. </div>
  363. </div>
  364. </div>
  365. <!-- 撒料计划-撒料 -->
  366. <div v-if="table3.getdataListParm.parammaps.lpplantype == 2" class="content">
  367. <div class="table3">
  368. <div class="contentOperation">
  369. <p>计划内容<br>栏舍详情</p>
  370. </div>
  371. <div class="content-table">
  372. <el-table
  373. :key="table3.tableKey"
  374. v-loading="table3.listLoading"
  375. element-loading-text="给我一点时间"
  376. :data="table3.list"
  377. height="450"
  378. fit
  379. highlight-current-row
  380. style="width: 100%;"
  381. :row-style="rowStyle"
  382. :cell-style="cellStyle"
  383. class="elTable table-fixed"
  384. >
  385. <el-table-column label=" 操作序号" min-width="130px" align="center">
  386. <template slot-scope="scope">
  387. <span>{{ scope.row.sort }}</span>
  388. </template>
  389. </el-table-column>
  390. <el-table-column label="撒料车辆" min-width="130px" align="center">
  391. <template slot-scope="scope">
  392. <span>{{ scope.row.fname }}</span>
  393. </template>
  394. </el-table-column>
  395. <el-table-column label="设计重量(KG)" min-width="130px" align="center">
  396. <template slot-scope="scope">
  397. <span>{{ scope.row.weight }}</span>
  398. </template>
  399. </el-table-column>
  400. </el-table>
  401. </div>
  402. </div>
  403. <div class="table2">
  404. <div class="contentOperation">
  405. <p>计划内容<br>操作详情</p>
  406. </div>
  407. <div class="content-table">
  408. <el-table
  409. :key="table2.tableKey"
  410. v-loading="table2.listLoading"
  411. element-loading-text="给我一点时间"
  412. :data="table2.list"
  413. fit
  414. highlight-current-row
  415. style="width: 100%;"
  416. height="450"
  417. :row-style="rowStyle"
  418. :cell-style="cellStyle"
  419. class="elTable table-fixed"
  420. >
  421. <el-table-column label="操作序号" min-width="130px" align="center">
  422. <template slot-scope="scope">
  423. <span>{{ scope.row.sort }}</span>
  424. </template>
  425. </el-table-column>
  426. <el-table-column label="栏舍名称" prop="fname" min-width="130px" align="center">
  427. <template slot-scope="scope">
  428. <span>{{ scope.row.fname }}</span>
  429. </template>
  430. </el-table-column>
  431. <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
  432. <template slot-scope="scope">
  433. <span>{{ scope.row.weight }}</span>
  434. </template>
  435. </el-table-column>
  436. </el-table>
  437. </div>
  438. </div>
  439. </div>
  440. <!-- 新生成 -->
  441. <el-dialog :title="textMap[newGeneration.dialogStatus]" :destroy-on-close="true" :visible.sync="newGeneration.dialogFormVisible" :close-on-click-modal="false" width="50%">
  442. <div class="newGeneration">
  443. <el-form ref="temp" :rules="newGeneration.rules" :model="newGeneration.temp" label-position="right" label-width="155px" style="width: 100%;margin:0 auto 50px">
  444. <el-row v-if="newGeneration.dialogStatus== 'newGeneration'">
  445. <el-col :span="16">
  446. <el-form-item label="时间范围:" prop="inputDatetime">
  447. <el-date-picker v-model="newGeneration.temp.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 100%;" :clearable="false" :picker-options="pickerOptions2" />
  448. </el-form-item>
  449. </el-col>
  450. </el-row>
  451. <el-row v-else>
  452. <el-col :span="16">
  453. <el-form-item label="时间范围:" prop="copyInputDatetime">
  454. <el-date-picker v-model="newGeneration.temp.copyInputDatetime" :picker-options="pickerOptions" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 100%;" :clearable="false" />
  455. </el-form-item>
  456. </el-col>
  457. </el-row>
  458. </el-form>
  459. <div slot="footer" class="dialog-footer" style="bottom:10px">
  460. <el-button class="cancelClose" @click="newGeneration.dialogFormVisible = false;getList()">取消</el-button>
  461. <el-button v-if="newGeneration.dialogStatus== 'newGeneration'" class="success" :disabled="isokDisable" @click="newGenerationData()">确认</el-button>
  462. <el-button v-else class="success" :disabled="isokDisable" @click="copyData()">确认</el-button>
  463. </div>
  464. </div>
  465. </el-dialog>
  466. <!-- 历史记录 -->
  467. <el-dialog :title="textMap[historyRecord.dialogStatus]" :destroy-on-close="true" :visible.sync="historyRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
  468. <div class="historyRecord">
  469. <keep-alive>
  470. <component :is="historyRecord.myComponent" ref="historyRecord" />
  471. </keep-alive>
  472. </div>
  473. <div slot="footer" class="dialog-footer" style="bottom: 10px;">
  474. <el-button class="cancelClose" @click="historyRecord.dialogFormVisible = false; ">关闭</el-button>
  475. </div>
  476. </el-dialog>
  477. <!-- 修改计划 -->
  478. <RevisePlan :show.sync="isShowDialog" :parent-active-name="activeName" :parent-date="parentDate" />
  479. </div>
  480. </template>
  481. <script>
  482. import { GetDataByName, GetDataByNames, ExecDataByConfig, PostDataByName } from '@/api/common'
  483. import RevisePlan from './revisePlan.vue'
  484. import { parseTime } from '@/utils/index.js'
  485. import Cookies from 'js-cookie'
  486. import Sortable from 'sortablejs'
  487. export default {
  488. name: 'DailyExecutionPlan',
  489. components: {
  490. RevisePlan
  491. },
  492. data() {
  493. return {
  494. requestParams: [
  495. // { name: 'getDictByName', offset: 0, pagecount: 0, params: ['牲畜父类'] }
  496. ],
  497. planTypeList: [{ lable: '预混计划', value: '4' }, { lable: '撒料计划', value: '0' }, { lable: '剩料计划', value: '3' }, { lable: '撒料计划-混料', value: '1' }, { lable: '撒料计划-撒料', value: '2' }, { lable: '预称重计划', value: '5' }], // 计划类型
  498. printingTypeList: [{ lable: '所有', value: '0' }, { lable: '精料', value: '1' }, { lable: '铲车', value: '2' }], // 打印类型
  499. frequencyList: [], // 班次
  500. planningDimensionList: [{ lable: '发料顺序', value: '0' }, { lable: 'TMR', value: '1' }], // 发料顺序
  501. exportTypeList: [{ lable: '投料简打', value: '0' }, { lable: '投料简打', value: '1' }], // 导出类型
  502. // 班次
  503. maxTime: {
  504. getMaxTimesParm: {
  505. name: 'getSysoptEnable',
  506. page: 1,
  507. offset: 1,
  508. pagecount: 1,
  509. returntype: 'Map',
  510. parammaps: {
  511. pastureid: Cookies.get('pastureid'),
  512. inforname: 'times'
  513. }
  514. }
  515. },
  516. isOrder: true,
  517. table: {
  518. getdataListParm: {
  519. name: 'getDownloadedplanList',
  520. page: 1,
  521. offset: 1,
  522. pagecount: '',
  523. returntype: 'Map',
  524. parammaps: {
  525. pastureid: Cookies.get('pastureid'),
  526. barid: '',
  527. mydate: parseTime(new Date(), '{y}-{m}-{d}'),
  528. times: '',
  529. lpplantype: ''
  530. }
  531. },
  532. tableKey: 0,
  533. list: [],
  534. total: 0,
  535. listLoading: false
  536. },
  537. // 计划内容操作详情
  538. table2: {
  539. getdataListParm: {
  540. name: 'getDownloadplandtl1ListV2',
  541. page: 1,
  542. offset: 1,
  543. returntype: 'Map',
  544. parammaps: {
  545. pastureid: Cookies.get('pastureid'),
  546. date: '',
  547. id: ''
  548. }
  549. },
  550. tableKey: 0,
  551. list: [],
  552. total: 0,
  553. listLoading: false
  554. },
  555. // 计划内容 舍栏详情
  556. table3: {
  557. getdataListParm: {
  558. name: 'getDownloadplandt2ListV2',
  559. page: 1,
  560. offset: 1,
  561. returntype: 'Map',
  562. parammaps: {
  563. pastureid: Cookies.get('pastureid'),
  564. date: '',
  565. id: ''
  566. }
  567. },
  568. tableKey: 0,
  569. list: [],
  570. total: 0,
  571. listLoading: false
  572. },
  573. // 新生成
  574. newGeneration: {
  575. dialogFormVisible: false,
  576. dialogStatus: '',
  577. getdataListParm: {
  578. name: 'checkLLPIsDistribution',
  579. page: 1,
  580. offset: 1,
  581. pagecount: 1,
  582. returntype: 'Map',
  583. parammaps: {
  584. pastureid: Cookies.get('pastureid')
  585. }
  586. },
  587. temp: {
  588. inputDatetime: [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')]
  589. },
  590. rules: {
  591. inputDatetime: [{ type: 'array', required: true, message: '必填', trigger: 'blur' }],
  592. copyInputDatetime: [{ type: 'array', required: true, message: '必填', trigger: 'blur' }]
  593. }
  594. },
  595. pickerMinDate: '',
  596. pickerOptions: {
  597. onPick: ({ maxDate, minDate }) => {
  598. this.pickerMinDate = minDate.getTime()
  599. if (maxDate) {
  600. this.pickerMinDate = ''
  601. }
  602. },
  603. disabledDate: (time) => {
  604. if (this.pickerMinDate !== '') {
  605. const one = 31 * 24 * 3600 * 1000
  606. const minTime = this.pickerMinDate
  607. const maxTime = this.pickerMinDate + one
  608. return time.getTime() < minTime || time.getTime() > maxTime - 8.64e7
  609. }
  610. return time.getTime() < Date.now() - 8.64e7
  611. }
  612. },
  613. pickerOptions2: {
  614. onPick: ({ maxDate, minDate }) => {
  615. this.pickerMinDate = minDate.getTime()
  616. if (maxDate) {
  617. this.pickerMinDate = ''
  618. }
  619. },
  620. disabledDate: (time) => {
  621. if (this.pickerMinDate !== '') {
  622. const one = 14 * 24 * 3600 * 1000
  623. const minTime = this.pickerMinDate
  624. const maxTime = this.pickerMinDate + one
  625. return time.getTime() < minTime || time.getTime() > maxTime - 8.64e7
  626. }
  627. return time.getTime() < Date.now() - 8.64e7
  628. }
  629. },
  630. historyRecord: {
  631. dialogFormVisible: false,
  632. dialogStatus: '',
  633. myComponent: null
  634. },
  635. textMap: {
  636. newGeneration: '新生成',
  637. historyRecord: '历史记录',
  638. revisePlan: '修改计划',
  639. copy: '复制计划'
  640. },
  641. isokDisable: false,
  642. requestParam: {},
  643. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  644. cellStyle: { padding: 0 + 'px' },
  645. isShowDialog: false,
  646. activeName: '栏舍配方',
  647. parentDate: ''
  648. }
  649. },
  650. created() {
  651. this.parentDate = this.table.getdataListParm.parammaps.mydate
  652. console.log(this.parentDate, 'this.parentDate')
  653. this.getList()
  654. this.getDownList()
  655. this.getIsDisplay()
  656. },
  657. mounted() {
  658. this.table.getdataListParm.parammaps.mydate = parseTime(new Date(), '{y}-{m}-{d}')
  659. },
  660. methods: {
  661. getIsDisplay() {
  662. GetDataByName(this.maxTime.getMaxTimesParm).then(response => {
  663. console.log(response.data.list[0].inforvalue)
  664. if (response.data.list[0].inforvalue == 1) {
  665. this.frequencyList = [{ id: '1', name: '第一班' }]
  666. } else if (response.data.list[0].inforvalue == 2) {
  667. this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }]
  668. } else if (response.data.list[0].inforvalue == 3) {
  669. this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }]
  670. } else if (response.data.list[0].inforvalue == 4) {
  671. this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }, { id: '4', name: '第四班' }]
  672. }
  673. })
  674. },
  675. getDownList() {
  676. GetDataByNames(this.requestParams).then(response => {
  677. // this.livestockTypeList = response.data.getDictByName.list
  678. })
  679. },
  680. // -------------------日执行计划-----------------------------
  681. handleBefore() {
  682. if (this.table.getdataListParm.parammaps.mydate !== '' && this.table.getdataListParm.parammaps.mydate !== null) {
  683. this.table.getdataListParm.parammaps.mydate = new Date(this.table.getdataListParm.parammaps.mydate)
  684. var start = new Date(this.table.getdataListParm.parammaps.mydate.setDate(this.table.getdataListParm.parammaps.mydate.getDate() - 1))
  685. // var start = this.table.getdataListParm.parammaps.mydate - 1
  686. this.table.getdataListParm.parammaps.mydate = parseTime(start, '{y}-{m}-{d}')
  687. // this.$forceUpdate()
  688. this.parentDate = this.table.getdataListParm.parammaps.mydate
  689. this.getList()
  690. }
  691. },
  692. handleNext() {
  693. if (this.table.getdataListParm.parammaps.mydate !== '' && this.table.getdataListParm.parammaps.mydate !== null) {
  694. this.table.getdataListParm.parammaps.mydate = new Date(this.table.getdataListParm.parammaps.mydate)
  695. var stop = new Date(this.table.getdataListParm.parammaps.mydate.setDate(this.table.getdataListParm.parammaps.mydate.getDate() + 1))
  696. this.table.getdataListParm.parammaps.mydate = parseTime(stop, '{y}-{m}-{d}')
  697. this.parentDate = this.table.getdataListParm.parammaps.mydate
  698. this.getList()
  699. }
  700. },
  701. getList() {
  702. this.table.listLoading = true
  703. GetDataByName(this.table.getdataListParm).then(response => {
  704. console.log('table数据', response.data.list)
  705. if (response.data.list !== null) {
  706. // var obj = { 'id': '580999', 'havebutton': '0', 'lpplantype': 2, 'pid': '3283220207862547456', 'times': '第二班', 'projname': '2.666' }
  707. // response.data.list[6] = obj
  708. this.getIsColor(response.data.list)
  709. this.table.list = response.data.list
  710. this.table.pageNum = response.data.pageNum
  711. this.table.pageSize = response.data.pageSize
  712. this.table.total = response.data.total
  713. console.log('计划类型', response.data.list[0].lpplantype)
  714. if (response.data.list[0].lpplantype == 0) {
  715. // 撒料
  716. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  717. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  718. this.table2.getdataListParm.parammaps.useinbartype = ''
  719. this.table3.getdataListParm.parammaps.useinbartype = ''
  720. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  721. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  722. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  723. this.table3.getdataListParm.parammaps.id = response.data.list[0].id
  724. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  725. this.getList2()
  726. this.getList3()
  727. } else if (response.data.list[0].lpplantype == 1) {
  728. // 撒料计划-混料
  729. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  730. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  731. this.table2.getdataListParm.parammaps.useinbartype = ''
  732. this.table3.getdataListParm.parammaps.useinbartype = ''
  733. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  734. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  735. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  736. this.table3.getdataListParm.parammaps.id = response.data.list[0].id
  737. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  738. this.getList2()
  739. this.getList3()
  740. } else if (response.data.list[0].lpplantype == 2) {
  741. // 撒料计划-撒料
  742. this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
  743. this.table3.getdataListParm.name = 'getDownloadplandtl1ListV2'
  744. this.table2.getdataListParm.parammaps.useinbartype = ''
  745. this.table3.getdataListParm.parammaps.useinbartype = ''
  746. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  747. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  748. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  749. this.table3.getdataListParm.parammaps.id = response.data.list[0].id
  750. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  751. this.getList2()
  752. this.getList3()
  753. } else if (response.data.list[0].lpplantype == 3) {
  754. // 剩料
  755. this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
  756. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  757. this.table2.getdataListParm.parammaps.useinbartype = 0
  758. this.table3.getdataListParm.parammaps.useinbartype = 1
  759. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  760. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  761. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  762. this.table3.getdataListParm.parammaps.id = response.data.list[0].id
  763. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  764. this.getList2()
  765. this.getList3()
  766. } else if (response.data.list[0].lpplantype == 4) {
  767. // 预混
  768. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  769. this.table2.getdataListParm.parammaps.useinbartype = ''
  770. this.table3.getdataListParm.parammaps.useinbartype = ''
  771. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  772. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  773. this.getList2()
  774. } else if (response.data.list[0].lpplantype == 5) {
  775. // 预称重计划
  776. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  777. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  778. this.table2.getdataListParm.parammaps.useinbartype = ''
  779. this.table3.getdataListParm.parammaps.useinbartype = ''
  780. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  781. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  782. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  783. this.table3.getdataListParm.parammaps.id = response.data.list[0].id
  784. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  785. this.getList2()
  786. this.getList3()
  787. }
  788. } else {
  789. this.table.list = []
  790. this.table3.getdataListParm.parammaps.lpplantype = ''
  791. this.table2.getdataListParm.parammaps.id = ''
  792. this.table3.getdataListParm.parammaps.id = ''
  793. console.log(222222222222222)
  794. // this.getList2()
  795. // this.getList3()
  796. this.table2.list = []
  797. this.table3.list = []
  798. }
  799. setTimeout(() => {
  800. this.table.listLoading = false
  801. }, 100)
  802. })
  803. },
  804. getIsColor(arr) {
  805. var map = {}
  806. var dest = []
  807. for (var i = 0; i < arr.length; i++) {
  808. var ai = arr[i]
  809. if (!map[ai.pid]) {
  810. dest.push({
  811. pid: ai.pid,
  812. data: [ai]
  813. })
  814. map[ai.pid] = ai
  815. } else {
  816. for (var j = 0; j < dest.length; j++) {
  817. var dj = dest[j]
  818. if (dj.pid == ai.pid) {
  819. dj.data.push(ai)
  820. break
  821. }
  822. }
  823. }
  824. }
  825. console.log(dest)
  826. var newArr1 = []
  827. for (var i = 0; i < dest.length; i++) {
  828. var newArr = dest[i].data
  829. for (var j = 0; j < dest[i].data.length; j++) {
  830. dest[i].data[j].isColor = i
  831. newArr1.push(dest[i].data[j])
  832. }
  833. }
  834. console.log(newArr1)
  835. this.table.list = newArr1
  836. },
  837. tableRowClassName({ row }) {
  838. if (row.isColor % 2 == 0) {
  839. return 'warning-row'
  840. } else {
  841. return 'success-row'
  842. }
  843. },
  844. lpplantype: function(cellValue) {
  845. if (cellValue.lpplantype == 0) {
  846. return '撒料计划'
  847. } else if (cellValue.lpplantype == 1) {
  848. return '撒料计划-混料'
  849. } else if (cellValue.lpplantype == 2) {
  850. return '撒料计划-撒料'
  851. } else if (cellValue.lpplantype == 3) {
  852. return '剩料计划'
  853. } else if (cellValue.lpplantype == 4) {
  854. return '预混计划'
  855. } else if (cellValue.lpplantype == 5) {
  856. return '预称重计划'
  857. }
  858. },
  859. changeDate(val) {
  860. console.log('选择了日期', val)
  861. this.getList()
  862. // this.getList2()
  863. // this.getList3()
  864. this.parentDate = this.table.getdataListParm.parammaps.mydate
  865. console.log(this.parentDate, 'this.parentDate')
  866. },
  867. changePlanType(val) {
  868. console.log('选择了计划类型', val)
  869. this.getList()
  870. this.getList2()
  871. this.getList3()
  872. },
  873. changeFrequency(val) {
  874. console.log('选择了班次', val)
  875. this.getList()
  876. this.getList2()
  877. this.getList3()
  878. },
  879. // 日执行计划行点击
  880. tableRowClick(row, column, event) {
  881. console.log(row, column, event)
  882. console.log('点击计划类型', row.lpplantype)
  883. // 撒料计划0/撒料计划-混料1/撒料计划-撒料2/剩料计划3/预混计划4/预称重计划5
  884. if (row.lpplantype == 0) {
  885. // 撒料
  886. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  887. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  888. this.table2.getdataListParm.parammaps.useinbartype = ''
  889. this.table3.getdataListParm.parammaps.useinbartype = ''
  890. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  891. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  892. this.table2.getdataListParm.parammaps.id = row.id
  893. this.table3.getdataListParm.parammaps.id = row.id
  894. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  895. this.getList2()
  896. this.getList3()
  897. } else if (row.lpplantype == 1) {
  898. // 撒料计划-混料
  899. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  900. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  901. this.table2.getdataListParm.parammaps.useinbartype = ''
  902. this.table3.getdataListParm.parammaps.useinbartype = ''
  903. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  904. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  905. this.table2.getdataListParm.parammaps.id = row.id
  906. this.table3.getdataListParm.parammaps.id = row.id
  907. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  908. this.getList2()
  909. this.getList3()
  910. } else if (row.lpplantype == 2) {
  911. // 撒料计划-撒料
  912. this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
  913. this.table3.getdataListParm.name = 'getDownloadplandtl1ListV2'
  914. this.table2.getdataListParm.parammaps.useinbartype = ''
  915. this.table3.getdataListParm.parammaps.useinbartype = ''
  916. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  917. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  918. this.table2.getdataListParm.parammaps.id = row.id
  919. this.table3.getdataListParm.parammaps.id = row.id
  920. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  921. this.getList2()
  922. this.getList3()
  923. console.log(this.table3.getdataListParm.parammaps.lpplantype)
  924. } else if (row.lpplantype == 3) {
  925. // 剩料
  926. this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
  927. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  928. this.table2.getdataListParm.parammaps.useinbartype = 0
  929. this.table3.getdataListParm.parammaps.useinbartype = 1
  930. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  931. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  932. this.table2.getdataListParm.parammaps.id = row.id
  933. this.table3.getdataListParm.parammaps.id = row.id
  934. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  935. this.getList2()
  936. this.getList3()
  937. } else if (row.lpplantype == 4) {
  938. // 预混
  939. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  940. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  941. this.table2.getdataListParm.parammaps.useinbartype = ''
  942. this.table3.getdataListParm.parammaps.useinbartype = ''
  943. this.table2.getdataListParm.parammaps.id = row.id
  944. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  945. this.getList2()
  946. } else if (row.lpplantype == 5) {
  947. // 预称重计划
  948. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  949. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  950. this.table2.getdataListParm.parammaps.useinbartype = ''
  951. this.table3.getdataListParm.parammaps.useinbartype = ''
  952. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  953. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  954. this.table2.getdataListParm.parammaps.id = row.id
  955. this.table3.getdataListParm.parammaps.id = row.id
  956. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  957. this.getList2()
  958. this.getList3()
  959. }
  960. this.$forceUpdate()
  961. },
  962. // 计划内容操作详情
  963. getList2() {
  964. this.table2.listLoading = true
  965. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  966. GetDataByName(this.table2.getdataListParm).then(response => {
  967. console.log('table数据', response.data.list)
  968. if (response.data.list !== null) {
  969. this.table2.list = response.data.list
  970. // 撒料计划0/撒料计划-混料1/撒料计划-撒料2/剩料计划3/预混计划4
  971. if (this.table3.getdataListParm.parammaps.lpplantype == 0 || this.table3.getdataListParm.parammaps.lpplantype == 1 || this.table3.getdataListParm.parammaps.lpplantype == 4) {
  972. const arr = []
  973. var a = 0
  974. let b = this.table2.list[0].sort
  975. let c = 0
  976. for (let i = 0; i < this.table2.list.length; i++) {
  977. if (b !== parseInt(this.table2.list[i].sort)) {
  978. b = this.table2.list[i].sort
  979. arr.push({ 'sort': '小计', 'weight': a.toFixed(2) })
  980. a = 0
  981. }
  982. a = a + parseFloat(this.table2.list[i].weight)
  983. c = c + parseFloat(this.table2.list[i].weight)
  984. arr.push(this.table2.list[i])
  985. }
  986. arr.push({ 'sort': '小计', 'weight': a })
  987. arr.push({ 'sort': '总计', 'weight': c.toFixed(2) })
  988. this.table2.list = arr
  989. }
  990. if (this.table3.getdataListParm.parammaps.lpplantype == 2) {
  991. const arr = []
  992. var aa = 0
  993. let bb = this.table2.list[0].sort
  994. let cc = 0
  995. for (let i = 0; i < this.table2.list.length; i++) {
  996. if (bb !== parseInt(this.table2.list[i].sort)) {
  997. bb = this.table2.list[i].sort
  998. aa = 0
  999. }
  1000. aa = aa + parseFloat(this.table2.list[i].weight)
  1001. cc = cc + parseFloat(this.table2.list[i].weight)
  1002. arr.push(this.table2.list[i])
  1003. }
  1004. arr.push({ 'sort': '总计', 'weight': cc.toFixed(2) })
  1005. this.table2.list = arr
  1006. console.log('this.table2.list', this.table2.list)
  1007. console.log(this.table3.getdataListParm.parammaps.lpplantype)
  1008. }
  1009. console.log(this.table2.list)
  1010. this.table2.pageNum = response.data.pageNum
  1011. this.table2.pageSize = response.data.pageSize
  1012. this.table2.total = response.data.total
  1013. } else {
  1014. this.table2.list = []
  1015. }
  1016. setTimeout(() => {
  1017. this.table2.listLoading = false
  1018. }, 100)
  1019. })
  1020. },
  1021. // 计划内容栏舍详情
  1022. getList3() {
  1023. this.table3.listLoading = true
  1024. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1025. GetDataByName(this.table3.getdataListParm).then(response => {
  1026. console.log('table数据', response.data.list)
  1027. if (response.data.list !== null) {
  1028. this.table3.list = response.data.list
  1029. if (this.table3.getdataListParm.parammaps.lpplantype == 0) {
  1030. const arr = []
  1031. var a = 0
  1032. let b = this.table3.list[0].sort
  1033. let c = 0
  1034. for (let i = 0; i < this.table3.list.length; i++) {
  1035. if (b !== parseInt(this.table3.list[i].sort)) {
  1036. b = this.table3.list[i].sort
  1037. a = 0
  1038. }
  1039. a = a + parseFloat(this.table3.list[i].weight)
  1040. c = c + parseFloat(this.table3.list[i].weight)
  1041. arr.push(this.table3.list[i])
  1042. }
  1043. arr.push({ 'sort': '总计', 'weight': c.toFixed(2) })
  1044. this.table3.list = arr
  1045. }
  1046. this.table3.pageNum = response.data.pageNum
  1047. this.table3.pageSize = response.data.pageSize
  1048. this.table3.total = response.data.total
  1049. } else {
  1050. this.table3.list = []
  1051. }
  1052. setTimeout(() => {
  1053. this.table3.listLoading = false
  1054. }, 100)
  1055. })
  1056. },
  1057. // 新生成
  1058. handleCreate() {
  1059. console.log('点击了新生成')
  1060. this.newGeneration.temp.inputDatetime = [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')]
  1061. this.newGeneration.dialogStatus = 'newGeneration'
  1062. this.newGeneration.dialogFormVisible = true
  1063. GetDataByName(this.newGeneration.getdataListParm).then(response => {
  1064. console.log('table数据', response.data.list)
  1065. if (response.data.list !== null) {
  1066. if (response.data.list[0].vmsg == '存在未分配') {
  1067. this.$message({ type: 'warning', message: '撒料计划中存在未分配完栏舍,建议及时进行分配', duration: 2000 })
  1068. }
  1069. }
  1070. })
  1071. },
  1072. DateDiff(sDate1, sDate2) {
  1073. console.log(sDate1, sDate2)
  1074. var aDate, oDate1, oDate2, iDays
  1075. aDate = sDate1.split('-')
  1076. oDate1 = new Date(aDate[0], aDate[1], aDate[2]) // 转换为12-18-2006格式
  1077. aDate = sDate2.split('-')
  1078. oDate2 = new Date(aDate[0], aDate[1], aDate[2])
  1079. iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24) // 把相差的毫秒数转换为天数
  1080. this.newGeneration.temp.days = parseInt(iDays) + 1
  1081. return iDays
  1082. },
  1083. newGenerationData() {
  1084. console.log('点击了新生成保存', this.newGeneration.temp)
  1085. this.isokDisable = true
  1086. setTimeout(() => {
  1087. this.isokDisable = false
  1088. }, 5000)
  1089. this.$refs['temp'].validate(valid => {
  1090. if (valid) {
  1091. this.newGeneration.temp.startTime = parseTime(this.newGeneration.temp.inputDatetime[0], '{y}-{m}-{d}')
  1092. this.newGeneration.temp.stopTime = parseTime(this.newGeneration.temp.inputDatetime[1], '{y}-{m}-{d}')
  1093. this.DateDiff(this.newGeneration.temp.stopTime, this.newGeneration.temp.startTime)
  1094. this.requestParam = {}
  1095. this.requestParam.common = { 'returnmap': '0' }
  1096. this.requestParam.data = []
  1097. this.requestParam.data[0] = { 'name': 'checkDLPIsStart', 'type': 'v', 'parammaps': {
  1098. pastureid: Cookies.get('pastureid'),
  1099. startTime: this.newGeneration.temp.startTime
  1100. }}
  1101. this.requestParam.data[1] = { 'name': 'checkPreMixStorage', 'type': 'e', 'parammaps': {
  1102. pastureid: Cookies.get('pastureid'),
  1103. days: this.newGeneration.temp.days
  1104. }}
  1105. this.requestParam.data[2] = { 'name': 'createdownloadedplan', 'type': 'e', 'parammaps': {
  1106. pastureid: Cookies.get('pastureid'),
  1107. startTime: this.newGeneration.temp.startTime,
  1108. stopTime: this.newGeneration.temp.stopTime
  1109. }}
  1110. ExecDataByConfig(this.requestParam).then(response => {
  1111. console.log('新生成保存发送参数', this.requestParam)
  1112. if (response.msg === 'fail') {
  1113. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1114. } else {
  1115. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1116. this.newGeneration.dialogFormVisible = false
  1117. this.getList()
  1118. }
  1119. })
  1120. }
  1121. })
  1122. },
  1123. // 修改计划
  1124. handleRevisePlan(data) {
  1125. var arr = []
  1126. for (let i = 0; i < this.table.list.length; i++) {
  1127. if (this.table.list[i].havebutton == 1) {
  1128. arr.push(this.table.list[i])
  1129. }
  1130. }
  1131. if (arr.length !== this.table.list.length) {
  1132. console.log('点击了修改计划1', this.activeName)
  1133. this.isShowDialog = true
  1134. this.activeName = '栏舍配方'
  1135. console.log('点击了修改计划2', this.activeName)
  1136. } else {
  1137. this.$message({ type: 'error', message: '当前日期不可修改计划,请重新选择日期' })
  1138. }
  1139. },
  1140. handleExport() {
  1141. console.log('点击了导出')
  1142. },
  1143. rowDrop() {
  1144. console.log(document.querySelector('#table1 .el-table__body-wrapper tbody'))
  1145. const tbody = document.querySelector('#table1 .el-table__body-wrapper tbody')
  1146. // this.sorTable()
  1147. const that = this
  1148. var sortable = Sortable.create(tbody, {
  1149. disabled: that.dropState,
  1150. onChoose({ newIndex, oldIndex }) {
  1151. console.log(that.isOrder, 'that.isOrder == false')
  1152. console.log(that.dropState, 'that.dropState')
  1153. if (that.dropState == true || that.isOrder == true) {
  1154. sortable.destroy()
  1155. }
  1156. },
  1157. onEnd(evt) {
  1158. var tableList = [...that.table.list] // 保留拖动前数据
  1159. const targetRow = that.table.list.splice(evt.oldIndex, 1)[0] // 拖动数据
  1160. const targetRow2 = that.table.list[evt.newIndex] // 拖动后下方数据
  1161. const targetRow3 = that.table.list[evt.newIndex - 1] // 拖动后上方数据
  1162. console.log(targetRow, 'targetRow')
  1163. console.log(targetRow2, 'targetRow2')
  1164. console.log(targetRow3, 'targetRow3')
  1165. that.table.list.splice(evt.newIndex, 0, targetRow)
  1166. // ==========
  1167. // 已执行的计划不可拖动
  1168. if (targetRow.havebutton == 1) {
  1169. that.$nextTick(() => {
  1170. that.$set(that.table, 'list', tableList)
  1171. })
  1172. that.$message({ type: 'error', message: '因已执行的计划不可调整顺序', duration: 2000 })
  1173. return false
  1174. }
  1175. // 相同班次之间可以拖动
  1176. if (targetRow2 !== undefined && targetRow3 !== undefined) {
  1177. if (targetRow.times !== targetRow2.times && targetRow.times !== targetRow3.times) {
  1178. that.$nextTick(() => {
  1179. that.$set(that.table, 'list', tableList)
  1180. })
  1181. that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
  1182. return false
  1183. }
  1184. } else if (targetRow2 !== undefined && targetRow3 == undefined) {
  1185. if (targetRow.times !== targetRow2.times) {
  1186. that.$nextTick(() => {
  1187. that.$set(that.table, 'list', tableList)
  1188. })
  1189. that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
  1190. return false
  1191. }
  1192. } else if (targetRow2 == undefined && targetRow3 !== undefined) {
  1193. if (targetRow.times !== targetRow3.times) {
  1194. that.$nextTick(() => {
  1195. that.$set(that.table, 'list', tableList)
  1196. })
  1197. that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
  1198. return false
  1199. }
  1200. }
  1201. // 撒料计划0,
  1202. // 撒料计划-混料1
  1203. // 撒料计划-撒料2
  1204. // 剩料计划3
  1205. // 预混计划4
  1206. // 预称重计划5
  1207. if (targetRow.lpplantype == 1) { // 拖动数据为撒料计划-混料
  1208. if (targetRow2 == undefined) {
  1209. that.$nextTick(() => {
  1210. that.$set(that.table, 'list', tableList)
  1211. })
  1212. } else if (targetRow2 !== undefined && targetRow2.pid == targetRow.pid) {
  1213. that.$nextTick(() => {
  1214. that.$set(that.table, 'list', tableList)
  1215. })
  1216. } else {
  1217. var pidArr = [] // pid相同的值
  1218. var pidArr1 = [] //
  1219. var index // 索引
  1220. for (let i = 0; i < tableList.length; i++) {
  1221. if (tableList[i].pid == targetRow.pid) {
  1222. pidArr.push(tableList[i])
  1223. } else {
  1224. pidArr1.push(tableList[i])
  1225. }
  1226. }
  1227. // 找到对应上方pid 的ID
  1228. // 比如说id 580243 找到对应的索引
  1229. if (targetRow3 !== undefined) {
  1230. for (let i = 0; i < pidArr1.length; i++) {
  1231. if (pidArr1[i].id == targetRow3.id) {
  1232. index = i
  1233. }
  1234. }
  1235. } else {
  1236. for (let i = 0; i < pidArr1.length; i++) {
  1237. if (pidArr1[i].id == targetRow2.id) {
  1238. index = i - 1
  1239. }
  1240. }
  1241. }
  1242. pidArr1.splice(index + 1, 0, ...pidArr)
  1243. console.log(pidArr1)
  1244. that.$nextTick(() => {
  1245. that.table.list = pidArr1
  1246. })
  1247. }
  1248. if (targetRow2 !== undefined && targetRow3 !== undefined) {
  1249. if (targetRow2.pid == targetRow3.pid) {
  1250. that.$nextTick(() => {
  1251. that.$set(that.table, 'list', tableList)
  1252. })
  1253. that.$message({ type: 'error', message: '不可将其他计划拖动至预称重计划之间', duration: 2000 })
  1254. return false
  1255. }
  1256. }
  1257. } else if (targetRow.lpplantype == 5) { // 拖动数据为预称重计划
  1258. if (targetRow2 !== undefined) {
  1259. console.log(targetRow3, targetRow2, 'zhidao')
  1260. if (targetRow3 !== undefined) {
  1261. if (targetRow3.pid !== targetRow.pid && targetRow2.pid !== targetRow.pid) {
  1262. that.$nextTick(() => {
  1263. that.$set(that.table, 'list', tableList)
  1264. })
  1265. that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
  1266. return false
  1267. } else {
  1268. if (targetRow3.lpplantype == 0 && targetRow2.pid !== targetRow.pid) {
  1269. that.$nextTick(() => {
  1270. that.$set(that.table, 'list', tableList)
  1271. })
  1272. that.$message({ type: 'error', message: '预称重计划不可拖动至撒料计划下方', duration: 2000 })
  1273. return false
  1274. }
  1275. }
  1276. } else {
  1277. if (targetRow2.pid !== targetRow.pid) {
  1278. that.$nextTick(() => {
  1279. that.$set(that.table, 'list', tableList)
  1280. })
  1281. that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
  1282. return false
  1283. } else {
  1284. if (targetRow2.pid !== targetRow.pid) {
  1285. that.$nextTick(() => {
  1286. that.$set(that.table, 'list', tableList)
  1287. })
  1288. that.$message({ type: 'error', message: '预称重计划不可拖动至撒料计划下方', duration: 2000 })
  1289. return false
  1290. }
  1291. }
  1292. }
  1293. } else {
  1294. if (targetRow2 == undefined) {
  1295. that.$nextTick(() => {
  1296. that.$set(that.table, 'list', tableList)
  1297. })
  1298. that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
  1299. return false
  1300. } else if (targetRow3.pid !== targetRow.pid) {
  1301. that.$nextTick(() => {
  1302. that.$set(that.table, 'list', tableList)
  1303. })
  1304. that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
  1305. return false
  1306. } else {
  1307. if (targetRow3.lpplantype == 0) {
  1308. that.$nextTick(() => {
  1309. that.$set(that.table, 'list', tableList)
  1310. })
  1311. that.$message({ type: 'error', message: '预称重计划不可拖动至撒料计划下方', duration: 2000 })
  1312. return false
  1313. }
  1314. }
  1315. }
  1316. if (targetRow2 !== undefined && targetRow3 !== undefined) {
  1317. if (targetRow2.pid !== targetRow.pid && targetRow3.pid !== targetRow.pid) {
  1318. that.$nextTick(() => {
  1319. that.$set(that.table, 'list', tableList)
  1320. })
  1321. that.$message({ type: 'error', message: '不可将其他计划拖动至预称重计划之间', duration: 2000 })
  1322. return false
  1323. } else if (targetRow3.pid == targetRow.pid && (targetRow3.lpplantype == 1 || targetRow3.lpplantype == 2)) {
  1324. that.$nextTick(() => {
  1325. that.$set(that.table, 'list', tableList)
  1326. })
  1327. that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
  1328. return false
  1329. }
  1330. }
  1331. } else if (targetRow.lpplantype == 2) { // 拖动数据为撒料计划-撒料
  1332. if (targetRow2 == undefined) {
  1333. if (targetRow3.pid !== targetRow.pid) {
  1334. that.$nextTick(() => {
  1335. that.$set(that.table, 'list', tableList)
  1336. })
  1337. that.$message({ type: 'error', message: '撒料计划-撒料不可拖动至其他位置', duration: 2000 })
  1338. return false
  1339. }
  1340. } else {
  1341. if (targetRow2.lpplantype == 1 && (targetRow2.pid == targetRow.pid || targetRow2 == undefined)) {
  1342. // 拖动数据下方为撒料计划-混料时且pid相同,不可拖动,提示
  1343. that.$nextTick(() => {
  1344. that.$set(that.table, 'list', tableList)
  1345. })
  1346. that.$message({ type: 'error', message: '撒料计划-撒料不可拖动至撒料计划-混料上方', duration: 2000 })
  1347. return false
  1348. } else if (targetRow.lpplantype == 2 && (targetRow2.pid == targetRow.pid || targetRow3.pid == targetRow.pid || targetRow2 == undefined || targetRow3 == undefined)) {
  1349. console.log('正常拖动')
  1350. } else {
  1351. that.$nextTick(() => {
  1352. that.$set(that.table, 'list', tableList)
  1353. })
  1354. that.$message({ type: 'error', message: '撒料计划-撒料不可拖动至其他位置', duration: 2000 })
  1355. return false
  1356. }
  1357. }
  1358. if (targetRow2 !== undefined && targetRow3 !== undefined) {
  1359. if (targetRow2.pid == targetRow3.pid) {
  1360. that.$nextTick(() => {
  1361. that.$set(that.table, 'list', tableList)
  1362. })
  1363. that.$message({ type: 'error', message: '不可将其他计划拖动至预称重计划之间', duration: 2000 })
  1364. return false
  1365. }
  1366. }
  1367. } else if (targetRow.lpplantype == 0) { // 拖动数据为撒料计划
  1368. console.log('遍历有相同的pid,一起跟着拖动3')
  1369. var pidArr = [] // pid相同的值
  1370. var pidArr1 = [] //
  1371. var index // 索引
  1372. for (let i = 0; i < tableList.length; i++) {
  1373. if (tableList[i].pid == targetRow.pid) {
  1374. pidArr.push(tableList[i])
  1375. } else {
  1376. pidArr1.push(tableList[i])
  1377. }
  1378. }
  1379. if (pidArr.length > 0) {
  1380. // 找到对应上方pid 的ID
  1381. // 比如说id 580243 找到对应的索引
  1382. if (targetRow3 !== undefined) {
  1383. for (let i = 0; i < pidArr1.length; i++) {
  1384. if (pidArr1[i].id == targetRow3.id) {
  1385. index = i
  1386. }
  1387. }
  1388. } else {
  1389. for (let i = 0; i < pidArr1.length; i++) {
  1390. if (pidArr1[i].id == targetRow2.id) {
  1391. index = i - 1
  1392. }
  1393. }
  1394. }
  1395. pidArr1.splice(index + 1, 0, ...pidArr)
  1396. console.log(pidArr1)
  1397. that.$nextTick(() => {
  1398. that.table.list = pidArr1
  1399. })
  1400. }
  1401. if (targetRow2 !== undefined && targetRow3 !== undefined) {
  1402. if (targetRow2.pid == targetRow3.pid) {
  1403. that.$nextTick(() => {
  1404. that.$set(that.table, 'list', tableList)
  1405. })
  1406. that.$message({ type: 'error', message: '不可将其他计划拖动至预称重计划之间', duration: 2000 })
  1407. return false
  1408. }
  1409. }
  1410. } else if (targetRow.lpplantype == 3 || targetRow.lpplantype == 4) {
  1411. if (targetRow2 !== undefined && targetRow3 !== undefined) {
  1412. if (targetRow2.pid == targetRow3.pid) {
  1413. if (targetRow2.lpplantype == 5 && targetRow3.lpplantype == 5) {
  1414. that.$nextTick(() => {
  1415. that.$set(that.table, 'list', tableList)
  1416. })
  1417. that.$message({ type: 'error', message: '不可拖动至预称重计划跟预称重计划之间', duration: 2000 })
  1418. return false
  1419. } else {
  1420. that.$nextTick(() => {
  1421. that.$set(that.table, 'list', tableList)
  1422. })
  1423. that.$message({ type: 'error', message: '不可拖动至撒料计划-撒料跟撒料计划-混料之间', duration: 2000 })
  1424. return false
  1425. }
  1426. }
  1427. }
  1428. // ========
  1429. var pidArr = [] // pid相同的值
  1430. var pidArr1 = [] //
  1431. var index // 索引
  1432. for (let i = 0; i < tableList.length; i++) {
  1433. if (tableList[i].pid == targetRow.pid) {
  1434. pidArr.push(tableList[i])
  1435. } else {
  1436. pidArr1.push(tableList[i])
  1437. }
  1438. }
  1439. if (pidArr.length > 0) {
  1440. // 找到对应上方pid 的ID
  1441. // 比如说id 580243 找到对应的索引
  1442. if (targetRow3 !== undefined) {
  1443. for (let i = 0; i < pidArr1.length; i++) {
  1444. if (pidArr1[i].id == targetRow3.id) {
  1445. index = i
  1446. }
  1447. }
  1448. } else {
  1449. for (let i = 0; i < pidArr1.length; i++) {
  1450. if (pidArr1[i].id == targetRow2.id) {
  1451. index = i - 1
  1452. }
  1453. }
  1454. }
  1455. pidArr1.splice(index + 1, 0, ...pidArr)
  1456. console.log(pidArr1)
  1457. that.$nextTick(() => {
  1458. that.table.list = pidArr1
  1459. })
  1460. }
  1461. if (targetRow2 !== undefined && targetRow3 !== undefined) {
  1462. if (targetRow2.pid == targetRow3.pid) {
  1463. that.$nextTick(() => {
  1464. that.$set(that.table, 'list', tableList)
  1465. })
  1466. that.$message({ type: 'error', message: '不可将其他计划拖动至预称重计划之间9999', duration: 2000 })
  1467. return false
  1468. }
  1469. }
  1470. }
  1471. // ===
  1472. }
  1473. })
  1474. },
  1475. // 复制
  1476. handleCopy() {
  1477. if (this.table.list.length > 0) {
  1478. this.newGeneration.temp = {}
  1479. this.newGeneration.dialogStatus = 'copy'
  1480. this.newGeneration.dialogFormVisible = true
  1481. } else {
  1482. this.$message({ type: 'error', message: '当前无计划可复制' })
  1483. }
  1484. },
  1485. copyData() {
  1486. console.log(this.newGeneration.temp.copyInputDatetime)
  1487. this.isokDisable = true
  1488. setTimeout(() => {
  1489. this.isokDisable = false
  1490. }, 5000)
  1491. this.$refs['temp'].validate(valid => {
  1492. if (valid) {
  1493. this.requestParam.name = 'copydownloadedplan'
  1494. this.requestParam.parammaps = {}
  1495. this.requestParam.parammaps.pastureid = Cookies.get('pastureid')
  1496. this.requestParam.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1497. this.requestParam.parammaps.startTime = parseTime(this.newGeneration.temp.copyInputDatetime[0], '{y}-{m}-{d}')
  1498. this.requestParam.parammaps.stopTime = parseTime(this.newGeneration.temp.copyInputDatetime[1], '{y}-{m}-{d}')
  1499. PostDataByName(this.requestParam).then(response => {
  1500. if (response.msg === 'fail') {
  1501. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1502. } else {
  1503. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  1504. this.newGeneration.dialogFormVisible = false
  1505. this.getList()
  1506. }
  1507. })
  1508. }
  1509. })
  1510. },
  1511. handleChangeOrder() {
  1512. // 拖动顺序
  1513. this.isOrder = false
  1514. this.rowDrop()
  1515. },
  1516. saveChangeOrder() {
  1517. // 保存顺序
  1518. var sortList = []
  1519. for (let i = 0; i < this.table.list.length; i++) {
  1520. var obj = {}
  1521. obj.sort = i
  1522. obj.pastureid = this.table.list[i].pastureid
  1523. obj.id = this.table.list[i].id
  1524. sortList.push(obj)
  1525. }
  1526. console.log(sortList)
  1527. this.requestParam = {}
  1528. this.requestParam.common = { 'returnmap': '0' }
  1529. this.requestParam.data = []
  1530. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': sortList }}
  1531. this.requestParam.data[0].children = []
  1532. this.requestParam.data[0].children[0] = { 'name': 'updatedownloadesort', 'type': 'e', 'parammaps': {
  1533. id: '@insertSpotList.id',
  1534. pastureid: '@insertSpotList.pastureid',
  1535. sort: '@insertSpotList.sort'
  1536. }}
  1537. ExecDataByConfig(this.requestParam).then(response => {
  1538. console.log('顺序切换保存发送参数', this.requestParam)
  1539. if (response.msg === 'fail') {
  1540. this.$notify({ title: '顺序切换失败', message: response.data, type: 'warning', duration: 2000 })
  1541. } else {
  1542. this.$notify({ title: '', message: '顺序切换成功', type: 'success', duration: 2000 })
  1543. this.getList()
  1544. this.isOrder = true
  1545. }
  1546. })
  1547. },
  1548. cancelChangeOrder() {
  1549. // 取消顺序
  1550. this.getList()
  1551. this.isOrder = true
  1552. }
  1553. }
  1554. }
  1555. </script>
  1556. <style>
  1557. .el-table .warning-row {
  1558. background: oldlace;
  1559. }
  1560. .el-table .success-row {
  1561. background: #f0f9eb;
  1562. }
  1563. </style>
  1564. <style lang="scss" scoped>
  1565. .operation{margin-bottom:10px;}
  1566. .search{margin-top:10px;}
  1567. .table{margin-top:10px;}
  1568. .template{
  1569. background: #fff;
  1570. position: relative;
  1571. }
  1572. .table2{
  1573. float: left;width: 49%;margin-right: 1%;background: red;
  1574. background: #fff;
  1575. position: relative;
  1576. .content-table{margin-top: 70px;}
  1577. }
  1578. .table3{
  1579. float: left;
  1580. width: 49%;
  1581. background: #fff;
  1582. position: relative;
  1583. .content-table{margin-top: 70px;}
  1584. }
  1585. </style>