dbf12a8e43671af6f1f68b86d3dd7e6cc264ef32.svn-base 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344
  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. console.log(123)
  991. this.table.list = []
  992. this.table2.list = []
  993. this.table3.list = []
  994. this.table4.list = []
  995. this.table2.listLoading = false
  996. this.table3.listLoading = false
  997. this.table4.listLoading = false
  998. this.chart1.listLoading = false
  999. }
  1000. setTimeout(() => {
  1001. this.table.listLoading = false
  1002. }, 100)
  1003. })
  1004. },
  1005. handleSearch() {
  1006. console.log('点击了查询')
  1007. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  1008. this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1009. this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1010. } else {
  1011. this.table.getdataListParm.parammaps.inputDatetime = ''
  1012. this.table.getdataListParm.parammaps.startTime = ''
  1013. this.table.getdataListParm.parammaps.stopTime = ''
  1014. }
  1015. this.table.getdataListParm.offset = 1
  1016. this.getList()
  1017. },
  1018. handleRefresh() {
  1019. console.log('点击了重置')
  1020. this.table.getdataListParm.parammaps.tmrtname = ''
  1021. this.table.getdataListParm.parammaps.iscompleted = ''
  1022. this.table.getdataListParm.parammaps.lpplantype = ''
  1023. this.table.getdataListParm.parammaps.startTime = ''
  1024. this.table.getdataListParm.parammaps.stopTime = ''
  1025. this.table.getdataListParm.parammaps.inputDatetime = ''
  1026. this.table.getdataListParm.offset = 1
  1027. this.getList()
  1028. },
  1029. rowClick(row, column, event) {
  1030. this.table2.getdataListParm.parammaps.id = row.id
  1031. this.table3.getdataListParm.parammaps.pid = row.id
  1032. this.table4.getdataListParm.parammaps.pid = row.id
  1033. this.chart1.getdataListParm.parammaps.pid = row.id
  1034. if (row.lpplantype == '预混计划') {
  1035. this.isPremixedPlan = true
  1036. this.isResidualMaterialPlan = false
  1037. this.isSpreadingPlan = false
  1038. this.isSpreadingPlanSH = false
  1039. this.isSpreadingPlanSS = false
  1040. this.table2.getdataListParm.name = 'getprocessAnalysisStr'
  1041. this.table3.getdataListParm.name = 'getprocessAnalysisHL'
  1042. this.getList2()
  1043. this.getList3()
  1044. } else if (row.lpplantype == '剩料计划') {
  1045. this.isResidualMaterialPlan = true
  1046. this.isPremixedPlan = false
  1047. this.isSpreadingPlan = false
  1048. this.isSpreadingPlanSH = false
  1049. this.isSpreadingPlanSS = false
  1050. this.table2.getdataListParm.name = 'getprocessAnalysisStrSH'
  1051. this.table3.getdataListParm.name = 'getprocessAnalysisHLSH'
  1052. this.table4.getdataListParm.name = 'getprocessAnalysisSLSH'
  1053. this.getList2()
  1054. this.getList3()
  1055. this.getList4()
  1056. } else if (row.lpplantype == '撒料计划-混料') {
  1057. this.isSpreadingPlan = false
  1058. this.isPremixedPlan = false
  1059. this.isResidualMaterialPlan = false
  1060. this.isSpreadingPlanSH = true
  1061. this.isSpreadingPlanSS = false
  1062. this.table2.getdataListParm.name = 'getprocessAnalysisStr'
  1063. this.table3.getdataListParm.name = 'getprocessAnalysisHL'
  1064. this.table4.getdataListParm.name = 'getprocessAnalysisSL'
  1065. this.getList2()
  1066. this.getList3()
  1067. this.getList4()
  1068. this.getChart1()
  1069. } else if (row.lpplantype == '撒料计划-撒料') {
  1070. this.isSpreadingPlan = false
  1071. this.isPremixedPlan = false
  1072. this.isResidualMaterialPlan = false
  1073. this.isSpreadingPlanSH = false
  1074. this.isSpreadingPlanSS = true
  1075. this.table2.getdataListParm.name = 'getprocessAnalysisStr'
  1076. this.table3.getdataListParm.name = 'getprocessAnalysisHL'
  1077. this.table4.getdataListParm.name = 'getprocessAnalysisSL'
  1078. this.getList2()
  1079. this.getList3()
  1080. this.getList4()
  1081. this.getChart1()
  1082. } else if (row.lpplantype == '预称重计划') {
  1083. this.isSpreadingPlan = false
  1084. this.isPremixedPlan = false
  1085. this.isResidualMaterialPlan = false
  1086. this.isSpreadingPlanSH = true
  1087. this.isSpreadingPlanSS = false
  1088. this.table2.getdataListParm.name = 'getprocessAnalysisStr'
  1089. this.table3.getdataListParm.name = 'getprocessAnalysisHL'
  1090. this.table4.getdataListParm.name = 'getprocessAnalysisSL'
  1091. this.getList2()
  1092. this.getList3()
  1093. this.getList4()
  1094. this.getChart1()
  1095. } else {
  1096. this.isSpreadingPlan = true
  1097. this.isPremixedPlan = false
  1098. this.isResidualMaterialPlan = false
  1099. this.isSpreadingPlanSH = false
  1100. this.isSpreadingPlanSS = false
  1101. this.table2.getdataListParm.name = 'getprocessAnalysisStr'
  1102. this.table3.getdataListParm.name = 'getprocessAnalysisHL'
  1103. this.table4.getdataListParm.name = 'getprocessAnalysisSL'
  1104. this.getList2()
  1105. this.getList3()
  1106. this.getList4()
  1107. this.getChart1()
  1108. }
  1109. },
  1110. // 过程详情
  1111. getList2() {
  1112. this.table2.listLoading = false
  1113. GetDataByName(this.table2.getdataListParm).then(response => {
  1114. console.log('过程详情table数据', response.data.list)
  1115. if (response.data.list !== null) {
  1116. this.table2.list = response.data.list
  1117. } else {
  1118. this.table2.list = []
  1119. }
  1120. setTimeout(() => {
  1121. this.table2.listLoading = false
  1122. }, 100)
  1123. })
  1124. },
  1125. // 混料详情
  1126. getList3() {
  1127. this.table3.listLoading = false
  1128. GetDataByName(this.table3.getdataListParm).then(response => {
  1129. console.log('混料详情table数据', response.data.list)
  1130. if (response.data.list !== null) {
  1131. this.table3.list = response.data.list
  1132. } else {
  1133. this.table3.list = []
  1134. }
  1135. setTimeout(() => {
  1136. this.table3.listLoading = false
  1137. }, 100)
  1138. })
  1139. },
  1140. // 撒料详情
  1141. getList4() {
  1142. this.table4.listLoading = false
  1143. GetDataByName(this.table4.getdataListParm).then(response => {
  1144. console.log('撒料详情table数据', response.data.list)
  1145. if (response.data.list !== null) {
  1146. this.table4.list = response.data.list
  1147. this.rowspan()
  1148. } else {
  1149. this.table4.list = []
  1150. }
  1151. setTimeout(() => {
  1152. this.table4.listLoading = false
  1153. }, 100)
  1154. })
  1155. },
  1156. rowspan() {
  1157. this.spanArr = []
  1158. this.table4.list.forEach((item, index) => {
  1159. if (index == 0) {
  1160. this.spanArr.push(1)
  1161. this.position = 0
  1162. } else {
  1163. console.log(item, index, '======')
  1164. if (this.table4.list[index].aweight == this.table4.list[index - 1].aweight) {
  1165. this.spanArr[this.position] += 1
  1166. this.spanArr.push(0)
  1167. } else {
  1168. this.spanArr.push(1)
  1169. this.position = index
  1170. }
  1171. }
  1172. })
  1173. },
  1174. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  1175. if (columnIndex == 4) {
  1176. const _row = this.spanArr[rowIndex]
  1177. const _col = _row > 0 ? 1 : 0
  1178. return {
  1179. rowspan: _row,
  1180. colspan: _col
  1181. }
  1182. }
  1183. },
  1184. getChart1() {
  1185. this.chart1.listLoading = true
  1186. GetReportform(this.chart1.getdataListParm).then(response => {
  1187. if (response.data.list !== null) {
  1188. this.chart1.list = response.data.data
  1189. console.log('实时监控', response.data.list)
  1190. // console.log('实时监控', response.data.list.data4)
  1191. var evenNumbers = []// 偶数
  1192. var oddNumbers = []// 奇数
  1193. for (let i = 0; i < response.data.list.data4.length; i++) {
  1194. console.log(response.data.list.data4[i])
  1195. if (i == 0) {
  1196. oddNumbers.push(response.data.list.data4[i])
  1197. } else {
  1198. if (i % 2 == 0) {
  1199. evenNumbers.push(response.data.list.data4[i])
  1200. } else {
  1201. oddNumbers.push(response.data.list.data4[i])
  1202. }
  1203. }
  1204. }
  1205. response.data.list.data4 = oddNumbers
  1206. response.data.list.data5 = evenNumbers
  1207. this.chart1.chartLine_data = response.data.list
  1208. this.chart1.total = response.data.total
  1209. this.roadChartLine1(this.chart1.chartLine_data)
  1210. } else {
  1211. this.chart1.list = []
  1212. }
  1213. setTimeout(() => {
  1214. this.chart1.listLoading = false
  1215. }, 100)
  1216. })
  1217. },
  1218. roadChartLine1(chartLine_data) {
  1219. if (this.chartLine != null) {
  1220. this.chartLine.dispose()
  1221. }
  1222. this.chartLine = echarts.init(document.getElementById('chartLine'))
  1223. var option = {
  1224. title: {
  1225. text: '',
  1226. subtext: ''
  1227. },
  1228. color: ['#ff3131', '#61a5e8', '#ff3131', '#61a5e8'], // 关键加上这句话,legend的颜色和折线的自定义颜色就一致了
  1229. legend: {
  1230. data: [
  1231. { name: '设计重量', icon: 'rectangle' },
  1232. { name: '实际重量', icon: 'rectangle' },
  1233. { name: '开始重量', icon: 'triangle' },
  1234. { name: '结束重量', icon: 'triangle' }
  1235. ],
  1236. right: '20%',
  1237. textStyle: {
  1238. fontSize: 12,
  1239. color: '#666'
  1240. }
  1241. },
  1242. tooltip: {
  1243. trigger: 'axis'
  1244. },
  1245. calculable: true,
  1246. yAxis: [
  1247. {
  1248. type: 'value',
  1249. name: '重量(kg)',
  1250. splitLine: { show: false }, // 去除网格线
  1251. axisLabel: {
  1252. show: true,
  1253. textStyle: {
  1254. color: '#666' // 这里用参数代替了
  1255. }
  1256. }
  1257. }
  1258. ],
  1259. xAxis: [
  1260. {
  1261. type: 'category',
  1262. splitLine: { show: false }, // 去除网格线
  1263. name: '时间',
  1264. data: chartLine_data.data1,
  1265. axisLabel: {
  1266. show: true,
  1267. textStyle: {
  1268. color: '#666' // 这里用参数代替了
  1269. }
  1270. }
  1271. }
  1272. ],
  1273. series: [{
  1274. symbol: 'none',
  1275. name: '实际重量',
  1276. type: 'line',
  1277. // step: 'end',
  1278. data: chartLine_data.data3,
  1279. smooth: true,
  1280. barWidth: '37',
  1281. itemStyle: {
  1282. normal: {
  1283. lineStyle: { color: '#ff3131' }
  1284. }
  1285. }
  1286. }, {
  1287. symbol: 'none',
  1288. name: '设计重量',
  1289. type: 'line',
  1290. barWidth: '37',
  1291. data: chartLine_data.data2,
  1292. itemStyle: {
  1293. normal: {
  1294. lineStyle: { color: '#61a5e8' }
  1295. }
  1296. }
  1297. }, {
  1298. name: '开始重量',
  1299. symbol: 'triangle',
  1300. symbolSize: 10,
  1301. type: 'scatter',
  1302. data: chartLine_data.data4
  1303. }, {
  1304. name: '结束重量',
  1305. symbol: 'triangle',
  1306. symbolSize: 10,
  1307. type: 'scatter',
  1308. data: chartLine_data.data5
  1309. }]
  1310. }
  1311. this.chartLine.setOption(option)
  1312. window.onresize = function() {
  1313. this.chartLine.resize()
  1314. }
  1315. }
  1316. }
  1317. }
  1318. </script>
  1319. <style lang="scss" scoped>
  1320. .search{padding-top:10px;clear: both;}
  1321. .table{margin-top:10px;}
  1322. .detail{
  1323. height:84px;border: 1px solid #EBEEF5;padding-left:10px;font:16px/32px '';color:#333;
  1324. .detail-t{margin-top: 10px;}
  1325. .detail-b{margin-bottom: 10px;}
  1326. }
  1327. </style>