29187eb6f65896c612e9d43d32b95407d99a178a.svn-base 54 KB

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