f35bc67d03cf4ba8014e845b417ad72290faa5de.svn-base 44 KB

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