666a93322297dedf2b0d02cb10c1741606af2895.svn-base 55 KB

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