index.vue 55 KB

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