index.vue 64 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934
  1. <template>
  2. <div class="app-container">
  3. <!-- <h1>集团</h1> -->
  4. <div class="search">
  5. <el-select
  6. v-model="table.getdataListParm.parammaps.pastureid"
  7. placeholder="牧场"
  8. class="filter-item"
  9. style="width: 120px"
  10. >
  11. <el-option
  12. v-for="item in pastureList"
  13. :key="item.pastureid"
  14. :label="item.pasturename"
  15. :value="item.pastureid"
  16. />
  17. </el-select>
  18. <el-date-picker
  19. v-model="table.getdataListParm.parammaps.inputDatetime"
  20. :clearable="false"
  21. class="inputDatetime filter-item"
  22. type="daterange"
  23. range-separator="至"
  24. start-placeholder="开始日期"
  25. end-placeholder="结束日期"
  26. style="width: 250px"
  27. :picker-options="pickerOptions"
  28. />
  29. <el-button
  30. class="el-icon-arrow-left elIconArrowLeft"
  31. :disabled="Beforedisabled"
  32. @click="handleBefore"
  33. />
  34. <el-button
  35. class="el-icon-arrow-right elIconArrowRight"
  36. :disabled="Nextdisabled"
  37. @click="handleNext"
  38. />
  39. <el-select
  40. v-model="table.getdataListParm.parammaps.lpplantype"
  41. placeholder="计划类型"
  42. class="filter-item"
  43. style="width: 120px"
  44. clearable
  45. >
  46. <el-option
  47. v-for="item in planTypeList"
  48. :key="item.value"
  49. :label="item.lable"
  50. :value="item.value"
  51. />
  52. </el-select>
  53. <el-input
  54. v-model="table.getdataListParm.parammaps.tmrtname"
  55. placeholder="TMR名称"
  56. style="width: 180px"
  57. class="filter-item"
  58. clearable
  59. />
  60. <el-select
  61. v-model="table.getdataListParm.parammaps.iscompleted"
  62. placeholder="工作状态"
  63. class="filter-item"
  64. style="width: 120px"
  65. clearable
  66. >
  67. <el-option
  68. v-for="item in workingConditionList"
  69. :key="item.id"
  70. :label="item.name"
  71. :value="item.id"
  72. />
  73. </el-select>
  74. <el-button class="successBorder" @click="form_search">查询</el-button>
  75. <el-button class="successBorder" @click="handleRefresh">重置</el-button>
  76. </div>
  77. <el-row :gutter="20">
  78. <el-col :span="8">
  79. <h4>TMR设备列表</h4>
  80. <div class="table">
  81. <el-table
  82. :key="table.tableKey"
  83. v-loading="table.listLoading"
  84. element-loading-text="给我一点时间"
  85. :data="table.list"
  86. border
  87. fit
  88. highlight-current-row
  89. style="width: 100%"
  90. :row-style="rowStyle"
  91. :cell-style="cellStyle"
  92. class="elTable table-fixed"
  93. height="970px"
  94. @row-click="rowClick"
  95. >
  96. <el-table-column
  97. sortable
  98. label="牧场"
  99. min-width="80px"
  100. align="center"
  101. prop="pastureName"
  102. />
  103. <el-table-column
  104. sortable
  105. label="开始时间"
  106. min-width="100px"
  107. align="center"
  108. prop="intime"
  109. />
  110. <el-table-column
  111. sortable
  112. label="计划类型"
  113. min-width="80px"
  114. align="center"
  115. prop="lpplantype"
  116. />
  117. <el-table-column
  118. sortable
  119. label="描述"
  120. min-width="90px"
  121. align="center"
  122. prop="remark"
  123. />
  124. <el-table-column
  125. sortable
  126. label="TMR名称"
  127. min-width="80px"
  128. align="center"
  129. prop="tmrtname"
  130. />
  131. </el-table>
  132. </div>
  133. </el-col>
  134. <!-- 预混计划 -->
  135. <el-col v-if="isPremixedPlan" :span="16">
  136. <div class="title">
  137. <b>过程详情</b>
  138. <span>&nbsp;({{ title }})</span>
  139. </div>
  140. <div class="detail">
  141. <div v-if="table2.list.length !== 0">
  142. <b>{{ table2.list[0].proesstime }}</b>
  143. <span>过程时间</span>
  144. </div>
  145. <div v-if="table2.list.length !== 0">
  146. <b>{{ table2.list[0].proesstime }}</b>
  147. <span>混料时间</span>
  148. </div>
  149. <div v-if="table2.list.length !== 0">
  150. <b>{{ table2.list[0].iscompleted }}</b>
  151. <span>工作状态</span>
  152. </div>
  153. <div v-if="table2.list.length !== 0">
  154. <b>{{ table2.list[0].Hdif }}kg</b>
  155. <span>混料误差值</span>
  156. </div>
  157. <div v-if="table2.list.length !== 0">
  158. <b>{{ table2.list[0].HdifRate }}</b>
  159. <span>混料准确率</span>
  160. </div>
  161. </div>
  162. <div class="Mixture">
  163. <h4>混料详情11</h4>
  164. <el-table
  165. :key="table3.tableKey"
  166. v-loading="table3.listLoading"
  167. element-loading-text="给我一点时间"
  168. :data="table3.list"
  169. border
  170. fit
  171. highlight-current-row
  172. style="width: 100%"
  173. :row-style="rowStyle"
  174. :cell-style="cellStyle"
  175. class="elTable table-fixed"
  176. max-height="270px"
  177. >
  178. <el-table-column
  179. label="操作编号"
  180. min-width="70px"
  181. align="center"
  182. prop="sort"
  183. />
  184. <el-table-column
  185. label="饲料名称"
  186. min-width="70px"
  187. align="center"
  188. prop="fname"
  189. />
  190. <el-table-column
  191. label="计划重量"
  192. min-width="50px"
  193. align="center"
  194. prop="lweight"
  195. />
  196. <el-table-column
  197. label="实际重量"
  198. min-width="70px"
  199. align="center"
  200. prop="actualweightminus"
  201. />
  202. <el-table-column
  203. label="误差值"
  204. min-width="70px"
  205. align="center"
  206. prop="diff"
  207. />
  208. <el-table-column
  209. label="准确率"
  210. min-width="70px"
  211. align="center"
  212. prop="diffRate"
  213. />
  214. <el-table-column
  215. label="完成时间"
  216. min-width="70px"
  217. align="center"
  218. prop="intime"
  219. />
  220. <el-table-column
  221. label="过程时间"
  222. min-width="70px"
  223. align="center"
  224. prop="proesstime"
  225. />
  226. <el-table-column
  227. label="跳转方式"
  228. min-width="70px"
  229. align="center"
  230. prop="buttontype"
  231. />
  232. <el-table-column
  233. label="开始重量"
  234. min-width="70px"
  235. align="center"
  236. prop="lastactualweight"
  237. />
  238. <el-table-column
  239. label="结束重量"
  240. min-width="70px"
  241. align="center"
  242. prop="actualweight"
  243. />
  244. <el-table-column fixed="right" label="操作" width="100">
  245. <template slot-scope="scope">
  246. <el-button
  247. @click="handleClick(scope.row)"
  248. type="text"
  249. size="small"
  250. >编辑</el-button
  251. >
  252. </template>
  253. </el-table-column>
  254. </el-table>
  255. </div>
  256. </el-col>
  257. <!-- 撒料计划 -->
  258. <el-col v-if="isSpreadingPlan" :span="16">
  259. <div class="title">
  260. <b>过程详情</b>
  261. <span>&nbsp;({{ title }})</span>
  262. </div>
  263. <div class="detail">
  264. <div v-if="table2.list.length !== 0">
  265. <b>{{ table2.list[0].proesstime }}</b>
  266. <span>过程时间</span>
  267. </div>
  268. <div v-if="table2.list.length !== 0">
  269. <b>{{ table2.list[0].proesstime }}</b>
  270. <span>混料时间</span>
  271. </div>
  272. <div v-if="table2.list.length !== 0">
  273. <b>{{ table2.list[0].iscompleted }}</b>
  274. <span>工作状态</span>
  275. </div>
  276. <div v-if="table2.list.length !== 0">
  277. <b>{{ table2.list[0].Hdif }}kg</b>
  278. <span>混料误差值</span>
  279. </div>
  280. <div v-if="table2.list.length !== 0">
  281. <b>{{ table2.list[0].HdifRate }}</b>
  282. <span>混料准确率</span>
  283. </div>
  284. <div v-if="table2.list.length !== 0">
  285. <b>{{ table2.list[0].Sdif }}kg</b>
  286. <span>撒料误差值</span>
  287. </div>
  288. <div v-if="table2.list.length !== 0">
  289. <b>{{ table2.list[0].SdifRate }}</b>
  290. <span>撒料准确率</span>
  291. </div>
  292. </div>
  293. <div class="Mixture">
  294. <h4>混料详情</h4>
  295. <el-table
  296. :key="table3.tableKey"
  297. v-loading="table3.listLoading"
  298. element-loading-text="给我一点时间"
  299. :data="table3.list"
  300. border
  301. fit
  302. highlight-current-row
  303. style="width: 100%"
  304. :row-style="rowStyle"
  305. :cell-style="cellStyle"
  306. class="elTable table-fixed"
  307. max-height="200px"
  308. >
  309. <el-table-column
  310. label="操作编号"
  311. min-width="110px"
  312. align="center"
  313. prop="sort"
  314. />
  315. <el-table-column
  316. label="饲料名称"
  317. min-width="110px"
  318. align="center"
  319. prop="fname"
  320. />
  321. <el-table-column
  322. label="计划重量"
  323. min-width="110px"
  324. align="center"
  325. prop="lweight"
  326. />
  327. <el-table-column
  328. label="实际重量"
  329. min-width="110px"
  330. align="center"
  331. prop="actualweightminus"
  332. />
  333. <el-table-column
  334. label="误差值"
  335. min-width="110px"
  336. align="center"
  337. prop="diff"
  338. />
  339. <el-table-column
  340. label="准确率"
  341. min-width="110px"
  342. align="center"
  343. prop="diffRate"
  344. />
  345. <el-table-column
  346. label="完成时间"
  347. min-width="110px"
  348. align="center"
  349. prop="intime"
  350. />
  351. <el-table-column
  352. label="过程时间"
  353. min-width="110px"
  354. align="center"
  355. prop="proesstime"
  356. />
  357. <el-table-column
  358. label="跳转方式"
  359. min-width="110px"
  360. align="center"
  361. prop="buttontype"
  362. />
  363. <el-table-column
  364. label="开始重量"
  365. min-width="110px"
  366. align="center"
  367. prop="lastactualweight"
  368. />
  369. <el-table-column
  370. label="结束重量"
  371. min-width="110px"
  372. align="center"
  373. prop="actualweight"
  374. />
  375. </el-table>
  376. </div>
  377. <div class="SpreadingMaterials">
  378. <h4>撒料详情</h4>
  379. <el-table
  380. :key="table4.tableKey"
  381. v-loading="table4.listLoading"
  382. element-loading-text="给我一点时间"
  383. :data="table4.list"
  384. border
  385. fit
  386. highlight-current-row
  387. style="width: 100%"
  388. :row-style="rowStyle"
  389. :cell-style="cellStyle"
  390. class="elTable table-fixed"
  391. height="200px"
  392. >
  393. <el-table-column
  394. label="操作编号"
  395. min-width="70px"
  396. align="center"
  397. prop="sort"
  398. />
  399. <el-table-column
  400. label="栏舍名称"
  401. min-width="70px"
  402. align="center"
  403. prop="fname"
  404. />
  405. <el-table-column
  406. label="计划重量"
  407. min-width="70px"
  408. align="center"
  409. prop="lweight"
  410. />
  411. <el-table-column
  412. label="实际重量"
  413. min-width="70px"
  414. align="center"
  415. prop="actualweightminus"
  416. />
  417. <el-table-column
  418. label="误差值"
  419. min-width="70px"
  420. align="center"
  421. prop="diff"
  422. />
  423. <el-table-column
  424. label="准确率"
  425. min-width="70px"
  426. align="center"
  427. prop="diffRate"
  428. />
  429. <el-table-column
  430. label="完成时间"
  431. min-width="70px"
  432. align="center"
  433. prop="intime"
  434. />
  435. <el-table-column
  436. label="过程时间"
  437. min-width="70px"
  438. align="center"
  439. prop="proesstime"
  440. />
  441. <el-table-column
  442. label="跳转方式"
  443. min-width="70px"
  444. align="center"
  445. prop="buttontype"
  446. />
  447. <el-table-column
  448. label="开始重量"
  449. min-width="70px"
  450. align="center"
  451. prop="lastactualweight"
  452. />
  453. <el-table-column
  454. label="结束重量"
  455. min-width="70px"
  456. align="center"
  457. prop="actualweight"
  458. />
  459. </el-table>
  460. </div>
  461. <div class="ControlChart">
  462. <h4>监控图</h4>
  463. <div id="chartLine" style="width: 100%; height: 300px" />
  464. </div>
  465. </el-col>
  466. <!-- 剩料计划 -->
  467. <el-col v-if="isResidualMaterialPlan" :span="16">
  468. <div class="title">
  469. <b>过程详情</b>
  470. <span>&nbsp;({{ title }})</span>
  471. </div>
  472. <div class="detail">
  473. <div v-if="table2.list.length !== 0">
  474. <b>{{ table2.list[0].proesstime }}</b>
  475. <span>过程时间</span>
  476. </div>
  477. <div v-if="table2.list.length !== 0">
  478. <b>{{ table2.list[0].iscompleted }}</b>
  479. <span>工作状态</span>
  480. </div>
  481. </div>
  482. <div class="Mixture">
  483. <h4>剩料收集详情</h4>
  484. <el-table
  485. :key="table3.tableKey"
  486. v-loading="table3.listLoading"
  487. element-loading-text="给我一点时间"
  488. :data="table3.list"
  489. border
  490. fit
  491. highlight-current-row
  492. style="width: 100%"
  493. :row-style="rowStyle"
  494. :cell-style="cellStyle"
  495. class="elTable table-fixed"
  496. height="200px"
  497. >
  498. <el-table-column
  499. label="操作编号"
  500. min-width="110px"
  501. align="center"
  502. prop="sort"
  503. />
  504. <el-table-column
  505. label="栏舍名称"
  506. min-width="110px"
  507. align="center"
  508. prop="fname"
  509. />
  510. <el-table-column
  511. label="剩料采集重量(kg)"
  512. min-width="110px"
  513. align="center"
  514. prop="sweight"
  515. />
  516. </el-table>
  517. </div>
  518. <div class="SpreadingMaterials">
  519. <h4>撒料详情</h4>
  520. <el-table
  521. :key="table4.tableKey"
  522. v-loading="table4.listLoading"
  523. :span-method="objectSpanMethod"
  524. element-loading-text="给我一点时间"
  525. :data="table4.list"
  526. border
  527. fit
  528. highlight-current-row
  529. style="width: 100%"
  530. :row-style="rowStyle"
  531. :cell-style="cellStyle"
  532. class="elTable table-fixed"
  533. height="200px"
  534. >
  535. <el-table-column
  536. label="操作编号"
  537. min-width="110px"
  538. align="center"
  539. prop="sort"
  540. />
  541. <el-table-column
  542. label="转投栏舍"
  543. min-width="110px"
  544. align="center"
  545. prop="fname"
  546. />
  547. <el-table-column
  548. label="允许分配剩料量"
  549. min-width="110px"
  550. align="center"
  551. prop="lweight"
  552. />
  553. <el-table-column
  554. label="实际分配重量(kg)"
  555. min-width="110px"
  556. align="center"
  557. prop="actualweightminus"
  558. />
  559. <el-table-column
  560. label="废弃剩料重量"
  561. min-width="110px"
  562. align="center"
  563. prop="aweight"
  564. />
  565. </el-table>
  566. </div>
  567. </el-col>
  568. <!-- 撒料计划-混料 -->
  569. <el-col v-if="isSpreadingPlanSH" :span="16">
  570. <div class="title">
  571. <b>过程详情</b>
  572. <span>&nbsp;({{ title }})</span>
  573. </div>
  574. <div class="detail">
  575. <div v-if="table2.list.length !== 0">
  576. <b>{{ table2.list[0].proesstime }}</b>
  577. <span>过程时间</span>
  578. </div>
  579. <div v-if="table2.list.length !== 0">
  580. <b>{{ table2.list[0].proesstime }}</b>
  581. <span>混料时间</span>
  582. </div>
  583. <div v-if="table2.list.length !== 0">
  584. <b>{{ table2.list[0].iscompleted }}</b>
  585. <span>工作状态</span>
  586. </div>
  587. <div v-if="table2.list.length !== 0">
  588. <b>{{ table2.list[0].Hdif }}kg</b>
  589. <span>混料误差值</span>
  590. </div>
  591. <div v-if="table2.list.length !== 0">
  592. <b>{{ table2.list[0].HdifRate }}</b>
  593. <span>混料准确率</span>
  594. </div>
  595. <div v-if="table2.list.length !== 0">
  596. <b>{{ table2.list[0].Sdif }}kg</b>
  597. <span>撒料误差值</span>
  598. </div>
  599. <div v-if="table2.list.length !== 0">
  600. <b>{{ table2.list[0].SdifRate }}</b>
  601. <span>撒料准确率</span>
  602. </div>
  603. </div>
  604. <div class="Mixture">
  605. <h4>混料详情</h4>
  606. <el-table
  607. :key="table3.tableKey"
  608. v-loading="table3.listLoading"
  609. element-loading-text="给我一点时间"
  610. :data="table3.list"
  611. border
  612. fit
  613. highlight-current-row
  614. style="width: 98%"
  615. :row-style="rowStyle"
  616. :cell-style="cellStyle"
  617. class="elTable table-fixed"
  618. max-height="270px"
  619. >
  620. <el-table-column
  621. label="操作编号"
  622. min-width="60px"
  623. align="center"
  624. prop="sort"
  625. />
  626. <el-table-column
  627. label="饲料名称"
  628. min-width="60px"
  629. align="center"
  630. prop="fname"
  631. />
  632. <el-table-column
  633. label="计划重量"
  634. min-width="60px"
  635. align="center"
  636. prop="lweight"
  637. />
  638. <el-table-column
  639. label="实际重量"
  640. min-width="60px"
  641. align="center"
  642. prop="actualweightminus"
  643. />
  644. <el-table-column
  645. label="误差值"
  646. min-width="60px"
  647. align="center"
  648. prop="diff"
  649. />
  650. <el-table-column
  651. label="准确率"
  652. min-width="60px"
  653. align="center"
  654. prop="diffRate"
  655. />
  656. <el-table-column
  657. label="完成时间"
  658. min-width="60px"
  659. align="center"
  660. prop="intime"
  661. />
  662. <el-table-column
  663. label="过程时间"
  664. min-width="60px"
  665. align="center"
  666. prop="proesstime"
  667. />
  668. <el-table-column
  669. label="跳转方式"
  670. min-width="60px"
  671. align="center"
  672. prop="buttontype"
  673. />
  674. <el-table-column
  675. label="开始重量"
  676. min-width="60px"
  677. align="center"
  678. prop="lastactualweight"
  679. />
  680. <el-table-column
  681. label="结束重量"
  682. min-width="60px"
  683. align="center"
  684. prop="actualweight"
  685. />
  686. </el-table>
  687. </div>
  688. <div class="SpreadingMaterials">
  689. <h4>撒料详情</h4>
  690. <el-table
  691. :key="table4.tableKey"
  692. v-loading="table4.listLoading"
  693. element-loading-text="给我一点时间"
  694. :data="table4.list"
  695. border
  696. fit
  697. highlight-current-row
  698. style="width: 98%"
  699. :row-style="rowStyle"
  700. :cell-style="cellStyle"
  701. class="elTable table-fixed"
  702. max-height="200px"
  703. >
  704. <el-table-column
  705. label="操作编号"
  706. min-width="60px"
  707. align="center"
  708. prop="sort"
  709. />
  710. <el-table-column
  711. label="撒料车辆"
  712. min-width="60px"
  713. align="center"
  714. prop="fname"
  715. />
  716. <el-table-column
  717. label="计划重量"
  718. min-width="60px"
  719. align="center"
  720. prop="lweight"
  721. />
  722. <el-table-column
  723. label="实际重量"
  724. min-width="60px"
  725. align="center"
  726. prop="actualweightminus"
  727. />
  728. <el-table-column
  729. label="误差值"
  730. min-width="60px"
  731. align="center"
  732. prop="diff"
  733. />
  734. <el-table-column
  735. label="准确率"
  736. min-width="60px"
  737. align="center"
  738. prop="diffRate"
  739. />
  740. <el-table-column
  741. label="完成时间"
  742. min-width="60px"
  743. align="center"
  744. prop="intime"
  745. />
  746. <el-table-column
  747. label="过程时间"
  748. min-width="60px"
  749. align="center"
  750. prop="proesstime"
  751. />
  752. <el-table-column
  753. label="跳转方式"
  754. min-width="60px"
  755. align="center"
  756. prop="buttontype"
  757. />
  758. <el-table-column
  759. label="开始重量"
  760. min-width="60px"
  761. align="center"
  762. prop="lastactualweight"
  763. />
  764. <el-table-column
  765. label="结束重量"
  766. min-width="60px"
  767. align="center"
  768. prop="actualweight"
  769. />
  770. </el-table>
  771. </div>
  772. <div class="ControlChart">
  773. <h4>监控图</h4>
  774. <div id="chartLine" style="width: 100%; height: 300px" />
  775. </div>
  776. </el-col>
  777. <!-- 撒料计划-撒料 -->
  778. <el-col v-if="isSpreadingPlanSS" :span="16">
  779. <div class="title">
  780. <b>过程详情</b>
  781. <span>&nbsp;({{ title }})</span>
  782. </div>
  783. <div class="detail">
  784. <div v-if="table2.list.length !== 0">
  785. <b>{{ table2.list[0].proesstime }}</b>
  786. <span>过程时间</span>
  787. </div>
  788. <div v-if="table2.list.length !== 0">
  789. <b>{{ table2.list[0].proesstime }}</b>
  790. <span>混料时间</span>
  791. </div>
  792. <div v-if="table2.list.length !== 0">
  793. <b>{{ table2.list[0].iscompleted }}</b>
  794. <span>工作状态</span>
  795. </div>
  796. <div v-if="table2.list.length !== 0">
  797. <b>{{ table2.list[0].Hdif }}kg</b>
  798. <span>混料误差值</span>
  799. </div>
  800. <div v-if="table2.list.length !== 0">
  801. <b>{{ table2.list[0].HdifRate }}</b>
  802. <span>混料准确率</span>
  803. </div>
  804. <div v-if="table2.list.length !== 0">
  805. <b>{{ table2.list[0].Sdif }}kg</b>
  806. <span>撒料误差值</span>
  807. </div>
  808. <div v-if="table2.list.length !== 0">
  809. <b>{{ table2.list[0].SdifRate }}</b>
  810. <span>撒料准确率</span>
  811. </div>
  812. </div>
  813. <div class="Mixture">
  814. <h4>混料详情</h4>
  815. <el-table
  816. :key="table3.tableKey"
  817. v-loading="table3.listLoading"
  818. element-loading-text="给我一点时间"
  819. :data="table3.list"
  820. border
  821. fit
  822. highlight-current-row
  823. style="width: 98%"
  824. :row-style="rowStyle"
  825. :cell-style="cellStyle"
  826. class="elTable table-fixed"
  827. max-height="270px"
  828. >
  829. <el-table-column
  830. label="操作编号"
  831. min-width="60px"
  832. align="center"
  833. prop="sort"
  834. />
  835. <el-table-column
  836. label="撒料车辆"
  837. min-width="60px"
  838. align="center"
  839. prop="fname"
  840. />
  841. <el-table-column
  842. label="计划重量"
  843. min-width="60px"
  844. align="center"
  845. prop="lweight"
  846. />
  847. <el-table-column
  848. label="实际重量"
  849. min-width="60px"
  850. align="center"
  851. prop="actualweightminus"
  852. />
  853. <el-table-column
  854. label="误差值"
  855. min-width="60px"
  856. align="center"
  857. prop="diff"
  858. />
  859. <el-table-column
  860. label="准确率"
  861. min-width="60px"
  862. align="center"
  863. prop="diffRate"
  864. />
  865. <el-table-column
  866. label="完成时间"
  867. min-width="60px"
  868. align="center"
  869. prop="intime"
  870. />
  871. <el-table-column
  872. label="过程时间"
  873. min-width="60px"
  874. align="center"
  875. prop="proesstime"
  876. />
  877. <el-table-column
  878. label="跳转方式"
  879. min-width="60px"
  880. align="center"
  881. prop="buttontype"
  882. />
  883. <el-table-column
  884. label="开始重量"
  885. min-width="60px"
  886. align="center"
  887. prop="lastactualweight"
  888. />
  889. <el-table-column
  890. label="结束重量"
  891. min-width="60px"
  892. align="center"
  893. prop="actualweight"
  894. />
  895. </el-table>
  896. </div>
  897. <div class="SpreadingMaterials">
  898. <h4>撒料详情</h4>
  899. <el-table
  900. :key="table4.tableKey"
  901. v-loading="table4.listLoading"
  902. element-loading-text="给我一点时间"
  903. :data="table4.list"
  904. border
  905. fit
  906. highlight-current-row
  907. style="width: 98%"
  908. :row-style="rowStyle"
  909. :cell-style="cellStyle"
  910. class="elTable table-fixed"
  911. max-height="200px"
  912. >
  913. <el-table-column
  914. label="操作编号"
  915. min-width="70px"
  916. align="center"
  917. prop="sort"
  918. />
  919. <el-table-column
  920. label="撒料车辆"
  921. min-width="70px"
  922. align="center"
  923. prop="fname"
  924. />
  925. <el-table-column
  926. label="计划重量"
  927. min-width="70px"
  928. align="center"
  929. prop="lweight"
  930. />
  931. <el-table-column
  932. label="实际重量"
  933. min-width="70px"
  934. align="center"
  935. prop="actualweightminus"
  936. />
  937. <el-table-column
  938. label="误差值"
  939. min-width="70px"
  940. align="center"
  941. prop="diff"
  942. />
  943. <el-table-column
  944. label="准确率"
  945. min-width="70px"
  946. align="center"
  947. prop="diffRate"
  948. />
  949. <el-table-column
  950. label="完成时间"
  951. min-width="70px"
  952. align="center"
  953. prop="intime"
  954. />
  955. <el-table-column
  956. label="过程时间"
  957. min-width="70px"
  958. align="center"
  959. prop="proesstime"
  960. />
  961. <el-table-column
  962. label="跳转方式"
  963. min-width="70px"
  964. align="center"
  965. prop="buttontype"
  966. />
  967. <el-table-column
  968. label="开始重量"
  969. min-width="70px"
  970. align="center"
  971. prop="lastactualweight"
  972. />
  973. <el-table-column
  974. label="结束重量"
  975. min-width="70px"
  976. align="center"
  977. prop="actualweight"
  978. />
  979. </el-table>
  980. </div>
  981. <div class="ControlChart">
  982. <h4>监控图</h4>
  983. <div id="chartLine" style="width: 100%; height: 300px" />
  984. </div>
  985. </el-col>
  986. </el-row>
  987. </div>
  988. </template>
  989. <script>
  990. import echarts from "echarts";
  991. require("echarts/theme/macarons");
  992. import {
  993. GetDataByName,
  994. GetReportform,
  995. GetDataByNames,
  996. formatNum,
  997. } from "@/api/common";
  998. import Cookies from "js-cookie";
  999. import { parseTime } from "@/utils/index.js";
  1000. export default {
  1001. name: "GroupProcessAnalysis",
  1002. data() {
  1003. return {
  1004. title: "",
  1005. isPremixedPlan: "", // 预混计划
  1006. isSpreadingPlan: "", // 撒料计划
  1007. isResidualMaterialPlan: "", // 剩料计划,
  1008. isSpreadingPlanSH: "", // 撒料计划-混料
  1009. isSpreadingPlanSS: "", // 撒料计划-撒料
  1010. pickerMinDate: "",
  1011. Beforedisabled: false,
  1012. Nextdisabled: false,
  1013. pickerOptions: {
  1014. onPick: ({ maxDate, minDate }) => {
  1015. this.pickerMinDate = minDate.getTime();
  1016. if (maxDate) {
  1017. this.pickerMinDate = "";
  1018. }
  1019. },
  1020. // 限制不能选择今天之后的日期
  1021. disabledDate: (time) => {
  1022. if (this.pickerMinDate !== "") {
  1023. const one = 31 * 24 * 3600 * 1000;
  1024. const minTime = this.pickerMinDate - one;
  1025. let maxTime = this.pickerMinDate + one;
  1026. if (maxTime > new Date()) {
  1027. maxTime = new Date();
  1028. }
  1029. return time.getTime() < minTime || time.getTime() > maxTime;
  1030. }
  1031. return time.getTime() > Date.now();
  1032. },
  1033. },
  1034. requestParams: [
  1035. {
  1036. name: "getPastureListJT",
  1037. offset: 0,
  1038. pagecount: 0,
  1039. parammaps: { pastureid: Cookies.get("pastureid"), pasturename: "" },
  1040. },
  1041. ],
  1042. pastureList: [], // 牧场
  1043. planTypeList: [
  1044. { lable: "预混计划", value: "4" },
  1045. { lable: "撒料计划", value: "0" },
  1046. { lable: "剩料计划", value: "3" },
  1047. { lable: "撒料计划-混料", value: "1" },
  1048. { lable: "撒料计划-撒料", value: "2" },
  1049. { lable: "预称重计划", value: "5" },
  1050. ], // 计划类型
  1051. workingConditionList: [
  1052. { id: "0", name: "进行中" },
  1053. { id: "1", name: "已完成" },
  1054. ], // 工作状态
  1055. // TMR设备列表
  1056. table: {
  1057. getdataListParm: {
  1058. name: "getprocessAnalysis",
  1059. page: 1,
  1060. offset: 1,
  1061. pagecount: "",
  1062. returntype: "Map",
  1063. parammaps: {
  1064. pastureid: "",
  1065. startTime: parseTime(new Date(), "{y}-{m}-{d}"),
  1066. stopTime: parseTime(new Date(), "{y}-{m}-{d}"),
  1067. inputDatetime: [new Date(), new Date()],
  1068. iscompleted: "",
  1069. tmrtname: "",
  1070. lpplantype: "",
  1071. },
  1072. },
  1073. tableKey: 0,
  1074. list: [],
  1075. total: 0,
  1076. listLoading: false,
  1077. },
  1078. // 过程详情
  1079. table2: {
  1080. getdataListParm: {
  1081. name: "getprocessAnalysisStr",
  1082. page: 1,
  1083. offset: 1,
  1084. pagecount: 1,
  1085. returntype: "Map",
  1086. parammaps: {
  1087. pastureid: Cookies.get("pastureid"),
  1088. id: "",
  1089. },
  1090. },
  1091. tableKey: 0,
  1092. list: [],
  1093. total: 0,
  1094. listLoading: true,
  1095. },
  1096. // 混料详情
  1097. table3: {
  1098. getdataListParm: {
  1099. name: "getprocessAnalysisHL",
  1100. page: 1,
  1101. offset: 1,
  1102. pagecount: "",
  1103. returntype: "Map",
  1104. parammaps: {
  1105. pastureid: Cookies.get("pastureid"),
  1106. id: "",
  1107. },
  1108. },
  1109. tableKey: 0,
  1110. list: [],
  1111. total: 0,
  1112. listLoading: true,
  1113. },
  1114. // 撒料详情
  1115. table4: {
  1116. getdataListParm: {
  1117. name: "getprocessAnalysisSL",
  1118. page: 1,
  1119. offset: 1,
  1120. pagecount: "",
  1121. returntype: "Map",
  1122. parammaps: {
  1123. pastureid: Cookies.get("pastureid"),
  1124. id: "",
  1125. },
  1126. },
  1127. tableKey: 0,
  1128. list: [],
  1129. total: 0,
  1130. listLoading: true,
  1131. },
  1132. chart1: {
  1133. getdataListParm: {
  1134. name: "getprocessAnalysisTB",
  1135. page: 1,
  1136. offset: 1,
  1137. pagecount: "",
  1138. returntype: "Map",
  1139. parammaps: {
  1140. pastureid: Cookies.get("pastureid"),
  1141. id: "",
  1142. },
  1143. },
  1144. tableKey: 0,
  1145. list: [],
  1146. total: 0,
  1147. listLoading: false,
  1148. chartLine_data: [],
  1149. },
  1150. chartLine: null,
  1151. chartLine_data: {},
  1152. rowStyle: { maxHeight: 30 + "px", height: 30 + "px" },
  1153. cellStyle: { padding: 0 + "px" },
  1154. };
  1155. },
  1156. created() {
  1157. this.getDownList();
  1158. // this.getTimeFn()
  1159. },
  1160. methods: {
  1161. getDownList() {
  1162. GetDataByNames(this.requestParams).then((response) => {
  1163. this.pastureList = response.data.getPastureListJT.list;
  1164. this.table.getdataListParm.parammaps.pastureid =
  1165. response.data.getPastureListJT.list[0].pastureid;
  1166. this.getList();
  1167. });
  1168. },
  1169. // TMR设备列表
  1170. getList() {
  1171. this.table.listLoading = true;
  1172. GetDataByName(this.table.getdataListParm).then((response) => {
  1173. console.log("TMR设备列表table数据", response.data.list);
  1174. if (response.data.list !== null) {
  1175. this.table.list = response.data.list;
  1176. if (response.data.list[0].lpplantype == "预混计划") {
  1177. this.isPremixedPlan = true;
  1178. this.isSpreadingPlan = false;
  1179. this.isResidualMaterialPlan = false;
  1180. this.isSpreadingPlanSH = false;
  1181. this.isSpreadingPlanSS = false;
  1182. this.table2.getdataListParm.parammaps.id = response.data.list[0].id;
  1183. this.table2.getdataListParm.parammaps.pastureid =
  1184. response.data.list[0].pastureid;
  1185. this.table3.getdataListParm.parammaps.pid =
  1186. response.data.list[0].id;
  1187. this.table3.getdataListParm.parammaps.pastureid =
  1188. response.data.list[0].pastureid;
  1189. this.getList2();
  1190. this.getList3();
  1191. } else if (response.data.list[0].lpplantype == "剩料计划") {
  1192. this.isResidualMaterialPlan = true;
  1193. this.isPremixedPlan = false;
  1194. this.isSpreadingPlan = false;
  1195. this.isSpreadingPlanSH = false;
  1196. this.isSpreadingPlanSS = false;
  1197. this.table2.getdataListParm.name = "getprocessAnalysisStrSH";
  1198. this.table3.getdataListParm.name = "getprocessAnalysisHLSH";
  1199. this.table4.getdataListParm.name = "getprocessAnalysisSLSH";
  1200. this.table2.getdataListParm.parammaps.id = response.data.list[0].id;
  1201. this.table2.getdataListParm.parammaps.pastureid =
  1202. response.data.list[0].pastureid;
  1203. this.table3.getdataListParm.parammaps.pid =
  1204. response.data.list[0].id;
  1205. this.table3.getdataListParm.parammaps.pastureid =
  1206. response.data.list[0].pastureid;
  1207. this.table4.getdataListParm.parammaps.pid =
  1208. response.data.list[0].id;
  1209. this.table4.getdataListParm.parammaps.pastureid =
  1210. response.data.list[0].pastureid;
  1211. this.getList2();
  1212. this.getList3();
  1213. this.getList4();
  1214. } else if (response.data.list[0].lpplantype == "撒料计划-混料") {
  1215. // 撒料计划-混料
  1216. this.isSpreadingPlan = false;
  1217. this.isResidualMaterialPlan = false;
  1218. this.isPremixedPlan = false;
  1219. this.isSpreadingPlanSH = true;
  1220. this.isSpreadingPlanSS = false;
  1221. this.table2.getdataListParm.parammaps.id = response.data.list[0].id;
  1222. this.table2.getdataListParm.parammaps.pastureid =
  1223. response.data.list[0].pastureid;
  1224. this.table3.getdataListParm.parammaps.pid =
  1225. response.data.list[0].id;
  1226. this.table3.getdataListParm.parammaps.pastureid =
  1227. response.data.list[0].pastureid;
  1228. this.table4.getdataListParm.parammaps.pid =
  1229. response.data.list[0].id;
  1230. this.table4.getdataListParm.parammaps.pastureid =
  1231. response.data.list[0].pastureid;
  1232. this.getList2();
  1233. this.getList3();
  1234. this.getList4();
  1235. this.chart1.getdataListParm.parammaps.pid =
  1236. response.data.list[0].id;
  1237. this.chart1.getdataListParm.parammaps.pastureid =
  1238. response.data.list[0].pastureid;
  1239. this.getChart1();
  1240. } else if (response.data.list[0].lpplantype == "撒料计划-撒料") {
  1241. // 撒料计划-撒料
  1242. this.isSpreadingPlan = false;
  1243. this.isResidualMaterialPlan = false;
  1244. this.isPremixedPlan = false;
  1245. this.isSpreadingPlanSH = false;
  1246. this.isSpreadingPlanSS = true;
  1247. this.table2.getdataListParm.parammaps.id = response.data.list[0].id;
  1248. this.table2.getdataListParm.parammaps.pastureid =
  1249. response.data.list[0].pastureid;
  1250. this.table3.getdataListParm.parammaps.pid =
  1251. response.data.list[0].id;
  1252. this.table3.getdataListParm.parammaps.pastureid =
  1253. response.data.list[0].pastureid;
  1254. this.table4.getdataListParm.parammaps.pid =
  1255. response.data.list[0].id;
  1256. this.table4.getdataListParm.parammaps.pastureid =
  1257. response.data.list[0].pastureid;
  1258. this.getList2();
  1259. this.getList3();
  1260. this.getList4();
  1261. this.chart1.getdataListParm.parammaps.pid =
  1262. response.data.list[0].id;
  1263. this.chart1.getdataListParm.parammaps.pastureid =
  1264. response.data.list[0].pastureid;
  1265. this.getChart1();
  1266. } else if (response.data.list[0].lpplantype == "预称重计划") {
  1267. // 撒料计划-混料
  1268. this.isSpreadingPlan = false;
  1269. this.isResidualMaterialPlan = false;
  1270. this.isPremixedPlan = false;
  1271. this.isSpreadingPlanSH = true;
  1272. this.isSpreadingPlanSS = false;
  1273. this.table2.getdataListParm.parammaps.id = response.data.list[0].id;
  1274. this.table2.getdataListParm.parammaps.pastureid =
  1275. response.data.list[0].pastureid;
  1276. this.table3.getdataListParm.parammaps.pid =
  1277. response.data.list[0].id;
  1278. this.table3.getdataListParm.parammaps.pastureid =
  1279. response.data.list[0].pastureid;
  1280. this.table4.getdataListParm.parammaps.pid =
  1281. response.data.list[0].id;
  1282. this.table4.getdataListParm.parammaps.pastureid =
  1283. response.data.list[0].pastureid;
  1284. this.getList2();
  1285. this.getList3();
  1286. this.getList4();
  1287. this.chart1.getdataListParm.parammaps.pid =
  1288. response.data.list[0].id;
  1289. this.chart1.getdataListParm.parammaps.pastureid =
  1290. response.data.list[0].pastureid;
  1291. this.getChart1();
  1292. } else {
  1293. // 撒料
  1294. this.isSpreadingPlan = true;
  1295. this.isResidualMaterialPlan = false;
  1296. this.isPremixedPlan = false;
  1297. this.isSpreadingPlanSH = false;
  1298. this.isSpreadingPlanSS = false;
  1299. this.table2.getdataListParm.parammaps.id = response.data.list[0].id;
  1300. this.table2.getdataListParm.parammaps.pastureid =
  1301. response.data.list[0].pastureid;
  1302. this.table3.getdataListParm.parammaps.pid =
  1303. response.data.list[0].id;
  1304. this.table3.getdataListParm.parammaps.pastureid =
  1305. response.data.list[0].pastureid;
  1306. this.table4.getdataListParm.parammaps.pid =
  1307. response.data.list[0].id;
  1308. this.table4.getdataListParm.parammaps.pastureid =
  1309. response.data.list[0].pastureid;
  1310. this.getList2();
  1311. this.getList3();
  1312. this.getList4();
  1313. this.chart1.getdataListParm.parammaps.pid =
  1314. response.data.list[0].id;
  1315. this.chart1.getdataListParm.parammaps.pastureid =
  1316. response.data.list[0].pastureid;
  1317. this.getChart1();
  1318. }
  1319. this.title = response.data.list[0].lpplantype;
  1320. } else {
  1321. this.table.list = [];
  1322. this.table2.list = [];
  1323. this.table3.list = [];
  1324. this.table2.listLoading = false;
  1325. this.table3.listLoading = false;
  1326. this.table4.listLoading = false;
  1327. this.chart1.listLoading = false;
  1328. }
  1329. setTimeout(() => {
  1330. this.table.listLoading = false;
  1331. }, 100);
  1332. });
  1333. },
  1334. form_search() {
  1335. console.log("点击了查询");
  1336. if (
  1337. this.table.getdataListParm.parammaps.inputDatetime !== "" &&
  1338. this.table.getdataListParm.parammaps.inputDatetime !== null
  1339. ) {
  1340. this.table.getdataListParm.parammaps.startTime = parseTime(
  1341. this.table.getdataListParm.parammaps.inputDatetime[0],
  1342. "{y}-{m}-{d}"
  1343. );
  1344. this.table.getdataListParm.parammaps.stopTime = parseTime(
  1345. this.table.getdataListParm.parammaps.inputDatetime[1],
  1346. "{y}-{m}-{d}"
  1347. );
  1348. } else {
  1349. this.table.getdataListParm.parammaps.inputDatetime = "";
  1350. this.table.getdataListParm.parammaps.startTime = "";
  1351. this.table.getdataListParm.parammaps.stopTime = "";
  1352. }
  1353. this.table.getdataListParm.offset = 1;
  1354. this.getList();
  1355. },
  1356. handleRefresh() {
  1357. console.log("点击了重置");
  1358. this.table.getdataListParm.parammaps.tmrtname = [];
  1359. this.table.getdataListParm.parammaps.iscompleted = "";
  1360. this.table.getdataListParm.parammaps.lpplantype = "";
  1361. this.table.getdataListParm.parammaps.startTime = "";
  1362. this.table.getdataListParm.parammaps.stopTime = "";
  1363. this.table.getdataListParm.parammaps.inputDatetime = "";
  1364. this.table.getdataListParm.offset = 1;
  1365. this.getList();
  1366. },
  1367. handleBefore() {
  1368. if (
  1369. this.table.getdataListParm.parammaps.inputDatetime !== "" &&
  1370. this.table.getdataListParm.parammaps.inputDatetime !== null
  1371. ) {
  1372. var start = new Date(
  1373. this.table.getdataListParm.parammaps.inputDatetime[0].setDate(
  1374. this.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1
  1375. )
  1376. );
  1377. var stop = new Date(
  1378. this.table.getdataListParm.parammaps.inputDatetime[1].setDate(
  1379. this.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1
  1380. )
  1381. );
  1382. if (stop > Date.now()) {
  1383. this.Nextdisabled = true;
  1384. this.Beforedisabled = false;
  1385. } else {
  1386. this.Nextdisabled = false;
  1387. this.Beforedisabled = false;
  1388. }
  1389. this.table.getdataListParm.parammaps.inputDatetime.length = 0;
  1390. this.table.getdataListParm.parammaps.inputDatetime.push(start, stop);
  1391. this.$forceUpdate();
  1392. }
  1393. this.table.getdataListParm.parammaps.startTime = parseTime(
  1394. this.table.getdataListParm.parammaps.inputDatetime[0],
  1395. "{y}-{m}-{d}"
  1396. );
  1397. this.table.getdataListParm.parammaps.stopTime = parseTime(
  1398. this.table.getdataListParm.parammaps.inputDatetime[1],
  1399. "{y}-{m}-{d}"
  1400. );
  1401. this.getList();
  1402. },
  1403. handleNext() {
  1404. if (
  1405. this.table.getdataListParm.parammaps.inputDatetime !== "" &&
  1406. this.table.getdataListParm.parammaps.inputDatetime !== null
  1407. ) {
  1408. var start2 = new Date(
  1409. this.table.getdataListParm.parammaps.inputDatetime[0].setDate(
  1410. this.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1
  1411. )
  1412. );
  1413. var stop2 = new Date(
  1414. this.table.getdataListParm.parammaps.inputDatetime[1].setDate(
  1415. this.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1
  1416. )
  1417. );
  1418. if (stop2 > Date.now()) {
  1419. this.Nextdisabled = true;
  1420. this.Beforedisabled = false;
  1421. } else {
  1422. this.Nextdisabled = false;
  1423. this.Beforedisabled = false;
  1424. }
  1425. this.table.getdataListParm.parammaps.inputDatetime.length = 0;
  1426. this.table.getdataListParm.parammaps.inputDatetime.push(start2, stop2);
  1427. this.$forceUpdate();
  1428. }
  1429. this.table.getdataListParm.parammaps.startTime = parseTime(
  1430. this.table.getdataListParm.parammaps.inputDatetime[0],
  1431. "{y}-{m}-{d}"
  1432. );
  1433. this.table.getdataListParm.parammaps.stopTime = parseTime(
  1434. this.table.getdataListParm.parammaps.inputDatetime[1],
  1435. "{y}-{m}-{d}"
  1436. );
  1437. this.getList();
  1438. },
  1439. rowClick(row, column, event) {
  1440. this.table2.getdataListParm.parammaps.id = row.id;
  1441. this.table3.getdataListParm.parammaps.pid = row.id;
  1442. this.table4.getdataListParm.parammaps.pid = row.id;
  1443. this.chart1.getdataListParm.parammaps.pid = row.id;
  1444. this.chartName = row.tmrtname;
  1445. if (row.lpplantype == "预混计划") {
  1446. this.isPremixedPlan = true;
  1447. this.isResidualMaterialPlan = false;
  1448. this.isSpreadingPlan = false;
  1449. this.isSpreadingPlanSH = false;
  1450. this.isSpreadingPlanSS = false;
  1451. this.table2.getdataListParm.name = "getprocessAnalysisStr";
  1452. this.table3.getdataListParm.name = "getprocessAnalysisHL";
  1453. this.table2.getdataListParm.parammaps.pastureid = row.pastureid;
  1454. this.table3.getdataListParm.parammaps.pastureid = row.pastureid;
  1455. this.getList2();
  1456. this.getList3();
  1457. } else if (row.lpplantype == "剩料计划") {
  1458. this.isResidualMaterialPlan = true;
  1459. this.isPremixedPlan = false;
  1460. this.isSpreadingPlan = false;
  1461. this.isSpreadingPlanSH = false;
  1462. this.isSpreadingPlanSS = false;
  1463. this.table2.getdataListParm.name = "getprocessAnalysisStrSH";
  1464. this.table3.getdataListParm.name = "getprocessAnalysisHLSH";
  1465. this.table4.getdataListParm.name = "getprocessAnalysisSLSH";
  1466. this.table2.getdataListParm.parammaps.pastureid = row.pastureid;
  1467. this.table3.getdataListParm.parammaps.pastureid = row.pastureid;
  1468. this.table4.getdataListParm.parammaps.pastureid = row.pastureid;
  1469. this.getList2();
  1470. this.getList3();
  1471. this.getList4();
  1472. } else if (row.lpplantype == "撒料计划-混料") {
  1473. this.isSpreadingPlan = false;
  1474. this.isPremixedPlan = false;
  1475. this.isResidualMaterialPlan = false;
  1476. this.isSpreadingPlanSH = true;
  1477. this.isSpreadingPlanSS = false;
  1478. this.table2.getdataListParm.name = "getprocessAnalysisStr";
  1479. this.table3.getdataListParm.name = "getprocessAnalysisHL";
  1480. this.table4.getdataListParm.name = "getprocessAnalysisSL";
  1481. this.table2.getdataListParm.parammaps.pastureid = row.pastureid;
  1482. this.table3.getdataListParm.parammaps.pastureid = row.pastureid;
  1483. this.table4.getdataListParm.parammaps.pastureid = row.pastureid;
  1484. this.chart1.getdataListParm.parammaps.pastureid = row.pastureid;
  1485. this.getList2();
  1486. this.getList3();
  1487. this.getList4();
  1488. this.getChart1();
  1489. } else if (row.lpplantype == "撒料计划-撒料") {
  1490. this.isSpreadingPlan = false;
  1491. this.isPremixedPlan = false;
  1492. this.isResidualMaterialPlan = false;
  1493. this.isSpreadingPlanSH = false;
  1494. this.isSpreadingPlanSS = true;
  1495. this.table2.getdataListParm.name = "getprocessAnalysisStr";
  1496. this.table3.getdataListParm.name = "getprocessAnalysisHL";
  1497. this.table4.getdataListParm.name = "getprocessAnalysisSL";
  1498. this.table2.getdataListParm.parammaps.pastureid = row.pastureid;
  1499. this.table3.getdataListParm.parammaps.pastureid = row.pastureid;
  1500. this.table4.getdataListParm.parammaps.pastureid = row.pastureid;
  1501. this.chart1.getdataListParm.parammaps.pastureid = row.pastureid;
  1502. this.getList2();
  1503. this.getList3();
  1504. this.getList4();
  1505. this.getChart1();
  1506. } else if (row.lpplantype == "预称重计划") {
  1507. this.isSpreadingPlan = false;
  1508. this.isPremixedPlan = false;
  1509. this.isResidualMaterialPlan = false;
  1510. this.isSpreadingPlanSH = true;
  1511. this.isSpreadingPlanSS = false;
  1512. this.table2.getdataListParm.name = "getprocessAnalysisStr";
  1513. this.table3.getdataListParm.name = "getprocessAnalysisHL";
  1514. this.table4.getdataListParm.name = "getprocessAnalysisSL";
  1515. this.table2.getdataListParm.parammaps.pastureid = row.pastureid;
  1516. this.table3.getdataListParm.parammaps.pastureid = row.pastureid;
  1517. this.table4.getdataListParm.parammaps.pastureid = row.pastureid;
  1518. this.chart1.getdataListParm.parammaps.pastureid = row.pastureid;
  1519. this.getList2();
  1520. this.getList3();
  1521. this.getList4();
  1522. this.getChart1();
  1523. } else {
  1524. this.isSpreadingPlan = true;
  1525. this.isPremixedPlan = false;
  1526. this.isResidualMaterialPlan = false;
  1527. this.isSpreadingPlanSH = false;
  1528. this.isSpreadingPlanSS = false;
  1529. this.table2.getdataListParm.name = "getprocessAnalysisStr";
  1530. this.table3.getdataListParm.name = "getprocessAnalysisHL";
  1531. this.table4.getdataListParm.name = "getprocessAnalysisSL";
  1532. this.table2.getdataListParm.parammaps.pastureid = row.pastureid;
  1533. this.table3.getdataListParm.parammaps.pastureid = row.pastureid;
  1534. this.table4.getdataListParm.parammaps.pastureid = row.pastureid;
  1535. this.chart1.getdataListParm.parammaps.pastureid = row.pastureid;
  1536. this.getList2();
  1537. this.getList3();
  1538. this.getList4();
  1539. this.getChart1();
  1540. }
  1541. this.title = "" + row.lpplantype;
  1542. },
  1543. // 过程详情
  1544. getList2() {
  1545. this.table2.listLoading = false;
  1546. GetDataByName(this.table2.getdataListParm).then((response) => {
  1547. console.log("过程详情table数据", response.data.list);
  1548. if (response.data.list !== null) {
  1549. this.table2.list = response.data.list;
  1550. } else {
  1551. this.table2.list = [];
  1552. }
  1553. setTimeout(() => {
  1554. this.table2.listLoading = false;
  1555. }, 100);
  1556. });
  1557. },
  1558. // 混料详情
  1559. getList3() {
  1560. this.table3.listLoading = false;
  1561. GetDataByName(this.table3.getdataListParm).then((response) => {
  1562. console.log("混料详情table数据", response.data.list);
  1563. if (response.data.list !== null) {
  1564. this.table3.list = response.data.list;
  1565. var sumlweight = 0;
  1566. var sumactualweightminus = 0;
  1567. var sumsweight = 0;
  1568. var sumproesstime = "";
  1569. for (let i = 0; i < response.data.list.length; i++) {
  1570. if (response.data.list[i].lweight == undefined) {
  1571. response.data.list[i].lweight = 0;
  1572. }
  1573. if (response.data.list[i].actualweightminus == undefined) {
  1574. response.data.list[i].actualweightminus = 0;
  1575. }
  1576. if (response.data.list[i].sweight == undefined) {
  1577. response.data.list[i].sweight = 0;
  1578. }
  1579. sumlweight += parseFloat(response.data.list[i].lweight);
  1580. sumactualweightminus += parseFloat(
  1581. response.data.list[i].actualweightminus
  1582. );
  1583. sumsweight += parseFloat(response.data.list[i].sweight);
  1584. sumproesstime = response.data.list[0].sumproesstime;
  1585. }
  1586. sumlweight = formatNum(sumlweight, 2);
  1587. sumactualweightminus = formatNum(sumactualweightminus, 2);
  1588. sumsweight = formatNum(sumsweight, 2);
  1589. this.table3.list.push({
  1590. sort: "合计",
  1591. lweight: sumlweight,
  1592. actualweightminus: sumactualweightminus,
  1593. sweight: sumsweight,
  1594. proesstime: sumproesstime,
  1595. });
  1596. } else {
  1597. this.table3.list = [];
  1598. }
  1599. setTimeout(() => {
  1600. this.table3.listLoading = false;
  1601. }, 100);
  1602. });
  1603. },
  1604. // 撒料详情
  1605. getList4() {
  1606. this.table4.listLoading = false;
  1607. GetDataByName(this.table4.getdataListParm).then((response) => {
  1608. console.log("撒料详情table数据", response.data.list);
  1609. if (response.data.list !== null) {
  1610. this.table4.list = response.data.list;
  1611. var sumlweight = 0;
  1612. var sumactualweightminus = 0;
  1613. var sumsweight = 0;
  1614. var sumproesstime = "";
  1615. for (let i = 0; i < response.data.list.length; i++) {
  1616. if (response.data.list[i].lweight == undefined) {
  1617. response.data.list[i].lweight = 0;
  1618. }
  1619. if (response.data.list[i].actualweightminus == undefined) {
  1620. response.data.list[i].actualweightminus = 0;
  1621. }
  1622. if (response.data.list[i].sweight == undefined) {
  1623. response.data.list[i].sweight = 0;
  1624. }
  1625. sumlweight += parseFloat(response.data.list[i].lweight);
  1626. sumactualweightminus += parseFloat(
  1627. response.data.list[i].actualweightminus
  1628. );
  1629. sumsweight += parseFloat(response.data.list[i].sweight);
  1630. sumproesstime = response.data.list[0].sumproesstime;
  1631. }
  1632. sumlweight = formatNum(sumlweight, 2);
  1633. sumactualweightminus = formatNum(sumactualweightminus, 2);
  1634. sumsweight = formatNum(sumsweight, 2);
  1635. this.table4.list.push({
  1636. sort: "合计",
  1637. lweight: sumlweight,
  1638. actualweightminus: sumactualweightminus,
  1639. sweight: sumsweight,
  1640. proesstime: sumproesstime,
  1641. });
  1642. this.rowspan();
  1643. } else {
  1644. this.table4.list = [];
  1645. }
  1646. setTimeout(() => {
  1647. this.table4.listLoading = false;
  1648. }, 100);
  1649. });
  1650. },
  1651. rowspan() {
  1652. this.spanArr = [];
  1653. this.table4.list.forEach((item, index) => {
  1654. if (index == 0) {
  1655. this.spanArr.push(1);
  1656. this.position = 0;
  1657. } else {
  1658. console.log(item, index, "======");
  1659. if (
  1660. this.table4.list[index].aweight ==
  1661. this.table4.list[index - 1].aweight
  1662. ) {
  1663. this.spanArr[this.position] += 1;
  1664. this.spanArr.push(0);
  1665. } else {
  1666. this.spanArr.push(1);
  1667. this.position = index;
  1668. }
  1669. }
  1670. });
  1671. },
  1672. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  1673. if (columnIndex == 4) {
  1674. const _row = this.spanArr[rowIndex];
  1675. const _col = _row > 0 ? 1 : 0;
  1676. return {
  1677. rowspan: _row,
  1678. colspan: _col,
  1679. };
  1680. }
  1681. },
  1682. getChart1() {
  1683. this.chart1.listLoading = true;
  1684. GetReportform(this.chart1.getdataListParm).then((response) => {
  1685. if (response.data.list !== null) {
  1686. this.chart1.list = response.data.data;
  1687. console.log("实时监控", response.data.list);
  1688. // console.log('实时监控', response.data.list.data4)
  1689. var evenNumbers = []; // 偶数
  1690. var oddNumbers = []; // 奇数
  1691. for (let i = 0; i < response.data.list.data4.length; i++) {
  1692. console.log(response.data.list.data4[i]);
  1693. if (i == 0) {
  1694. oddNumbers.push(response.data.list.data4[i]);
  1695. } else {
  1696. if (i % 2 == 0) {
  1697. evenNumbers.push(response.data.list.data4[i]);
  1698. } else {
  1699. oddNumbers.push(response.data.list.data4[i]);
  1700. }
  1701. }
  1702. }
  1703. response.data.list.data4 = oddNumbers;
  1704. response.data.list.data5 = evenNumbers;
  1705. // 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'],
  1706. // response.data.list.data2 = [
  1707. // { 'value': '141.6', 'myname': 'A1' },
  1708. // { 'value': '141.6', 'myname': 'A1' },
  1709. // { 'value': '141.6', 'myname': 'A1' },
  1710. // { 'value': '141.6', 'myname': 'A1' },
  1711. // { 'value': '141.6', 'myname': 'A1' },
  1712. // { 'value': '141.6', 'myname': 'A1' },
  1713. // { 'value': '141.6', 'myname': 'A1' },
  1714. // { 'value': '141.6', 'myname': 'A1' },
  1715. // { 'value': '141.6', 'myname': 'A1' },
  1716. // { 'value': '141.6', 'myname': 'A1' },
  1717. // { 'value': '141.6', 'myname': 'A1' },
  1718. // { 'value': '141.6', 'myname': 'A1' },
  1719. // { 'value': '141.6', 'myname': 'A1' },
  1720. // { 'value': '141.6', 'myname': 'A1' },
  1721. // { 'value': '141.6', 'myname': 'A1' },
  1722. // { 'value': '141.6', 'myname': 'A1' },
  1723. // { 'value': '141.6', 'myname': 'A1' },
  1724. // { 'value': '141.6', 'myname': 'A1' },
  1725. // { 'value': '141.6', 'myname': 'A1' },
  1726. // { 'value': '141.6', 'myname': 'A1' },
  1727. // { 'value': '141.6', 'myname': 'A1' },
  1728. // { 'value': '141.6', 'myname': 'A1' },
  1729. // { 'value': '141.6', 'myname': 'A1' },
  1730. // { 'value': '141.6', 'myname': 'A1' },
  1731. // { 'value': '141.6', 'myname': 'A1' },
  1732. // { 'value': '141.6', 'myname': 'A1' },
  1733. // { 'value': '141.6', 'myname': 'A1' },
  1734. // { 'value': '141.6', 'myname': 'A1' },
  1735. // { 'value': '341.46', 'myname': 'B1' },
  1736. // { 'value': '341.46', 'myname': 'B1' },
  1737. // { 'value': '341.46', 'myname': 'B1' },
  1738. // { 'value': '341.46', 'myname': 'B1' },
  1739. // { 'value': '341.46', 'myname': 'B1' },
  1740. // { 'value': '341.46', 'myname': 'B1' },
  1741. // { 'value': '341.46', 'myname': 'B1' },
  1742. // { 'value': '437.73', 'myname': 'C1' },
  1743. // { 'value': '437.73', 'myname': 'C1' },
  1744. // { 'value': '437.73', 'myname': 'C1' },
  1745. // { 'value': '437.73', 'myname': 'C1' },
  1746. // { 'value': '437.73', 'myname': 'C1' },
  1747. // { 'value': '437.73', 'myname': 'C1' },
  1748. // { 'value': '437.73', 'myname': 'C1' },
  1749. // { 'value': '687.33', 'myname': 'C1' },
  1750. // { 'value': '687.33', 'myname': 'C1' },
  1751. // { 'value': '687.33', 'myname': 'C1' },
  1752. // { 'value': '687.33', 'myname': 'C1' },
  1753. // { 'value': '687.33', 'myname': 'C1' },
  1754. // { 'value': '687.33', 'myname': 'C1' },
  1755. // { 'value': '687.33', 'myname': 'C1' },
  1756. // { 'value': '959.24', 'myname': 'D1' },
  1757. // { 'value': '959.24', 'myname': 'D1' },
  1758. // { 'value': '959.24', 'myname': 'D1' },
  1759. // { 'value': '959.24', 'myname': 'D1' },
  1760. // { 'value': '959.24', 'myname': 'D1' },
  1761. // { 'value': '959.24', 'myname': 'D1' },
  1762. // { 'value': '959.24', 'myname': 'D1' },
  1763. // { 'value': '959.24', 'myname': 'D1' },
  1764. // { 'value': '1107.6', 'myname': 'D1' },
  1765. // { 'value': '1107.6', 'myname': 'D1' },
  1766. // { 'value': '1107.6', 'myname': 'D1' },
  1767. // { 'value': '1107.6', 'myname': 'D1' },
  1768. // { 'value': '1107.6', 'myname': 'D1' },
  1769. // { 'value': '1107.6', 'myname': 'D1' },
  1770. // { 'value': '1107.6', 'myname': 'D1' },
  1771. // { 'value': '1107.6', 'myname': 'D1' }
  1772. // ]
  1773. // 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],
  1774. this.chart1.chartLine_data = response.data.list;
  1775. this.chart1.total = response.data.total;
  1776. this.roadChartLine1(this.chart1.chartLine_data);
  1777. } else {
  1778. this.chart1.list = [];
  1779. }
  1780. setTimeout(() => {
  1781. this.chart1.listLoading = false;
  1782. }, 100);
  1783. });
  1784. },
  1785. roadChartLine1(chartLine_data) {
  1786. console.log(chartLine_data, "chartLine_data");
  1787. if (this.chartLine != null) {
  1788. this.chartLine.dispose();
  1789. }
  1790. this.chartLine = echarts.init(document.getElementById("chartLine"));
  1791. var option = {
  1792. title: { text: "", subtext: "" },
  1793. color: ["#38c193", "#5199e5", "#fdb06a", "#fb8b73"], // 关键加上这句话,legend的颜色和折线的自定义颜色就一致了
  1794. legend: [
  1795. {
  1796. itemWidth: 15,
  1797. itemHeight: 7,
  1798. right: "25%",
  1799. textStyle: { fontSize: 12 },
  1800. data: [{ name: "设计重量" }, { name: "实际重量" }],
  1801. },
  1802. {
  1803. itemWidth: 15,
  1804. itemHeight: 15,
  1805. right: "0",
  1806. textStyle: { fontSize: 12 },
  1807. data: [{ name: "开始重量" }, { name: "结束重量" }],
  1808. },
  1809. ],
  1810. tooltip: {
  1811. trigger: "axis",
  1812. formatter: function (params) {
  1813. // console.log(params, 'params')
  1814. var tip = params[0].name;
  1815. for (let i = 0; i < params.length; i++) {
  1816. tip += "<br>" + params[i].seriesName + ": ";
  1817. if (params[i].value[0] == params[0].name) {
  1818. tip += params[i].value[1];
  1819. } else {
  1820. tip += params[i].value;
  1821. }
  1822. }
  1823. tip += "<br>" + params[0].data[2] + params[0].data[3];
  1824. console.log(tip, "tip");
  1825. return tip;
  1826. },
  1827. },
  1828. calculable: true,
  1829. xAxis: [
  1830. {
  1831. type: "category",
  1832. splitLine: { show: false },
  1833. name: "时间",
  1834. data: chartLine_data.data1,
  1835. axisLabel: { show: true, textStyle: { color: "#666" } },
  1836. },
  1837. ],
  1838. yAxis: [{ type: "value" }],
  1839. series: [
  1840. {
  1841. symbol: "none",
  1842. name: "实际重量",
  1843. type: "line",
  1844. data: chartLine_data.data3,
  1845. smooth: true,
  1846. barWidth: "37",
  1847. itemStyle: { normal: { lineStyle: { color: "#38c193" } } },
  1848. },
  1849. {
  1850. symbol: "none",
  1851. name: "设计重量",
  1852. type: "line",
  1853. step: "middle",
  1854. data: chartLine_data.data2,
  1855. },
  1856. {
  1857. name: "开始重量",
  1858. symbolSize: 10,
  1859. type: "scatter",
  1860. data: chartLine_data.data4,
  1861. },
  1862. {
  1863. name: "结束重量",
  1864. symbolSize: 10,
  1865. type: "scatter",
  1866. data: chartLine_data.data5,
  1867. },
  1868. ],
  1869. };
  1870. this.chartLine.setOption(option);
  1871. window.onresize = function () {
  1872. this.chartLine.resize();
  1873. };
  1874. },
  1875. },
  1876. };
  1877. </script>
  1878. <style lang="scss" scoped>
  1879. .search {
  1880. padding-top: 10px;
  1881. clear: both;
  1882. }
  1883. .detail {
  1884. height: 84px;
  1885. padding: 0 10px;
  1886. font: 16px/32px "";
  1887. color: #333;
  1888. background: #f9f9f9;
  1889. display: flex;
  1890. align-items: center;
  1891. text-align: center;
  1892. div {
  1893. height: 15px;
  1894. width: 20%;
  1895. border-right: 1px solid #e0e0e0;
  1896. color: #333;
  1897. b {
  1898. line-height: 20px;
  1899. font-size: 16px;
  1900. display: block;
  1901. margin-top: -10px;
  1902. height: 20px;
  1903. color: #009a69;
  1904. }
  1905. span {
  1906. font-size: 14px;
  1907. }
  1908. }
  1909. div:last-child {
  1910. border-right: none;
  1911. }
  1912. }
  1913. .title {
  1914. height: 50px;
  1915. line-height: 50px;
  1916. }
  1917. </style>