index.vue 61 KB

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