c5649e529b32442cb57371ff62e0f4ebcad2e398.svn-base 40 KB

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