index.vue 56 KB

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