e36c651dc777db3115c4c79022551e65e5204244.svn-base 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177
  1. <template>
  2. <div class="app-container">
  3. <!-- <h1>牧场</h1> -->
  4. <div class="search">
  5. <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" :picker-options="pickerOptions" />
  6. <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled" @click="handleBefore" />
  7. <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled" @click="handleNext" />
  8. <el-select v-model="table.getdataListParm.parammaps.lpplantype" placeholder="计划类型" class="filter-item" style="width: 120px;" clearable>
  9. <el-option v-for="item in planTypeList" :key="item.value" :label="item.lable" :value="item.value" />
  10. </el-select>
  11. <el-input v-model="table.getdataListParm.parammaps.tmrtname" placeholder="TMR名称" style="width: 180px;" class="filter-item" clearable />
  12. <el-select v-model="table.getdataListParm.parammaps.iscompleted" placeholder="工作状态" class="filter-item" style="width: 120px;" clearable>
  13. <el-option v-for="item in workingConditionList" :key="item.id" :label="item.name" :value="item.id" />
  14. </el-select>
  15. <el-button class="successBorder" @click="handleSearch">查询</el-button>
  16. <el-button class="successBorder" @click="handleRefresh">重置</el-button>
  17. </div>
  18. <el-row :gutter="10">
  19. <el-col :span="8">
  20. <h4>TMR设备列表</h4>
  21. <div class="table">
  22. <el-table
  23. :key="table.tableKey"
  24. v-loading="table.listLoading"
  25. element-loading-text="给我一点时间"
  26. :data="table.list"
  27. border
  28. fit
  29. highlight-current-row
  30. style="width: 98%;"
  31. :row-style="rowStyle"
  32. :cell-style="cellStyle"
  33. class="elTable table-fixed"
  34. height="970px"
  35. @row-click="rowClick"
  36. >
  37. <el-table-column sortable label="开始时间" min-width="100px" align="center" prop="intime" />
  38. <el-table-column sortable label="计划类型" min-width="80px" align="center" prop="lpplantype" />
  39. <el-table-column sortable label="描述" min-width="90px" align="center" prop="remark" />
  40. <el-table-column sortable label="TMR名称" min-width="80px" align="center" prop="tmrtname" />
  41. </el-table>
  42. </div>
  43. <span v-if="table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ table.total }}条</span>
  44. </el-col>
  45. <!-- 预混计划 -->
  46. <el-col v-if="isPremixedPlan" :span="16">
  47. <div class="title">
  48. <b>过程详情</b>
  49. <span>&nbsp;({{ title }})</span>
  50. </div>
  51. <div class="detail">
  52. <div v-if="table2.list.length !== 0">
  53. <b>{{ table2.list[0].proesstime }}</b>
  54. <span>过程时间</span>
  55. </div>
  56. <div v-if="table2.list.length !== 0">
  57. <b>{{ table2.list[0].proesstime }}</b>
  58. <span>混料时间</span>
  59. </div>
  60. <div v-if="table2.list.length !== 0">
  61. <b>{{ table2.list[0].iscompleted }}</b>
  62. <span>工作状态</span>
  63. </div>
  64. <div v-if="table2.list.length !== 0">
  65. <b>{{ table2.list[0].Hdif }}</b>
  66. <span>混料误差值</span>
  67. </div>
  68. <div v-if="table2.list.length !== 0">
  69. <b>{{ table2.list[0].HdifRate }}</b>
  70. <span>混料准确率</span>
  71. </div>
  72. </div>
  73. <div class="Mixture">
  74. <h4>混料详情</h4>
  75. <el-table
  76. :key="table3.tableKey"
  77. v-loading="table3.listLoading"
  78. element-loading-text="给我一点时间"
  79. :data="table3.list"
  80. border
  81. fit
  82. highlight-current-row
  83. style="width: 98%;"
  84. :row-style="rowStyle"
  85. :cell-style="cellStyle"
  86. class="elTable table-fixed"
  87. >
  88. <el-table-column label="操作编号" min-width="60px" align="center" prop="sort" />
  89. <el-table-column label="饲料名称" min-width="60px" align="center" prop="fname" />
  90. <el-table-column label="计划重量" min-width="60px" align="center" prop="lweight" />
  91. <el-table-column label="实际重量" min-width="60px" align="center" prop="actualweightminus" />
  92. <el-table-column label="误差值" min-width="60px" align="center" prop="diff" />
  93. <el-table-column label="准确率" min-width="60px" align="center" prop="diffRate" />
  94. <el-table-column label="完成时间" min-width="60px" align="center" prop="intime" />
  95. <el-table-column label="过程时间" min-width="60px" align="center" prop="proesstime" />
  96. <el-table-column label="跳转方式" min-width="60px" align="center" prop="buttontype" />
  97. <el-table-column label="开始重量" min-width="60px" align="center" prop="lastactualweight" />
  98. <el-table-column label="结束重量" min-width="60px" align="center" prop="actualweight" />
  99. </el-table>
  100. </div>
  101. </el-col>
  102. <!-- 撒料计划 -->
  103. <el-col v-if="isSpreadingPlan" :span="16">
  104. <div class="title">
  105. <b>过程详情</b>
  106. <span>&nbsp;({{ title }})</span>
  107. </div>
  108. <div class="detail">
  109. <div v-if="table2.list.length !== 0">
  110. <b>{{ table2.list[0].proesstime }}</b>
  111. <span>过程时间</span>
  112. </div>
  113. <div v-if="table2.list.length !== 0">
  114. <b>{{ table2.list[0].proesstime }}</b>
  115. <span>混料时间</span>
  116. </div>
  117. <div v-if="table2.list.length !== 0">
  118. <b>{{ table2.list[0].iscompleted }}</b>
  119. <span>工作状态</span>
  120. </div>
  121. <div v-if="table2.list.length !== 0">
  122. <b>{{ table2.list[0].Hdif }}kg</b>
  123. <span>混料误差值</span>
  124. </div>
  125. <div v-if="table2.list.length !== 0">
  126. <b>{{ table2.list[0].HdifRate }}</b>
  127. <span>混料准确率</span>
  128. </div>
  129. <div v-if="table2.list.length !== 0">
  130. <b>{{ table2.list[0].Sdif }}kg</b>
  131. <span>撒料误差值</span>
  132. </div>
  133. <div v-if="table2.list.length !== 0">
  134. <b>{{ table2.list[0].SdifRate }}</b>
  135. <span>撒料准确率</span>
  136. </div>
  137. </div>
  138. <div class="Mixture">
  139. <h4>混料详情</h4>
  140. <el-table
  141. :key="table3.tableKey"
  142. v-loading="table3.listLoading"
  143. element-loading-text="给我一点时间"
  144. :data="table3.list"
  145. border
  146. fit
  147. highlight-current-row
  148. style="width: 98%;"
  149. :row-style="rowStyle"
  150. :cell-style="cellStyle"
  151. class="elTable table-fixed"
  152. >
  153. <el-table-column label="操作编号" min-width="70px" align="center" prop="sort" />
  154. <el-table-column label="饲料名称" min-width="70px" align="center" prop="fname" />
  155. <el-table-column label="计划重量" min-width="50px" align="center" prop="lweight" />
  156. <el-table-column label="实际重量" min-width="70px" align="center" prop="actualweightminus" />
  157. <el-table-column label="误差值" min-width="70px" align="center" prop="diff" />
  158. <el-table-column label="准确率" min-width="70px" align="center" prop="diffRate" />
  159. <el-table-column label="完成时间" min-width="70px" align="center" prop="intime" />
  160. <el-table-column label="过程时间" min-width="70px" align="center" prop="proesstime" />
  161. <el-table-column label="跳转方式" min-width="70px" align="center" prop="buttontype" />
  162. <el-table-column label="开始重量" min-width="70px" align="center" prop="lastactualweight" />
  163. <el-table-column label="结束重量" min-width="70px" align="center" prop="actualweight" />
  164. </el-table>
  165. </div>
  166. <div class="SpreadingMaterials">
  167. <h4>撒料详情</h4>
  168. <el-table
  169. :key="table4.tableKey"
  170. v-loading="table4.listLoading"
  171. element-loading-text="给我一点时间"
  172. :data="table4.list"
  173. border
  174. fit
  175. highlight-current-row
  176. style="width: 98%;"
  177. :row-style="rowStyle"
  178. :cell-style="cellStyle"
  179. class="elTable table-fixed"
  180. max-height="200px"
  181. >
  182. <el-table-column label="操作编号" min-width="70px" align="center" prop="sort" />
  183. <el-table-column label="栏舍名称" min-width="70px" align="center" prop="fname" />
  184. <el-table-column label="计划重量" min-width="70px" align="center" prop="lweight" />
  185. <el-table-column label="实际重量" min-width="70px" align="center" prop="actualweightminus" />
  186. <el-table-column label="误差值" min-width="70px" align="center" prop="diff" />
  187. <el-table-column label="准确率" min-width="70px" align="center" prop="diffRate" />
  188. <el-table-column label="完成时间" min-width="70px" align="center" prop="intime" />
  189. <el-table-column label="过程时间" min-width="70px" align="center" prop="proesstime" />
  190. <el-table-column label="跳转方式" min-width="70px" align="center" prop="buttontype" />
  191. <el-table-column label="开始重量" min-width="70px" align="center" prop="lastactualweight" />
  192. <el-table-column label="结束重量" min-width="70px" align="center" prop="actualweight" />
  193. </el-table>
  194. </div>
  195. <div class="ControlChart">
  196. <h4>监控图</h4>
  197. <div id="chartLine" style="width: 100%;height:300px;" />
  198. </div>
  199. </el-col>
  200. <!-- 剩料计划 -->
  201. <el-col v-if="isResidualMaterialPlan" :span="16">
  202. <div class="title">
  203. <b>过程详情</b>
  204. <span>&nbsp;({{ title }})</span>
  205. </div>
  206. <div class="detail">
  207. <div v-if="table2.list.length !== 0">
  208. <b>{{ table2.list[0].proesstime }}</b>
  209. <span>过程时间</span>
  210. </div>
  211. <div v-if="table2.list.length !== 0">
  212. <b>{{ table2.list[0].iscompleted }}</b>
  213. <span>工作状态</span>
  214. </div>
  215. </div>
  216. <div class="Mixture">
  217. <h4>剩料收集详情</h4>
  218. <el-table
  219. :key="table3.tableKey"
  220. v-loading="table3.listLoading"
  221. element-loading-text="给我一点时间"
  222. :data="table3.list"
  223. border
  224. fit
  225. highlight-current-row
  226. style="width: 98%;"
  227. :row-style="rowStyle"
  228. :cell-style="cellStyle"
  229. class="elTable table-fixed"
  230. max-height="200px"
  231. >
  232. <el-table-column label="操作编号" min-width="110px" align="center">
  233. <template slot-scope="scope">
  234. <span>{{ scope.row.sort }}</span>
  235. </template>
  236. </el-table-column>
  237. <el-table-column label="栏舍名称" min-width="90px" align="center">
  238. <template slot-scope="scope">
  239. <span>{{ scope.row.fname }}</span>
  240. </template>
  241. </el-table-column>
  242. <el-table-column label="剩料采集重量(kg)" min-width="110px" align="center">
  243. <template slot-scope="scope">
  244. <span>{{ scope.row.sweight }}</span>
  245. </template>
  246. </el-table-column>
  247. </el-table>
  248. </div>
  249. <div class="SpreadingMaterials">
  250. <h4>撒料详情</h4>
  251. <el-table
  252. :key="table4.tableKey"
  253. v-loading="table4.listLoading"
  254. :span-method="objectSpanMethod"
  255. element-loading-text="给我一点时间"
  256. :data="table4.list"
  257. border
  258. fit
  259. highlight-current-row
  260. style="width: 98%;"
  261. :row-style="rowStyle"
  262. :cell-style="cellStyle"
  263. class="elTable table-fixed"
  264. max-height="200px"
  265. >
  266. <el-table-column label="操作编号" min-width="110px" align="center" prop="sort" />
  267. <el-table-column label="转投栏舍" min-width="110px" align="center" prop="fname" />
  268. <el-table-column label="允许分配剩料量" min-width="110px" align="center" prop="lweight" />
  269. <el-table-column label="实际分配重量(kg)" min-width="110px" align="center" prop="actualweightminus" />
  270. <el-table-column label="废弃剩料重量" min-width="110px" align="center" prop="aweight" />
  271. </el-table>
  272. </div>
  273. </el-col>
  274. <!-- 撒料计划-混料 -->
  275. <el-col v-if="isSpreadingPlanSH" :span="16">
  276. <div class="title">
  277. <b>过程详情</b>
  278. <span>&nbsp;({{ title }})</span>
  279. </div>
  280. <div class="detail">
  281. <div v-if="table2.list.length !== 0">
  282. <b>{{ table2.list[0].proesstime }}</b>
  283. <span>过程时间</span>
  284. </div>
  285. <div v-if="table2.list.length !== 0">
  286. <b>{{ table2.list[0].proesstime }}</b>
  287. <span>混料时间</span>
  288. </div>
  289. <div v-if="table2.list.length !== 0">
  290. <b>{{ table2.list[0].iscompleted }}</b>
  291. <span>工作状态</span>
  292. </div>
  293. <div v-if="table2.list.length !== 0">
  294. <b>{{ table2.list[0].Hdif }}kg</b>
  295. <span>混料误差值</span>
  296. </div>
  297. <div v-if="table2.list.length !== 0">
  298. <b>{{ table2.list[0].HdifRate }}</b>
  299. <span>混料准确率</span>
  300. </div>
  301. <div v-if="table2.list.length !== 0">
  302. <b>{{ table2.list[0].Sdif }}kg</b>
  303. <span>撒料误差值</span>
  304. </div>
  305. <div v-if="table2.list.length !== 0">
  306. <b>{{ table2.list[0].SdifRate }}</b>
  307. <span>撒料准确率</span>
  308. </div>
  309. </div>
  310. <div class="Mixture">
  311. <h4>混料详情</h4>
  312. <el-table
  313. :key="table3.tableKey"
  314. v-loading="table3.listLoading"
  315. element-loading-text="给我一点时间"
  316. :data="table3.list"
  317. border
  318. fit
  319. highlight-current-row
  320. style="width: 98%;"
  321. :row-style="rowStyle"
  322. :cell-style="cellStyle"
  323. class="elTable table-fixed"
  324. >
  325. <el-table-column label="操作编号" min-width="60px" align="center" prop="sort" />
  326. <el-table-column label="饲料名称" min-width="60px" align="center" prop="fname" />
  327. <el-table-column label="计划重量" min-width="60px" align="center" prop="lweight" />
  328. <el-table-column label="实际重量" min-width="60px" align="center" prop="actualweightminus" />
  329. <el-table-column label="误差值" min-width="60px" align="center" prop="diff" />
  330. <el-table-column label="准确率" min-width="60px" align="center" prop="diffRate" />
  331. <el-table-column label="完成时间" min-width="60px" align="center" prop="intime" />
  332. <el-table-column label="过程时间" min-width="60px" align="center" prop="proesstime" />
  333. <el-table-column label="跳转方式" min-width="60px" align="center" prop="buttontype" />
  334. <el-table-column label="开始重量" min-width="60px" align="center" prop="lastactualweight" />
  335. <el-table-column label="结束重量" min-width="60px" align="center" prop="actualweight" />
  336. </el-table>
  337. </div>
  338. <div class="SpreadingMaterials">
  339. <h4>撒料详情</h4>
  340. <el-table
  341. :key="table4.tableKey"
  342. v-loading="table4.listLoading"
  343. element-loading-text="给我一点时间"
  344. :data="table4.list"
  345. border
  346. fit
  347. highlight-current-row
  348. style="width: 98%;"
  349. :row-style="rowStyle"
  350. :cell-style="cellStyle"
  351. class="elTable table-fixed"
  352. max-height="200px"
  353. >
  354. <el-table-column label="操作编号" min-width="60px" align="center" prop="sort" />
  355. <el-table-column label="撒料车辆" min-width="60px" align="center" prop="fname" />
  356. <el-table-column label="计划重量" min-width="60px" align="center" prop="lweight" />
  357. <el-table-column label="实际重量" min-width="60px" align="center" prop="actualweightminus" />
  358. <el-table-column label="误差值" min-width="60px" align="center" prop="diff" />
  359. <el-table-column label="准确率" min-width="60px" align="center" prop="diffRate" />
  360. <el-table-column label="完成时间" min-width="60px" align="center" prop="intime" />
  361. <el-table-column label="过程时间" min-width="60px" align="center" prop="proesstime" />
  362. <el-table-column label="跳转方式" min-width="60px" align="center" prop="buttontype" />
  363. <el-table-column label="开始重量" min-width="60px" align="center" prop="lastactualweight" />
  364. <el-table-column label="结束重量" min-width="60px" align="center" prop="actualweight" />
  365. </el-table>
  366. </div>
  367. <div class="ControlChart">
  368. <h4>监控图</h4>
  369. <div id="chartLine" style="width: 100%;height:300px;" />
  370. </div>
  371. </el-col>
  372. <!-- 撒料计划-撒料 -->
  373. <el-col v-if="isSpreadingPlanSS" :span="16">
  374. <div class="title">
  375. <b>过程详情</b>
  376. <span>&nbsp;({{ title }})</span>
  377. </div>
  378. <div class="detail">
  379. <div v-if="table2.list.length !== 0">
  380. <b>{{ table2.list[0].proesstime }}</b>
  381. <span>过程时间</span>
  382. </div>
  383. <div v-if="table2.list.length !== 0">
  384. <b>{{ table2.list[0].proesstime }}</b>
  385. <span>混料时间</span>
  386. </div>
  387. <div v-if="table2.list.length !== 0">
  388. <b>{{ table2.list[0].iscompleted }}</b>
  389. <span>工作状态</span>
  390. </div>
  391. <div v-if="table2.list.length !== 0">
  392. <b>{{ table2.list[0].Hdif }}kg</b>
  393. <span>混料误差值</span>
  394. </div>
  395. <div v-if="table2.list.length !== 0">
  396. <b>{{ table2.list[0].HdifRate }}</b>
  397. <span>混料准确率</span>
  398. </div>
  399. <div v-if="table2.list.length !== 0">
  400. <b>{{ table2.list[0].Sdif }}kg</b>
  401. <span>撒料误差值</span>
  402. </div>
  403. <div v-if="table2.list.length !== 0">
  404. <b>{{ table2.list[0].SdifRate }}</b>
  405. <span>撒料准确率</span>
  406. </div>
  407. </div>
  408. <div class="Mixture">
  409. <h4>混料详情</h4>
  410. <el-table
  411. :key="table3.tableKey"
  412. v-loading="table3.listLoading"
  413. element-loading-text="给我一点时间"
  414. :data="table3.list"
  415. border
  416. fit
  417. highlight-current-row
  418. style="width: 98%;"
  419. :row-style="rowStyle"
  420. :cell-style="cellStyle"
  421. class="elTable table-fixed"
  422. >
  423. <el-table-column label="操作编号" min-width="60px" align="center" prop="sort" />
  424. <el-table-column label="撒料车辆" min-width="60px" align="center" prop="fname" />
  425. <el-table-column label="计划重量" min-width="60px" align="center" prop="lweight" />
  426. <el-table-column label="实际重量" min-width="60px" align="center" prop="actualweightminus" />
  427. <el-table-column label="误差值" min-width="60px" align="center" prop="diff" />
  428. <el-table-column label="准确率" min-width="60px" align="center" prop="diffRate" />
  429. <el-table-column label="完成时间" min-width="60px" align="center" prop="intime" />
  430. <el-table-column label="过程时间" min-width="60px" align="center" prop="proesstime" />
  431. <el-table-column label="跳转方式" min-width="60px" align="center" prop="buttontype" />
  432. <el-table-column label="开始重量" min-width="60px" align="center" prop="lastactualweight" />
  433. <el-table-column label="结束重量" min-width="60px" align="center" prop="actualweight" />
  434. </el-table>
  435. </div>
  436. <div class="SpreadingMaterials">
  437. <h4>撒料详情</h4>
  438. <el-table
  439. :key="table4.tableKey"
  440. v-loading="table4.listLoading"
  441. element-loading-text="给我一点时间"
  442. :data="table4.list"
  443. border
  444. fit
  445. highlight-current-row
  446. style="width: 98%;"
  447. :row-style="rowStyle"
  448. :cell-style="cellStyle"
  449. class="elTable table-fixed"
  450. max-height="200px"
  451. >
  452. <el-table-column label="操作编号" min-width="70px" align="center" prop="sort" />
  453. <el-table-column label="撒料车辆" min-width="70px" align="center" prop="fname" />
  454. <el-table-column label="计划重量" min-width="70px" align="center" prop="lweight" />
  455. <el-table-column label="实际重量" min-width="70px" align="center" prop="actualweightminus" />
  456. <el-table-column label="误差值" min-width="70px" align="center" prop="diff" />
  457. <el-table-column label="准确率" min-width="70px" align="center" prop="diffRate" />
  458. <el-table-column label="完成时间" min-width="70px" align="center" prop="intime" />
  459. <el-table-column label="过程时间" min-width="70px" align="center" prop="proesstime" />
  460. <el-table-column label="跳转方式" min-width="70px" align="center" prop="buttontype" />
  461. <el-table-column label="开始重量" min-width="70px" align="center" prop="lastactualweight" />
  462. <el-table-column label="结束重量" min-width="70px" align="center" prop="actualweight" />
  463. </el-table>
  464. </div>
  465. <div class="ControlChart">
  466. <h4>监控图</h4>
  467. <div id="chartLine" style="width: 100%;height:300px;" />
  468. </div>
  469. </el-col>
  470. </el-row>
  471. </div>
  472. </template>
  473. <script>
  474. import echarts from 'echarts'
  475. require('echarts/theme/macarons')
  476. import { GetDataByName, GetReportform, formatNum } from '@/api/common'
  477. import Cookies from 'js-cookie'
  478. import { parseTime } from '@/utils/index.js'
  479. export default {
  480. name: 'PastureProcessAnalysis',
  481. data() {
  482. return {
  483. title: '',
  484. isPremixedPlan: '', // 预混计划
  485. isSpreadingPlan: '', // 撒料计划
  486. isResidualMaterialPlan: '', // 剩料计划,
  487. isSpreadingPlanSH: '', // 撒料计划-混料
  488. isSpreadingPlanSS: '', // 撒料计划-撒料
  489. pickerMinDate: '',
  490. Beforedisabled: false,
  491. Nextdisabled: false,
  492. pickerOptions: {
  493. onPick: ({ maxDate, minDate }) => {
  494. this.pickerMinDate = minDate.getTime()
  495. if (maxDate) {
  496. this.pickerMinDate = ''
  497. }
  498. },
  499. // 限制不能选择明天之后的日期
  500. disabledDate: (time) => {
  501. if (this.pickerMinDate !== '') {
  502. const one = 31 * 24 * 3600 * 1000
  503. const minTime = this.pickerMinDate - one
  504. let maxTime = this.pickerMinDate + one
  505. // console.log(minTime, 'minTime')
  506. // console.log(maxTime, 'maxTime')
  507. // console.log(new Date(), 'new Date()')
  508. // console.log(Date.now(), 'Date.now()')
  509. // console.log(time.getTime(), 'time.getTime()')
  510. if (maxTime > new Date()) {
  511. maxTime = Date.now() + 8.64e7
  512. }
  513. return time.getTime() < minTime || time.getTime() > maxTime
  514. }
  515. return time.getTime() > Date.now() + 8.64e7
  516. }
  517. },
  518. requestParams: [
  519. { name: 'getBarListEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }},
  520. { name: 'getCowclassListEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }}
  521. ],
  522. planTypeList: [{ lable: '预混计划', value: '4' }, { lable: '撒料计划', value: '0' }, { lable: '剩料计划', value: '3' }, { lable: '撒料计划-混料', value: '1' }, { lable: '撒料计划-撒料', value: '2' }, { lable: '预称重计划', value: '5' }], // 计划类型
  523. workingConditionList: [{ id: '0', name: '进行中' }, { id: '1', name: '已完成' }], // 工作状态
  524. // TMR设备列表
  525. table: {
  526. getdataListParm: {
  527. name: 'getprocessAnalysis',
  528. page: 1,
  529. offset: 1,
  530. pagecount: '',
  531. returntype: 'Map',
  532. parammaps: {
  533. pastureid: Cookies.get('pastureid'),
  534. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  535. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  536. inputDatetime: [new Date(), new Date()],
  537. iscompleted: '',
  538. tmrtname: '',
  539. lpplantype: ''
  540. }
  541. },
  542. tableKey: 0,
  543. list: [],
  544. total: 0,
  545. listLoading: true
  546. },
  547. // 过程详情
  548. table2: {
  549. getdataListParm: {
  550. name: 'getprocessAnalysisStr',
  551. page: 1,
  552. offset: 1,
  553. pagecount: 1,
  554. returntype: 'Map',
  555. parammaps: {
  556. pastureid: Cookies.get('pastureid'),
  557. id: ''
  558. }
  559. },
  560. tableKey: 0,
  561. list: [],
  562. total: 0,
  563. listLoading: true
  564. },
  565. // 混料详情
  566. table3: {
  567. getdataListParm: {
  568. name: 'getprocessAnalysisHL',
  569. page: 1,
  570. offset: 1,
  571. pagecount: '',
  572. returntype: 'Map',
  573. parammaps: {
  574. pastureid: Cookies.get('pastureid'),
  575. id: ''
  576. }
  577. },
  578. tableKey: 0,
  579. list: [],
  580. total: 0,
  581. listLoading: true
  582. },
  583. // 撒料详情
  584. table4: {
  585. getdataListParm: {
  586. name: 'getprocessAnalysisSL',
  587. page: 1,
  588. offset: 1,
  589. pagecount: '',
  590. returntype: 'Map',
  591. parammaps: {
  592. pastureid: Cookies.get('pastureid'),
  593. id: ''
  594. }
  595. },
  596. tableKey: 0,
  597. list: [],
  598. total: 0,
  599. listLoading: true
  600. },
  601. chart1: {
  602. getdataListParm: {
  603. name: 'getprocessAnalysisTB',
  604. page: 1,
  605. offset: 1,
  606. pagecount: '',
  607. returntype: 'Map',
  608. parammaps: {
  609. pastureid: Cookies.get('pastureid'),
  610. id: ''
  611. }
  612. },
  613. tableKey: 0,
  614. list: [],
  615. total: 0,
  616. listLoading: false,
  617. chartLine_data: []
  618. },
  619. chartLine: null,
  620. chartLine_data: {},
  621. chartName: '',
  622. rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
  623. cellStyle: { padding: 0 + 'px' }
  624. }
  625. },
  626. created() {
  627. this.getList()
  628. },
  629. methods: {
  630. // TMR设备列表
  631. getList() {
  632. this.table.listLoading = true
  633. GetDataByName(this.table.getdataListParm).then(response => {
  634. console.log('TMR设备列表table数据', response.data.list)
  635. if (response.data.list !== null) {
  636. this.table.list = response.data.list
  637. this.table.total = response.data.total
  638. if (response.data.list[0].lpplantype == '预混计划') {
  639. this.isPremixedPlan = true
  640. this.isSpreadingPlan = false
  641. this.isResidualMaterialPlan = false
  642. this.isSpreadingPlanSH = false
  643. this.isSpreadingPlanSS = false
  644. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  645. this.table2.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  646. this.table3.getdataListParm.parammaps.pid = response.data.list[0].id
  647. this.table3.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  648. this.getList2()
  649. this.getList3()
  650. } else if (response.data.list[0].lpplantype == '剩料计划') {
  651. this.isResidualMaterialPlan = true
  652. this.isPremixedPlan = false
  653. this.isSpreadingPlan = false
  654. this.isSpreadingPlanSH = false
  655. this.isSpreadingPlanSS = false
  656. this.table2.getdataListParm.name = 'getprocessAnalysisStrSH'
  657. this.table3.getdataListParm.name = 'getprocessAnalysisHLSH'
  658. this.table4.getdataListParm.name = 'getprocessAnalysisSLSH'
  659. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  660. this.table2.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  661. this.table3.getdataListParm.parammaps.pid = response.data.list[0].id
  662. this.table3.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  663. this.table4.getdataListParm.parammaps.pid = response.data.list[0].id
  664. this.table4.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  665. this.getList2()
  666. this.getList3()
  667. this.getList4()
  668. } else if (response.data.list[0].lpplantype == '撒料计划-混料') {
  669. // 撒料计划-混料
  670. this.isSpreadingPlan = false
  671. this.isResidualMaterialPlan = false
  672. this.isPremixedPlan = false
  673. this.isSpreadingPlanSH = true
  674. this.isSpreadingPlanSS = false
  675. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  676. this.table2.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  677. this.table3.getdataListParm.parammaps.pid = response.data.list[0].id
  678. this.table3.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  679. this.table4.getdataListParm.parammaps.pid = response.data.list[0].id
  680. this.table4.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  681. this.getList2()
  682. this.getList3()
  683. this.getList4()
  684. this.chart1.getdataListParm.parammaps.pid = response.data.list[0].id
  685. this.chart1.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  686. this.getChart1()
  687. } else if (response.data.list[0].lpplantype == '撒料计划-撒料') {
  688. // 撒料计划-撒料
  689. this.isSpreadingPlan = false
  690. this.isResidualMaterialPlan = false
  691. this.isPremixedPlan = false
  692. this.isSpreadingPlanSH = false
  693. this.isSpreadingPlanSS = true
  694. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  695. this.table2.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  696. this.table3.getdataListParm.parammaps.pid = response.data.list[0].id
  697. this.table3.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  698. this.table4.getdataListParm.parammaps.pid = response.data.list[0].id
  699. this.table4.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  700. this.getList2()
  701. this.getList3()
  702. this.getList4()
  703. this.chart1.getdataListParm.parammaps.pid = response.data.list[0].id
  704. this.chart1.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  705. this.getChart1()
  706. } else if (response.data.list[0].lpplantype == '预称重计划') {
  707. // 撒料计划-混料
  708. this.isSpreadingPlan = false
  709. this.isResidualMaterialPlan = false
  710. this.isPremixedPlan = false
  711. this.isSpreadingPlanSH = true
  712. this.isSpreadingPlanSS = false
  713. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  714. this.table2.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  715. this.table3.getdataListParm.parammaps.pid = response.data.list[0].id
  716. this.table3.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  717. this.table4.getdataListParm.parammaps.pid = response.data.list[0].id
  718. this.table4.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  719. this.getList2()
  720. this.getList3()
  721. this.getList4()
  722. this.chart1.getdataListParm.parammaps.pid = response.data.list[0].id
  723. this.chart1.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  724. this.getChart1()
  725. } else {
  726. // 撒料
  727. this.isSpreadingPlan = true
  728. this.isResidualMaterialPlan = false
  729. this.isPremixedPlan = false
  730. this.isSpreadingPlanSH = false
  731. this.isSpreadingPlanSS = false
  732. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  733. this.table2.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  734. this.table3.getdataListParm.parammaps.pid = response.data.list[0].id
  735. this.table3.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  736. this.table4.getdataListParm.parammaps.pid = response.data.list[0].id
  737. this.table4.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  738. this.getList2()
  739. this.getList3()
  740. this.getList4()
  741. this.chart1.getdataListParm.parammaps.pid = response.data.list[0].id
  742. this.chart1.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  743. this.getChart1()
  744. }
  745. this.title = response.data.list[0].lpplantype
  746. } else {
  747. this.table.list = []
  748. this.table2.list = []
  749. this.table3.list = []
  750. this.table2.listLoading = false
  751. this.table3.listLoading = false
  752. this.table4.listLoading = false
  753. this.chart1.listLoading = false
  754. }
  755. setTimeout(() => {
  756. this.table.listLoading = false
  757. }, 100)
  758. })
  759. },
  760. handleSearch() {
  761. console.log('点击了查询')
  762. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  763. this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  764. this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  765. } else {
  766. this.table.getdataListParm.parammaps.inputDatetime = ''
  767. this.table.getdataListParm.parammaps.startTime = ''
  768. this.table.getdataListParm.parammaps.stopTime = ''
  769. }
  770. this.table.getdataListParm.offset = 1
  771. this.getList()
  772. },
  773. handleRefresh() {
  774. console.log('点击了重置')
  775. this.table.getdataListParm.parammaps.tmrtname = ''
  776. this.table.getdataListParm.parammaps.iscompleted = ''
  777. this.table.getdataListParm.parammaps.lpplantype = ''
  778. this.table.getdataListParm.parammaps.startTime = parseTime(new Date(), '{y}-{m}-{d}')
  779. this.table.getdataListParm.parammaps.stopTime = parseTime(new Date(), '{y}-{m}-{d}')
  780. this.table.getdataListParm.parammaps.inputDatetime = [new Date(), new Date()]
  781. this.table.getdataListParm.offset = 1
  782. this.getList()
  783. },
  784. handleBefore() {
  785. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  786. var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
  787. var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
  788. if (stop > Date.now()) {
  789. this.Nextdisabled = true
  790. this.Beforedisabled = false
  791. } else {
  792. this.Nextdisabled = false
  793. this.Beforedisabled = false
  794. }
  795. this.table.getdataListParm.parammaps.inputDatetime.length = 0
  796. this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
  797. this.$forceUpdate()
  798. }
  799. this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  800. this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  801. this.getList()
  802. },
  803. handleNext() {
  804. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  805. var start2 = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
  806. var stop2 = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
  807. // console.log(stop2)
  808. // console.log(Date.now() + 8.64e7)
  809. // console.log(stop2 > Date.now() + 8.64e7)
  810. if (stop2 > Date.now()) {
  811. this.Nextdisabled = true
  812. this.Beforedisabled = false
  813. } else {
  814. this.Nextdisabled = false
  815. this.Beforedisabled = false
  816. }
  817. this.table.getdataListParm.parammaps.inputDatetime.length = 0
  818. this.table.getdataListParm.parammaps.inputDatetime.push(start2, stop2)
  819. this.$forceUpdate()
  820. }
  821. this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  822. this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  823. this.getList()
  824. },
  825. rowClick(row, column, event) {
  826. this.table2.getdataListParm.parammaps.id = row.id
  827. this.table3.getdataListParm.parammaps.pid = row.id
  828. this.table4.getdataListParm.parammaps.pid = row.id
  829. this.chart1.getdataListParm.parammaps.pid = row.id
  830. this.chartName = row.tmrtname
  831. if (row.lpplantype == '预混计划') {
  832. this.isPremixedPlan = true
  833. this.isResidualMaterialPlan = false
  834. this.isSpreadingPlan = false
  835. this.isSpreadingPlanSH = false
  836. this.isSpreadingPlanSS = false
  837. this.table2.getdataListParm.name = 'getprocessAnalysisStr'
  838. this.table3.getdataListParm.name = 'getprocessAnalysisHL'
  839. this.table2.getdataListParm.parammaps.pastureid = row.pastureid
  840. this.table3.getdataListParm.parammaps.pastureid = row.pastureid
  841. this.getList2()
  842. this.getList3()
  843. } else if (row.lpplantype == '剩料计划') {
  844. this.isResidualMaterialPlan = true
  845. this.isPremixedPlan = false
  846. this.isSpreadingPlan = false
  847. this.isSpreadingPlanSH = false
  848. this.isSpreadingPlanSS = false
  849. this.table2.getdataListParm.name = 'getprocessAnalysisStrSH'
  850. this.table3.getdataListParm.name = 'getprocessAnalysisHLSH'
  851. this.table4.getdataListParm.name = 'getprocessAnalysisSLSH'
  852. this.table2.getdataListParm.parammaps.pastureid = row.pastureid
  853. this.table3.getdataListParm.parammaps.pastureid = row.pastureid
  854. this.table4.getdataListParm.parammaps.pastureid = row.pastureid
  855. this.getList2()
  856. this.getList3()
  857. this.getList4()
  858. } else if (row.lpplantype == '撒料计划-混料') {
  859. this.isSpreadingPlan = false
  860. this.isPremixedPlan = false
  861. this.isResidualMaterialPlan = false
  862. this.isSpreadingPlanSH = true
  863. this.isSpreadingPlanSS = false
  864. this.table2.getdataListParm.name = 'getprocessAnalysisStr'
  865. this.table3.getdataListParm.name = 'getprocessAnalysisHL'
  866. this.table4.getdataListParm.name = 'getprocessAnalysisSL'
  867. this.table2.getdataListParm.parammaps.pastureid = row.pastureid
  868. this.table3.getdataListParm.parammaps.pastureid = row.pastureid
  869. this.table4.getdataListParm.parammaps.pastureid = row.pastureid
  870. this.chart1.getdataListParm.parammaps.pastureid = row.pastureid
  871. this.getList2()
  872. this.getList3()
  873. this.getList4()
  874. this.getChart1()
  875. } else if (row.lpplantype == '撒料计划-撒料') {
  876. this.isSpreadingPlan = false
  877. this.isPremixedPlan = false
  878. this.isResidualMaterialPlan = false
  879. this.isSpreadingPlanSH = false
  880. this.isSpreadingPlanSS = true
  881. this.table2.getdataListParm.name = 'getprocessAnalysisStr'
  882. this.table3.getdataListParm.name = 'getprocessAnalysisHL'
  883. this.table4.getdataListParm.name = 'getprocessAnalysisSL'
  884. this.table2.getdataListParm.parammaps.pastureid = row.pastureid
  885. this.table3.getdataListParm.parammaps.pastureid = row.pastureid
  886. this.table4.getdataListParm.parammaps.pastureid = row.pastureid
  887. this.chart1.getdataListParm.parammaps.pastureid = row.pastureid
  888. this.getList2()
  889. this.getList3()
  890. this.getList4()
  891. this.getChart1()
  892. } else if (row.lpplantype == '预称重计划') {
  893. this.isSpreadingPlan = false
  894. this.isPremixedPlan = false
  895. this.isResidualMaterialPlan = false
  896. this.isSpreadingPlanSH = true
  897. this.isSpreadingPlanSS = false
  898. this.table2.getdataListParm.name = 'getprocessAnalysisStr'
  899. this.table3.getdataListParm.name = 'getprocessAnalysisHL'
  900. this.table4.getdataListParm.name = 'getprocessAnalysisSL'
  901. this.table2.getdataListParm.parammaps.pastureid = row.pastureid
  902. this.table3.getdataListParm.parammaps.pastureid = row.pastureid
  903. this.table4.getdataListParm.parammaps.pastureid = row.pastureid
  904. this.chart1.getdataListParm.parammaps.pastureid = row.pastureid
  905. this.getList2()
  906. this.getList3()
  907. this.getList4()
  908. this.getChart1()
  909. } else {
  910. this.isSpreadingPlan = true
  911. this.isPremixedPlan = false
  912. this.isResidualMaterialPlan = false
  913. this.isSpreadingPlanSH = false
  914. this.isSpreadingPlanSS = false
  915. this.table2.getdataListParm.name = 'getprocessAnalysisStr'
  916. this.table3.getdataListParm.name = 'getprocessAnalysisHL'
  917. this.table4.getdataListParm.name = 'getprocessAnalysisSL'
  918. this.table2.getdataListParm.parammaps.pastureid = row.pastureid
  919. this.table3.getdataListParm.parammaps.pastureid = row.pastureid
  920. this.table4.getdataListParm.parammaps.pastureid = row.pastureid
  921. this.chart1.getdataListParm.parammaps.pastureid = row.pastureid
  922. this.getList2()
  923. this.getList3()
  924. this.getList4()
  925. this.getChart1()
  926. }
  927. this.title = '' + row.lpplantype
  928. },
  929. // 过程详情
  930. getList2() {
  931. this.table2.listLoading = false
  932. GetDataByName(this.table2.getdataListParm).then(response => {
  933. console.log('过程详情table数据', response.data.list)
  934. if (response.data.list !== null) {
  935. this.table2.list = response.data.list
  936. } else {
  937. this.table2.list = []
  938. }
  939. setTimeout(() => {
  940. this.table2.listLoading = false
  941. }, 100)
  942. })
  943. },
  944. // 混料详情
  945. getList3() {
  946. this.table3.listLoading = false
  947. GetDataByName(this.table3.getdataListParm).then(response => {
  948. console.log('混料详情table数据', response.data.list)
  949. if (response.data.list !== null) {
  950. this.table3.list = response.data.list
  951. var sumlweight = 0
  952. var sumactualweightminus = 0
  953. var sumsweight = 0
  954. var sumproesstime = ''
  955. for (let i = 0; i < response.data.list.length; i++) {
  956. if (response.data.list[i].lweight == undefined) { response.data.list[i].lweight = 0 }
  957. if (response.data.list[i].actualweightminus == undefined) { response.data.list[i].actualweightminus = 0 }
  958. if (response.data.list[i].sweight == undefined) { response.data.list[i].sweight = 0 }
  959. sumlweight += parseFloat(response.data.list[i].lweight)
  960. sumactualweightminus += parseFloat(response.data.list[i].actualweightminus)
  961. sumsweight += parseFloat(response.data.list[i].sweight)
  962. sumproesstime = response.data.list[0].sumproesstime
  963. }
  964. sumlweight = formatNum(sumlweight, 2)
  965. sumactualweightminus = formatNum(sumactualweightminus, 2)
  966. sumsweight = formatNum(sumsweight, 2)
  967. this.table3.list.push({ 'sort': '合计', 'lweight': sumlweight, 'actualweightminus': sumactualweightminus, 'sweight': sumsweight, 'proesstime': sumproesstime })
  968. } else {
  969. this.table3.list = []
  970. }
  971. setTimeout(() => {
  972. this.table3.listLoading = false
  973. }, 100)
  974. })
  975. },
  976. // 撒料详情
  977. getList4() {
  978. this.table4.listLoading = false
  979. GetDataByName(this.table4.getdataListParm).then(response => {
  980. console.log('撒料详情table数据', response.data.list)
  981. if (response.data.list !== null) {
  982. this.table4.list = response.data.list
  983. var sumlweight = 0
  984. var sumactualweightminus = 0
  985. var sumsweight = 0
  986. var sumproesstime = ''
  987. for (let i = 0; i < response.data.list.length; i++) {
  988. if (response.data.list[i].lweight == undefined) { response.data.list[i].lweight = 0 }
  989. if (response.data.list[i].actualweightminus == undefined) { response.data.list[i].actualweightminus = 0 }
  990. if (response.data.list[i].sweight == undefined) { response.data.list[i].sweight = 0 }
  991. sumlweight += parseFloat(response.data.list[i].lweight)
  992. sumactualweightminus += parseFloat(response.data.list[i].actualweightminus)
  993. sumsweight += parseFloat(response.data.list[i].sweight)
  994. sumproesstime = response.data.list[0].sumproesstime
  995. }
  996. sumlweight = formatNum(sumlweight, 2)
  997. sumactualweightminus = formatNum(sumactualweightminus, 2)
  998. sumsweight = formatNum(sumsweight, 2)
  999. this.table4.list.push({ 'sort': '合计', 'lweight': sumlweight, 'actualweightminus': sumactualweightminus, 'sweight': sumsweight, 'proesstime': sumproesstime })
  1000. this.rowspan()
  1001. } else {
  1002. this.table4.list = []
  1003. }
  1004. setTimeout(() => {
  1005. this.table4.listLoading = false
  1006. }, 100)
  1007. })
  1008. },
  1009. rowspan() {
  1010. this.spanArr = []
  1011. this.table4.list.forEach((item, index) => {
  1012. if (index == 0) {
  1013. this.spanArr.push(1)
  1014. this.position = 0
  1015. } else {
  1016. console.log(item, index, '======')
  1017. if (this.table4.list[index].aweight == this.table4.list[index - 1].aweight) {
  1018. this.spanArr[this.position] += 1
  1019. this.spanArr.push(0)
  1020. } else {
  1021. this.spanArr.push(1)
  1022. this.position = index
  1023. }
  1024. }
  1025. })
  1026. },
  1027. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  1028. if (columnIndex == 4) {
  1029. const _row = this.spanArr[rowIndex]
  1030. const _col = _row > 0 ? 1 : 0
  1031. return {
  1032. rowspan: _row,
  1033. colspan: _col
  1034. }
  1035. }
  1036. },
  1037. getChart1() {
  1038. this.chart1.listLoading = true
  1039. GetReportform(this.chart1.getdataListParm).then(response => {
  1040. if (response.data.list !== null) {
  1041. // response.data.list = {
  1042. // // 'data1': ['09:34:32', '09:34:46', '09:34:46', '09:34:50'],
  1043. // 'data2': [
  1044. // ['09:34:32', '1724.11'],
  1045. // ['09:34:46', '1724.12'],
  1046. // ['09:34:46', '-50.13'],
  1047. // ['09:34:50', '-51.14']
  1048. // ],
  1049. // 'data3': [
  1050. // ['09:34:32', '0'],
  1051. // ['09:34:46', '1725.15'],
  1052. // ['09:34:46', '1726.16'],
  1053. // ['09:34:50', '1.17']
  1054. // ],
  1055. // 'data4': [
  1056. // ['09:34:32', '0.18'],
  1057. // ['09:34:46', '1725.19'],
  1058. // ['09:34:46', '1335.20'],
  1059. // ['09:34:50', '1.21']
  1060. // ],
  1061. // 'data5': [
  1062. // ['09:34:32', '0.22', '栏舍', '303东1'],
  1063. // ['09:34:46', '1726.23', '饲料', '国产燕麦2'],
  1064. // ['09:34:46', '1335.24', '栏舍', '303东3'],
  1065. // ['09:34:50', '1.25', '饲料', '国产燕麦4']
  1066. // ]
  1067. // }
  1068. this.chart1.list = response.data.data
  1069. console.log('实时监控', response.data.list)
  1070. this.chart1.chartLine_data = response.data.list
  1071. this.chart1.total = response.data.total
  1072. this.roadChartLine1(this.chart1.chartLine_data)
  1073. } else {
  1074. this.chart1.list = []
  1075. }
  1076. setTimeout(() => {
  1077. this.chart1.listLoading = false
  1078. }, 100)
  1079. })
  1080. },
  1081. roadChartLine1(chartLine_data) {
  1082. console.log(chartLine_data.data5, 'chartLine_data')
  1083. if (this.chartLine != null) {
  1084. this.chartLine.dispose()
  1085. }
  1086. this.chartLine = echarts.init(document.getElementById('chartLine'))
  1087. var option = {
  1088. title: { text: '', subtext: '' },
  1089. color: ['#38c193', '#5199e5', '#fdb06a', '#fb8b73'], // 关键加上这句话,legend的颜色和折线的自定义颜色就一致了
  1090. legend: [{
  1091. itemWidth: 15, itemHeight: 7, right: '25%', textStyle: { fontSize: 12 },
  1092. data: [{ name: '设计重量' }, { name: '实际重量' }]
  1093. }, {
  1094. itemWidth: 15, itemHeight: 15, right: '0', textStyle: { fontSize: 12 },
  1095. data: [
  1096. // { name: '开始重量', icon: 'image://https://kptyun.cn:8081/file/pic/3.png' }, // { name: '结束重量', icon: 'image://https://kptyun.cn:8081/file/pic/4.png' },
  1097. // { name: '结束重量', icon: 'image://https://kptyun.cn:8081/file/pic/4.png' }, // { name: '结束重量', icon: 'image://https://kptyun.cn:8081/file/pic/4.png' },
  1098. { name: '开始重量' },
  1099. { name: '结束重量' }
  1100. ]
  1101. }],
  1102. tooltip: {
  1103. trigger: 'axis',
  1104. formatter: function(params) {
  1105. console.log(params, 'params')
  1106. var tip = params[0].name
  1107. for (let i = 0; i < params.length; i++) {
  1108. if (params[i].seriesName == '设计重量') {
  1109. tip += '<br>' + params[i].seriesName + ':' + params[i].value[1]
  1110. }
  1111. if (params[i].seriesName == '实际重量') {
  1112. tip += '<br>' + params[i].seriesName + ':' + params[i].value[1]
  1113. }
  1114. if (params[i].seriesName == '开始重量') {
  1115. tip += '<br>' + params[i].seriesName + ':' + params[i].value[1]
  1116. }
  1117. if (params[i].seriesName == '结束重量') {
  1118. tip += '<br>' + params[i].seriesName + ':' + params[i].value[1] + '<br>' + params[i].value[2] + params[i].value[3]
  1119. }
  1120. }
  1121. return tip
  1122. }
  1123. },
  1124. calculable: true,
  1125. xAxis: [
  1126. { type: 'category' }
  1127. // { type: 'category', splitLine: { show: false }, name: '时间', data: chartLine_data.data1, axisLabel: { show: true, textStyle: { color: '#666' }}}
  1128. ],
  1129. yAxis: [{ type: 'value' }],
  1130. series: [
  1131. { symbol: 'none', name: '实际重量', type: 'line', data: chartLine_data.data3, itemStyle: { normal: { lineStyle: { color: '#38c193' }}}},
  1132. { symbol: 'none', name: '设计重量', type: 'line', step: 'middle', data: chartLine_data.data2 },
  1133. // { name: '开始重量', symbol: 'image://https://kptyun.cn:8081/file/pic/3.png', symbolSize: 10, type: 'scatter', data: chartLine_data.data4 },
  1134. // { name: '结束重量', symbol: 'image://https://kptyun.cn:8081/file/pic/4.png', symbolSize: 10, type: 'scatter', data: chartLine_data.data5 }
  1135. { name: '开始重量', symbolSize: 10, type: 'scatter', data: chartLine_data.data4 },
  1136. { name: '结束重量', symbolSize: 10, type: 'scatter', data: chartLine_data.data5 }
  1137. ]
  1138. }
  1139. this.chartLine.setOption(option)
  1140. window.onresize = function() {
  1141. this.chartLine.resize()
  1142. }
  1143. }
  1144. }
  1145. }
  1146. </script>
  1147. <style lang="scss" scoped>
  1148. .search{padding-top:10px;clear: both;}
  1149. .table{margin-top:10px;}
  1150. .detail{
  1151. height:84px;padding:0 10px;font:16px/32px '';color:#333;background: #F9F9F9;display: flex; align-items: center;text-align: center;
  1152. div{
  1153. height: 15px;width: 20%;border-right: 1px solid #E0E0E0;color: #333;
  1154. b{line-height: 20px;font-size: 16px;display: block;margin-top: -10px;height: 20px;color: #009A69;}
  1155. span{font-size: 14px;}
  1156. }
  1157. div:last-child{border-right:none}
  1158. }
  1159. .title{height: 50px;line-height: 50px;}
  1160. </style>