bc0e28dabbbdb97d9e31430ac170bc6683902820.svn-base 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170
  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. startTime: '2021-07-07',
  538. stopTime: '2021-07-07',
  539. inputDatetime: ['2021-07-07', '2021-07-07'],
  540. iscompleted: '',
  541. tmrtname: '',
  542. lpplantype: ''
  543. }
  544. },
  545. tableKey: 0,
  546. list: [],
  547. total: 0,
  548. listLoading: true
  549. },
  550. // 过程详情
  551. table2: {
  552. getdataListParm: {
  553. name: 'getprocessAnalysisStr',
  554. page: 1,
  555. offset: 1,
  556. pagecount: 1,
  557. returntype: 'Map',
  558. parammaps: {
  559. pastureid: Cookies.get('pastureid'),
  560. id: ''
  561. }
  562. },
  563. tableKey: 0,
  564. list: [],
  565. total: 0,
  566. listLoading: true
  567. },
  568. // 混料详情
  569. table3: {
  570. getdataListParm: {
  571. name: 'getprocessAnalysisHL',
  572. page: 1,
  573. offset: 1,
  574. pagecount: '',
  575. returntype: 'Map',
  576. parammaps: {
  577. pastureid: Cookies.get('pastureid'),
  578. id: ''
  579. }
  580. },
  581. tableKey: 0,
  582. list: [],
  583. total: 0,
  584. listLoading: true
  585. },
  586. // 撒料详情
  587. table4: {
  588. getdataListParm: {
  589. name: 'getprocessAnalysisSL',
  590. page: 1,
  591. offset: 1,
  592. pagecount: '',
  593. returntype: 'Map',
  594. parammaps: {
  595. pastureid: Cookies.get('pastureid'),
  596. id: ''
  597. }
  598. },
  599. tableKey: 0,
  600. list: [],
  601. total: 0,
  602. listLoading: true
  603. },
  604. chart1: {
  605. getdataListParm: {
  606. name: 'getprocessAnalysisTB',
  607. page: 1,
  608. offset: 1,
  609. pagecount: '',
  610. returntype: 'Map',
  611. parammaps: {
  612. pastureid: Cookies.get('pastureid'),
  613. id: ''
  614. }
  615. },
  616. tableKey: 0,
  617. list: [],
  618. total: 0,
  619. listLoading: false,
  620. chartLine_data: []
  621. },
  622. chartLine: null,
  623. chartLine_data: {},
  624. chartName: '',
  625. rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
  626. cellStyle: { padding: 0 + 'px' }
  627. }
  628. },
  629. created() {
  630. this.getList()
  631. },
  632. methods: {
  633. // TMR设备列表
  634. getList() {
  635. this.table.listLoading = true
  636. GetDataByName(this.table.getdataListParm).then(response => {
  637. console.log('TMR设备列表table数据', response.data.list)
  638. if (response.data.list !== null) {
  639. this.table.list = response.data.list
  640. this.table.total = response.data.total
  641. if (response.data.list[0].lpplantype == '预混计划') {
  642. this.isPremixedPlan = true
  643. this.isSpreadingPlan = false
  644. this.isResidualMaterialPlan = false
  645. this.isSpreadingPlanSH = false
  646. this.isSpreadingPlanSS = false
  647. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  648. this.table2.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  649. this.table3.getdataListParm.parammaps.pid = response.data.list[0].id
  650. this.table3.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  651. this.getList2()
  652. this.getList3()
  653. } else if (response.data.list[0].lpplantype == '剩料计划') {
  654. this.isResidualMaterialPlan = true
  655. this.isPremixedPlan = false
  656. this.isSpreadingPlan = false
  657. this.isSpreadingPlanSH = false
  658. this.isSpreadingPlanSS = false
  659. this.table2.getdataListParm.name = 'getprocessAnalysisStrSH'
  660. this.table3.getdataListParm.name = 'getprocessAnalysisHLSH'
  661. this.table4.getdataListParm.name = 'getprocessAnalysisSLSH'
  662. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  663. this.table2.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  664. this.table3.getdataListParm.parammaps.pid = response.data.list[0].id
  665. this.table3.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  666. this.table4.getdataListParm.parammaps.pid = response.data.list[0].id
  667. this.table4.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  668. this.getList2()
  669. this.getList3()
  670. this.getList4()
  671. } else if (response.data.list[0].lpplantype == '撒料计划-混料') {
  672. // 撒料计划-混料
  673. this.isSpreadingPlan = false
  674. this.isResidualMaterialPlan = false
  675. this.isPremixedPlan = false
  676. this.isSpreadingPlanSH = true
  677. this.isSpreadingPlanSS = false
  678. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  679. this.table2.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  680. this.table3.getdataListParm.parammaps.pid = response.data.list[0].id
  681. this.table3.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  682. this.table4.getdataListParm.parammaps.pid = response.data.list[0].id
  683. this.table4.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  684. this.getList2()
  685. this.getList3()
  686. this.getList4()
  687. this.chart1.getdataListParm.parammaps.pid = response.data.list[0].id
  688. this.chart1.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  689. this.getChart1()
  690. } else if (response.data.list[0].lpplantype == '撒料计划-撒料') {
  691. // 撒料计划-撒料
  692. this.isSpreadingPlan = false
  693. this.isResidualMaterialPlan = false
  694. this.isPremixedPlan = false
  695. this.isSpreadingPlanSH = false
  696. this.isSpreadingPlanSS = true
  697. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  698. this.table2.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  699. this.table3.getdataListParm.parammaps.pid = response.data.list[0].id
  700. this.table3.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  701. this.table4.getdataListParm.parammaps.pid = response.data.list[0].id
  702. this.table4.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  703. this.getList2()
  704. this.getList3()
  705. this.getList4()
  706. this.chart1.getdataListParm.parammaps.pid = response.data.list[0].id
  707. this.chart1.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  708. this.getChart1()
  709. } else if (response.data.list[0].lpplantype == '预称重计划') {
  710. // 撒料计划-混料
  711. this.isSpreadingPlan = false
  712. this.isResidualMaterialPlan = false
  713. this.isPremixedPlan = false
  714. this.isSpreadingPlanSH = true
  715. this.isSpreadingPlanSS = false
  716. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  717. this.table2.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  718. this.table3.getdataListParm.parammaps.pid = response.data.list[0].id
  719. this.table3.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  720. this.table4.getdataListParm.parammaps.pid = response.data.list[0].id
  721. this.table4.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  722. this.getList2()
  723. this.getList3()
  724. this.getList4()
  725. this.chart1.getdataListParm.parammaps.pid = response.data.list[0].id
  726. this.chart1.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  727. this.getChart1()
  728. } else {
  729. // 撒料
  730. this.isSpreadingPlan = true
  731. this.isResidualMaterialPlan = false
  732. this.isPremixedPlan = false
  733. this.isSpreadingPlanSH = false
  734. this.isSpreadingPlanSS = false
  735. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  736. this.table2.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  737. this.table3.getdataListParm.parammaps.pid = response.data.list[0].id
  738. this.table3.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  739. this.table4.getdataListParm.parammaps.pid = response.data.list[0].id
  740. this.table4.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  741. this.getList2()
  742. this.getList3()
  743. this.getList4()
  744. this.chart1.getdataListParm.parammaps.pid = response.data.list[0].id
  745. this.chart1.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
  746. this.getChart1()
  747. }
  748. this.title = response.data.list[0].lpplantype
  749. } else {
  750. this.table.list = []
  751. this.table2.list = []
  752. this.table3.list = []
  753. this.table2.listLoading = false
  754. this.table3.listLoading = false
  755. this.table4.listLoading = false
  756. this.chart1.listLoading = false
  757. }
  758. setTimeout(() => {
  759. this.table.listLoading = false
  760. }, 100)
  761. })
  762. },
  763. handleSearch() {
  764. console.log('点击了查询')
  765. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  766. this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  767. this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  768. } else {
  769. this.table.getdataListParm.parammaps.inputDatetime = ''
  770. this.table.getdataListParm.parammaps.startTime = ''
  771. this.table.getdataListParm.parammaps.stopTime = ''
  772. }
  773. this.table.getdataListParm.offset = 1
  774. this.getList()
  775. },
  776. handleRefresh() {
  777. console.log('点击了重置')
  778. this.table.getdataListParm.parammaps.tmrtname = ''
  779. this.table.getdataListParm.parammaps.iscompleted = ''
  780. this.table.getdataListParm.parammaps.lpplantype = ''
  781. this.table.getdataListParm.parammaps.startTime = parseTime(new Date(), '{y}-{m}-{d}')
  782. this.table.getdataListParm.parammaps.stopTime = parseTime(new Date(), '{y}-{m}-{d}')
  783. this.table.getdataListParm.parammaps.inputDatetime = [new Date(), new Date()]
  784. this.table.getdataListParm.offset = 1
  785. this.getList()
  786. },
  787. handleBefore() {
  788. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  789. var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
  790. var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
  791. if (stop > Date.now()) {
  792. this.Nextdisabled = true
  793. this.Beforedisabled = false
  794. } else {
  795. this.Nextdisabled = false
  796. this.Beforedisabled = false
  797. }
  798. this.table.getdataListParm.parammaps.inputDatetime.length = 0
  799. this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
  800. this.$forceUpdate()
  801. }
  802. this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  803. this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  804. this.getList()
  805. },
  806. handleNext() {
  807. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  808. var start2 = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
  809. var stop2 = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
  810. // console.log(stop2)
  811. // console.log(Date.now() + 8.64e7)
  812. // console.log(stop2 > Date.now() + 8.64e7)
  813. if (stop2 > Date.now()) {
  814. this.Nextdisabled = true
  815. this.Beforedisabled = false
  816. } else {
  817. this.Nextdisabled = false
  818. this.Beforedisabled = false
  819. }
  820. this.table.getdataListParm.parammaps.inputDatetime.length = 0
  821. this.table.getdataListParm.parammaps.inputDatetime.push(start2, stop2)
  822. this.$forceUpdate()
  823. }
  824. this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  825. this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  826. this.getList()
  827. },
  828. rowClick(row, column, event) {
  829. this.table2.getdataListParm.parammaps.id = row.id
  830. this.table3.getdataListParm.parammaps.pid = row.id
  831. this.table4.getdataListParm.parammaps.pid = row.id
  832. this.chart1.getdataListParm.parammaps.pid = row.id
  833. this.chartName = row.tmrtname
  834. if (row.lpplantype == '预混计划') {
  835. this.isPremixedPlan = true
  836. this.isResidualMaterialPlan = false
  837. this.isSpreadingPlan = false
  838. this.isSpreadingPlanSH = false
  839. this.isSpreadingPlanSS = false
  840. this.table2.getdataListParm.name = 'getprocessAnalysisStr'
  841. this.table3.getdataListParm.name = 'getprocessAnalysisHL'
  842. this.table2.getdataListParm.parammaps.pastureid = row.pastureid
  843. this.table3.getdataListParm.parammaps.pastureid = row.pastureid
  844. this.getList2()
  845. this.getList3()
  846. } else if (row.lpplantype == '剩料计划') {
  847. this.isResidualMaterialPlan = true
  848. this.isPremixedPlan = false
  849. this.isSpreadingPlan = false
  850. this.isSpreadingPlanSH = false
  851. this.isSpreadingPlanSS = false
  852. this.table2.getdataListParm.name = 'getprocessAnalysisStrSH'
  853. this.table3.getdataListParm.name = 'getprocessAnalysisHLSH'
  854. this.table4.getdataListParm.name = 'getprocessAnalysisSLSH'
  855. this.table2.getdataListParm.parammaps.pastureid = row.pastureid
  856. this.table3.getdataListParm.parammaps.pastureid = row.pastureid
  857. this.table4.getdataListParm.parammaps.pastureid = row.pastureid
  858. this.getList2()
  859. this.getList3()
  860. this.getList4()
  861. } else if (row.lpplantype == '撒料计划-混料') {
  862. this.isSpreadingPlan = false
  863. this.isPremixedPlan = false
  864. this.isResidualMaterialPlan = false
  865. this.isSpreadingPlanSH = true
  866. this.isSpreadingPlanSS = false
  867. this.table2.getdataListParm.name = 'getprocessAnalysisStr'
  868. this.table3.getdataListParm.name = 'getprocessAnalysisHL'
  869. this.table4.getdataListParm.name = 'getprocessAnalysisSL'
  870. this.table2.getdataListParm.parammaps.pastureid = row.pastureid
  871. this.table3.getdataListParm.parammaps.pastureid = row.pastureid
  872. this.table4.getdataListParm.parammaps.pastureid = row.pastureid
  873. this.chart1.getdataListParm.parammaps.pastureid = row.pastureid
  874. this.getList2()
  875. this.getList3()
  876. this.getList4()
  877. this.getChart1()
  878. } else if (row.lpplantype == '撒料计划-撒料') {
  879. this.isSpreadingPlan = false
  880. this.isPremixedPlan = false
  881. this.isResidualMaterialPlan = false
  882. this.isSpreadingPlanSH = false
  883. this.isSpreadingPlanSS = true
  884. this.table2.getdataListParm.name = 'getprocessAnalysisStr'
  885. this.table3.getdataListParm.name = 'getprocessAnalysisHL'
  886. this.table4.getdataListParm.name = 'getprocessAnalysisSL'
  887. this.table2.getdataListParm.parammaps.pastureid = row.pastureid
  888. this.table3.getdataListParm.parammaps.pastureid = row.pastureid
  889. this.table4.getdataListParm.parammaps.pastureid = row.pastureid
  890. this.chart1.getdataListParm.parammaps.pastureid = row.pastureid
  891. this.getList2()
  892. this.getList3()
  893. this.getList4()
  894. this.getChart1()
  895. } else if (row.lpplantype == '预称重计划') {
  896. this.isSpreadingPlan = false
  897. this.isPremixedPlan = false
  898. this.isResidualMaterialPlan = false
  899. this.isSpreadingPlanSH = true
  900. this.isSpreadingPlanSS = false
  901. this.table2.getdataListParm.name = 'getprocessAnalysisStr'
  902. this.table3.getdataListParm.name = 'getprocessAnalysisHL'
  903. this.table4.getdataListParm.name = 'getprocessAnalysisSL'
  904. this.table2.getdataListParm.parammaps.pastureid = row.pastureid
  905. this.table3.getdataListParm.parammaps.pastureid = row.pastureid
  906. this.table4.getdataListParm.parammaps.pastureid = row.pastureid
  907. this.chart1.getdataListParm.parammaps.pastureid = row.pastureid
  908. this.getList2()
  909. this.getList3()
  910. this.getList4()
  911. this.getChart1()
  912. } else {
  913. this.isSpreadingPlan = true
  914. this.isPremixedPlan = false
  915. this.isResidualMaterialPlan = false
  916. this.isSpreadingPlanSH = false
  917. this.isSpreadingPlanSS = false
  918. this.table2.getdataListParm.name = 'getprocessAnalysisStr'
  919. this.table3.getdataListParm.name = 'getprocessAnalysisHL'
  920. this.table4.getdataListParm.name = 'getprocessAnalysisSL'
  921. this.table2.getdataListParm.parammaps.pastureid = row.pastureid
  922. this.table3.getdataListParm.parammaps.pastureid = row.pastureid
  923. this.table4.getdataListParm.parammaps.pastureid = row.pastureid
  924. this.chart1.getdataListParm.parammaps.pastureid = row.pastureid
  925. this.getList2()
  926. this.getList3()
  927. this.getList4()
  928. this.getChart1()
  929. }
  930. this.title = '' + row.lpplantype
  931. },
  932. // 过程详情
  933. getList2() {
  934. this.table2.listLoading = false
  935. GetDataByName(this.table2.getdataListParm).then(response => {
  936. console.log('过程详情table数据', response.data.list)
  937. if (response.data.list !== null) {
  938. this.table2.list = response.data.list
  939. } else {
  940. this.table2.list = []
  941. }
  942. setTimeout(() => {
  943. this.table2.listLoading = false
  944. }, 100)
  945. })
  946. },
  947. // 混料详情
  948. getList3() {
  949. this.table3.listLoading = false
  950. GetDataByName(this.table3.getdataListParm).then(response => {
  951. console.log('混料详情table数据', response.data.list)
  952. if (response.data.list !== null) {
  953. this.table3.list = response.data.list
  954. var sumlweight = 0
  955. var sumactualweightminus = 0
  956. var sumsweight = 0
  957. var sumproesstime = ''
  958. for (let i = 0; i < response.data.list.length; i++) {
  959. if (response.data.list[i].lweight == undefined) { response.data.list[i].lweight = 0 }
  960. if (response.data.list[i].actualweightminus == undefined) { response.data.list[i].actualweightminus = 0 }
  961. if (response.data.list[i].sweight == undefined) { response.data.list[i].sweight = 0 }
  962. sumlweight += parseFloat(response.data.list[i].lweight)
  963. sumactualweightminus += parseFloat(response.data.list[i].actualweightminus)
  964. sumsweight += parseFloat(response.data.list[i].sweight)
  965. sumproesstime = response.data.list[0].sumproesstime
  966. }
  967. sumlweight = formatNum(sumlweight, 2)
  968. sumactualweightminus = formatNum(sumactualweightminus, 2)
  969. sumsweight = formatNum(sumsweight, 2)
  970. this.table3.list.push({ 'sort': '合计', 'lweight': sumlweight, 'actualweightminus': sumactualweightminus, 'sweight': sumsweight, 'proesstime': sumproesstime })
  971. } else {
  972. this.table3.list = []
  973. }
  974. setTimeout(() => {
  975. this.table3.listLoading = false
  976. }, 100)
  977. })
  978. },
  979. // 撒料详情
  980. getList4() {
  981. this.table4.listLoading = false
  982. GetDataByName(this.table4.getdataListParm).then(response => {
  983. console.log('撒料详情table数据', response.data.list)
  984. if (response.data.list !== null) {
  985. this.table4.list = response.data.list
  986. var sumlweight = 0
  987. var sumactualweightminus = 0
  988. var sumsweight = 0
  989. var sumproesstime = ''
  990. for (let i = 0; i < response.data.list.length; i++) {
  991. if (response.data.list[i].lweight == undefined) { response.data.list[i].lweight = 0 }
  992. if (response.data.list[i].actualweightminus == undefined) { response.data.list[i].actualweightminus = 0 }
  993. if (response.data.list[i].sweight == undefined) { response.data.list[i].sweight = 0 }
  994. sumlweight += parseFloat(response.data.list[i].lweight)
  995. sumactualweightminus += parseFloat(response.data.list[i].actualweightminus)
  996. sumsweight += parseFloat(response.data.list[i].sweight)
  997. sumproesstime = response.data.list[0].sumproesstime
  998. }
  999. sumlweight = formatNum(sumlweight, 2)
  1000. sumactualweightminus = formatNum(sumactualweightminus, 2)
  1001. sumsweight = formatNum(sumsweight, 2)
  1002. this.table4.list.push({ 'sort': '合计', 'lweight': sumlweight, 'actualweightminus': sumactualweightminus, 'sweight': sumsweight, 'proesstime': sumproesstime })
  1003. this.rowspan()
  1004. } else {
  1005. this.table4.list = []
  1006. }
  1007. setTimeout(() => {
  1008. this.table4.listLoading = false
  1009. }, 100)
  1010. })
  1011. },
  1012. rowspan() {
  1013. this.spanArr = []
  1014. this.table4.list.forEach((item, index) => {
  1015. if (index == 0) {
  1016. this.spanArr.push(1)
  1017. this.position = 0
  1018. } else {
  1019. console.log(item, index, '======')
  1020. if (this.table4.list[index].aweight == this.table4.list[index - 1].aweight) {
  1021. this.spanArr[this.position] += 1
  1022. this.spanArr.push(0)
  1023. } else {
  1024. this.spanArr.push(1)
  1025. this.position = index
  1026. }
  1027. }
  1028. })
  1029. },
  1030. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  1031. if (columnIndex == 4) {
  1032. const _row = this.spanArr[rowIndex]
  1033. const _col = _row > 0 ? 1 : 0
  1034. return {
  1035. rowspan: _row,
  1036. colspan: _col
  1037. }
  1038. }
  1039. },
  1040. getChart1() {
  1041. this.chart1.listLoading = true
  1042. GetReportform(this.chart1.getdataListParm).then(response => {
  1043. if (response.data.list !== null) {
  1044. // response.data.list = {
  1045. // 'data1': ['09:34:32', '09:34:46', '09:34:46', '09:34:50'],
  1046. // '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']],
  1047. // 'data3': [['09:34:32', '0', '栏舍:', '12'], ['09:34:46', '1724', '饲料', '22'], ['09:34:46', '1724', '栏舍:', '32'], ['09:34:50', '1', '饲料:', '42']],
  1048. // 'data4': [
  1049. // ['09:34:32', '0.00', '栏舍:', '12'],
  1050. // ['09:34:46', '1725.00', '栏舍:', '12'],
  1051. // ['09:34:46', '1725.00', '栏舍:', '12'],
  1052. // ['09:34:50', '1.00', '栏舍:', '12']
  1053. // ],
  1054. // 'data5': []
  1055. // }
  1056. this.chart1.list = response.data.data
  1057. // console.log('实时监控', response.data.list.data4)
  1058. console.log('实时监控', response.data.list)
  1059. var evenNumbers = []// 偶数
  1060. var oddNumbers = []// 奇数
  1061. for (let i = 0; i < response.data.list.data4.length; i++) {
  1062. console.log(response.data.list.data4[i])
  1063. if (i == 0) {
  1064. oddNumbers.push(response.data.list.data4[i])
  1065. } else {
  1066. if (i % 2 == 0) {
  1067. evenNumbers.push(response.data.list.data4[i])
  1068. } else {
  1069. oddNumbers.push(response.data.list.data4[i])
  1070. }
  1071. }
  1072. }
  1073. response.data.list.data4 = oddNumbers
  1074. response.data.list.data5 = evenNumbers
  1075. this.chart1.chartLine_data = response.data.list
  1076. this.chart1.total = response.data.total
  1077. this.roadChartLine1(this.chart1.chartLine_data)
  1078. } else {
  1079. this.chart1.list = []
  1080. }
  1081. setTimeout(() => {
  1082. this.chart1.listLoading = false
  1083. }, 100)
  1084. })
  1085. },
  1086. roadChartLine1(chartLine_data) {
  1087. console.log(chartLine_data, 'chartLine_data')
  1088. if (this.chartLine != null) {
  1089. this.chartLine.dispose()
  1090. }
  1091. this.chartLine = echarts.init(document.getElementById('chartLine'))
  1092. var option = {
  1093. title: { text: '', subtext: '' },
  1094. color: ['#38c193', '#5199e5', '#fdb06a', '#fb8b73'], // 关键加上这句话,legend的颜色和折线的自定义颜色就一致了
  1095. legend: [{
  1096. itemWidth: 15, itemHeight: 7, right: '25%', textStyle: { fontSize: 12 },
  1097. data: [{ name: '设计重量' }, { name: '实际重量' }]
  1098. }, {
  1099. itemWidth: 15, itemHeight: 15, right: '0', textStyle: { fontSize: 12 },
  1100. data: [{ name: '开始重量', icon: 'image://https://kptyun.cn:8081/file/pic/3.png' }, { name: '结束重量', icon: 'image://https://kptyun.cn:8081/file/pic/4.png' }]
  1101. }],
  1102. tooltip: {
  1103. trigger: 'axis',
  1104. formatter: function(params) {
  1105. // console.log(params, 'params')
  1106. var tip = params[0].name
  1107. for (let i = 0; i < params.length; i++) {
  1108. tip += '<br>' + params[i].seriesName + ': '
  1109. if (params[i].value[0] == params[0].name) {
  1110. tip += params[i].value[1]
  1111. } else {
  1112. tip += params[i].value
  1113. }
  1114. }
  1115. tip += '<br>' + params[0].data[2] + params[0].data[3]
  1116. console.log(tip, 'tip')
  1117. return tip
  1118. }
  1119. },
  1120. calculable: true,
  1121. xAxis: [
  1122. { type: 'category', splitLine: { show: false }, name: '时间', data: chartLine_data.data1, axisLabel: { show: true, textStyle: { color: '#666' }}}
  1123. ],
  1124. yAxis: [{ type: 'value' }],
  1125. series: [
  1126. { symbol: 'none', name: '实际重量', type: 'line', data: chartLine_data.data3, smooth: true, barWidth: '37', itemStyle: { normal: { lineStyle: { color: '#38c193' }}}},
  1127. { symbol: 'none', name: '设计重量', type: 'line', step: 'middle', data: chartLine_data.data2 },
  1128. { name: '开始重量', symbol: 'image://https://kptyun.cn:8081/file/pic/3.png', symbolSize: 10, type: 'scatter', data: chartLine_data.data4 },
  1129. { name: '结束重量', symbol: 'image://https://kptyun.cn:8081/file/pic/4.png', symbolSize: 10, type: 'scatter', data: chartLine_data.data5 }
  1130. ]
  1131. }
  1132. this.chartLine.setOption(option)
  1133. window.onresize = function() {
  1134. this.chartLine.resize()
  1135. }
  1136. }
  1137. }
  1138. }
  1139. </script>
  1140. <style lang="scss" scoped>
  1141. .search{padding-top:10px;clear: both;}
  1142. .table{margin-top:10px;}
  1143. .detail{
  1144. height:84px;padding:0 10px;font:16px/32px '';color:#333;background: #F9F9F9;display: flex; align-items: center;text-align: center;
  1145. div{
  1146. height: 15px;width: 20%;border-right: 1px solid #E0E0E0;color: #333;
  1147. b{line-height: 20px;font-size: 16px;display: block;margin-top: -10px;height: 20px;color: #009A69;}
  1148. span{font-size: 14px;}
  1149. }
  1150. div:last-child{border-right:none}
  1151. }
  1152. .title{height: 50px;line-height: 50px;}
  1153. </style>