1953aa0ffe06d20942d20b3e6e64a194aa671488.svn-base 53 KB

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