acafd8a25175cbf84e3ef85fe84940ca127c7774.svn-base 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335
  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: 'triangle' },
  1232. { name: '结束重量', icon: 'triangle' }
  1233. ],
  1234. right: '20%',
  1235. textStyle: {
  1236. fontSize: 12,
  1237. color: '#666'
  1238. }
  1239. },
  1240. tooltip: {
  1241. trigger: 'axis'
  1242. },
  1243. calculable: true,
  1244. xAxis: [
  1245. {
  1246. type: 'category',
  1247. splitLine: { show: false }, // 去除网格线
  1248. name: '时间',
  1249. data: chartLine_data.data1,
  1250. axisLabel: {
  1251. show: true,
  1252. textStyle: {
  1253. color: '#666' // 这里用参数代替了
  1254. }
  1255. }
  1256. }
  1257. ],
  1258. yAxis: [
  1259. {
  1260. type: 'value'
  1261. }
  1262. ],
  1263. series: [
  1264. {
  1265. symbol: 'none',
  1266. name: '实际重量',
  1267. type: 'line',
  1268. // step: 'end',
  1269. data: chartLine_data.data3,
  1270. smooth: true,
  1271. barWidth: '37',
  1272. itemStyle: {
  1273. normal: {
  1274. lineStyle: { color: '#ff3131' }
  1275. }
  1276. }
  1277. },
  1278. {
  1279. symbol: 'none',
  1280. name: '设计重量',
  1281. type: 'line',
  1282. step: 'middle',
  1283. // symbol: 'rect',
  1284. // symbolSize: [100, 2],
  1285. // label: { show: true, formatter: '{b} {c}kg' },
  1286. data: chartLine_data.data2
  1287. }, {
  1288. name: '开始重量',
  1289. symbol: 'triangle',
  1290. symbolSize: 10,
  1291. type: 'scatter',
  1292. data: chartLine_data.data4
  1293. }, {
  1294. name: '结束重量',
  1295. symbol: 'triangle',
  1296. symbolSize: 10,
  1297. type: 'scatter',
  1298. data: chartLine_data.data5
  1299. }
  1300. ]
  1301. }
  1302. this.chartLine.setOption(option)
  1303. window.onresize = function() {
  1304. this.chartLine.resize()
  1305. }
  1306. }
  1307. }
  1308. }
  1309. </script>
  1310. <style lang="scss" scoped>
  1311. .search{padding-top:10px;clear: both;}
  1312. .table{margin-top:10px;}
  1313. .detail{
  1314. height:84px;border: 1px solid #EBEEF5;padding-left:10px;font:16px/32px '';color:#333;
  1315. .detail-t{margin-top: 10px;}
  1316. .detail-b{margin-bottom: 10px;}
  1317. }
  1318. </style>