901a056d95a3b97462f46980b4215facd578ac06.svn-base 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  1. <template>
  2. <div class="app-container">
  3. <div class="search">
  4. <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;" />
  5. <el-select v-model="table.getdataListParm.parammaps.pid" placeholder="计划类型" class="filter-item" style="width: 120px;" clearable>
  6. <el-option v-for="item in planTypeList" :key="item.id" :label="item.name" :value="item.id" />
  7. </el-select>
  8. <el-input v-model="table.getdataListParm.parammaps.tmrtname" placeholder="TMR名称" style="width: 180px;" class="filter-item" clearable />
  9. <el-select v-model="table.getdataListParm.parammaps.iscompleted" placeholder="工作状态" class="filter-item" style="width: 120px;" clearable>
  10. <el-option v-for="item in workingConditionList" :key="item.id" :label="item.name" :value="item.id" />
  11. </el-select>
  12. <el-button class="successBorder" @click="handleSearch">查询</el-button>
  13. <el-button class="successBorder" @click="handleRefresh">重置</el-button>
  14. </div>
  15. <el-row :gutter="20">
  16. <el-col :span="8">
  17. <h4>TMR设备列表</h4>
  18. <div class="table">
  19. <el-table
  20. :key="table.tableKey"
  21. v-loading="table.listLoading"
  22. element-loading-text="给我一点时间"
  23. :data="table.list"
  24. border
  25. fit
  26. highlight-current-row
  27. style="width: 100%;"
  28. :row-style="rowStyle"
  29. :cell-style="cellStyle"
  30. class="elTable table-fixed"
  31. height="970px"
  32. @row-click="rowClick"
  33. >
  34. <el-table-column label="开始时间" min-width="100px" align="center">
  35. <template slot-scope="scope">
  36. <span>{{ scope.row.intime }}</span>
  37. </template>
  38. </el-table-column>
  39. <el-table-column label="计划类型" min-width="90px" align="center">
  40. <template slot-scope="scope">
  41. <span>{{ scope.row.lpplantype }}</span>
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="描述" min-width="90px" align="center">
  45. <template slot-scope="scope">
  46. <span>{{ scope.row.remark }}</span>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="TMR名称" min-width="110px" align="center">
  50. <template slot-scope="scope">
  51. <span>{{ scope.row.tmrtname }}</span>
  52. </template>
  53. </el-table-column>
  54. </el-table>
  55. </div>
  56. </el-col>
  57. <el-col :span="16">
  58. <h4>过程详情</h4>
  59. <div class="detail">
  60. <div class="detail-t">
  61. 过程时间:<span v-if="table2.list.length !== 0">{{ table2.list[0].proesstime }}</span>;
  62. 工作状态:<span v-if="table2.list.length !== 0">{{ table2.list[0].iscompleted }}</span>
  63. </div>
  64. <div class="detail-b">
  65. 混料误差值:<span v-if="table2.list.length !== 0">{{ table2.list[0].Hdif }}kg</span>;
  66. 混料准确率:<span v-if="table2.list.length !== 0">{{ table2.list[0].HdifRate }}</span>;
  67. 撒料误差值:<span v-if="table2.list.length !== 0">{{ table2.list[0].Sdif }}kg</span>;
  68. 撒料准确率:<span v-if="table2.list.length !== 0">{{ table2.list[0].SdifRate }}</span>
  69. </div>
  70. </div>
  71. <div class="Mixture">
  72. <h4>混料详情</h4>
  73. <el-table
  74. :key="table3.tableKey"
  75. v-loading="table3.listLoading"
  76. element-loading-text="给我一点时间"
  77. :data="table3.list"
  78. border
  79. fit
  80. highlight-current-row
  81. style="width: 100%;"
  82. :row-style="rowStyle"
  83. :cell-style="cellStyle"
  84. class="elTable table-fixed"
  85. height="200px"
  86. >
  87. <el-table-column label="操作编号" min-width="110px" align="center">
  88. <template slot-scope="scope">
  89. <span>{{ scope.row.sort }}</span>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="饲料名称" min-width="90px" align="center">
  93. <template slot-scope="scope">
  94. <span>{{ scope.row.fname }}</span>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="计划重量" min-width="110px" align="center">
  98. <template slot-scope="scope">
  99. <span>{{ scope.row.lweight }}</span>
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="实际重量" min-width="110px" align="center">
  103. <template slot-scope="scope">
  104. <span>{{ scope.row.actualweightminus }}</span>
  105. </template>
  106. </el-table-column>
  107. <el-table-column label="误差值" min-width="110px" align="center">
  108. <template slot-scope="scope">
  109. <span>{{ scope.row.diff }}</span>
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="准确率" min-width="90px" align="center">
  113. <template slot-scope="scope">
  114. <span>{{ scope.row.diffRate }}</span>
  115. </template>
  116. </el-table-column>
  117. <el-table-column label="完成时间" min-width="110px" align="center">
  118. <template slot-scope="scope">
  119. <span>{{ scope.row.intime }}</span>
  120. </template>
  121. </el-table-column>
  122. <el-table-column label="过程时间" min-width="110px" align="center">
  123. <template slot-scope="scope">
  124. <span>{{ scope.row.proesstime }}</span>
  125. </template>
  126. </el-table-column>
  127. <el-table-column label="跳转方式" min-width="110px" align="center">
  128. <template slot-scope="scope">
  129. <span>{{ scope.row.buttontype }}</span>
  130. </template>
  131. </el-table-column>
  132. <el-table-column label="开始重量" min-width="110px" align="center">
  133. <template slot-scope="scope">
  134. <span>{{ scope.row.lastactualweight }}</span>
  135. </template>
  136. </el-table-column>
  137. <el-table-column label="结束重量" min-width="110px" align="center">
  138. <template slot-scope="scope">
  139. <span>{{ scope.row.actualweight }}</span>
  140. </template>
  141. </el-table-column>
  142. </el-table>
  143. </div>
  144. <div class="SpreadingMaterials">
  145. <h4>撒料详情</h4>
  146. <el-table
  147. :key="table4.tableKey"
  148. v-loading="table4.listLoading"
  149. element-loading-text="给我一点时间"
  150. :data="table4.list"
  151. border
  152. fit
  153. highlight-current-row
  154. style="width: 100%;"
  155. :row-style="rowStyle"
  156. :cell-style="cellStyle"
  157. class="elTable table-fixed"
  158. height="200px"
  159. >
  160. <el-table-column label="操作编号" min-width="110px" align="center">
  161. <template slot-scope="scope">
  162. <span>{{ scope.row.sort }}</span>
  163. </template>
  164. </el-table-column>
  165. <el-table-column label="栏舍名称" min-width="90px" align="center">
  166. <template slot-scope="scope">
  167. <span>{{ scope.row.fname }}</span>
  168. </template>
  169. </el-table-column>
  170. <el-table-column label="计划重量" min-width="110px" align="center">
  171. <template slot-scope="scope">
  172. <span>{{ scope.row.lweight }}</span>
  173. </template>
  174. </el-table-column>
  175. <el-table-column label="实际重量" min-width="110px" align="center">
  176. <template slot-scope="scope">
  177. <span>{{ scope.row.actualweightminus }}</span>
  178. </template>
  179. </el-table-column>
  180. <el-table-column label="误差值" min-width="110px" align="center">
  181. <template slot-scope="scope">
  182. <span>{{ scope.row.diff }}</span>
  183. </template>
  184. </el-table-column>
  185. <el-table-column label="准确率" min-width="90px" align="center">
  186. <template slot-scope="scope">
  187. <span>{{ scope.row.diffRate }}</span>
  188. </template>
  189. </el-table-column>
  190. <el-table-column label="完成时间" min-width="110px" align="center">
  191. <template slot-scope="scope">
  192. <span>{{ scope.row.intime }}</span>
  193. </template>
  194. </el-table-column>
  195. <el-table-column label="过程时间" min-width="110px" align="center">
  196. <template slot-scope="scope">
  197. <span>{{ scope.row.proesstime }}</span>
  198. </template>
  199. </el-table-column>
  200. <el-table-column label="跳转方式" min-width="110px" align="center">
  201. <template slot-scope="scope">
  202. <span>{{ scope.row.buttontype }}</span>
  203. </template>
  204. </el-table-column>
  205. <el-table-column label="开始重量" min-width="110px" align="center">
  206. <template slot-scope="scope">
  207. <span>{{ scope.row.lastactualweight }}</span>
  208. </template>
  209. </el-table-column>
  210. <el-table-column label="结束重量" min-width="110px" align="center">
  211. <template slot-scope="scope">
  212. <span>{{ scope.row.actualweight }}</span>
  213. </template>
  214. </el-table-column>
  215. </el-table>
  216. </div>
  217. <div class="ControlChart">
  218. <h4>监控图</h4>
  219. <div style="font-size:14px;color:#666;margin:0 auto;position: relative;">
  220. <span style="line-height:30px;position:absolute;right:190px"><i class="el-icon-caret-top" style="color:#ff2d2d;line-height:30px;font-size:30px;" /><b style="line-height:32px;">开始重量</b></span>
  221. <span style="line-height:30px;position:absolute;right:100px"><i class="el-icon-caret-top" style="color:#61a5e8;line-height:30px;font-size:30px;" /><b style="line-height:32px;">结束重量</b></span>
  222. </div>
  223. <div id="chartLine" style="width: 100%;height:300px;" /></div>
  224. </el-col>
  225. </el-row>
  226. </div>
  227. </template>
  228. <script>
  229. import echarts from 'echarts'
  230. require('echarts/theme/macarons')
  231. import { GetDataByName,GetReportform } from '@/api/common'
  232. import Cookies from 'js-cookie'
  233. import { parseTime } from '@/utils/index.js'
  234. export default {
  235. name: 'ProcessAnalysis',
  236. data() {
  237. return {
  238. requestParams: [
  239. { name: 'getBarListEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }},
  240. { name: 'getCowclassListEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }}
  241. ],
  242. planTypeList: [{ id: '3', name: '预混计划' }, { id: '2', name: '撒料计划' }, { id: '4', name: '剩料计划' }], // 计划类型
  243. workingConditionList: [{ id: '0', name: '运行中' }, { id: '1', name: '已完成' }], // 工作状态
  244. // TMR设备列表
  245. table: {
  246. getdataListParm: {
  247. name: 'getprocessAnalysis',
  248. page: 1,
  249. offset: 1,
  250. pagecount: '',
  251. returntype: 'Map',
  252. parammaps: {
  253. pastureid: Cookies.get('pastureid'),
  254. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  255. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  256. // startTime: '2020-09-15',
  257. // stopTime: '2020-09-16',
  258. inputDatetime: [new Date(), new Date()],
  259. iscompleted: '',
  260. tmrtname: ''
  261. }
  262. },
  263. tableKey: 0,
  264. list: [],
  265. total: 0,
  266. listLoading: true
  267. },
  268. // 过程详情
  269. table2: {
  270. getdataListParm: {
  271. name: 'getprocessAnalysisStr',
  272. page: 1,
  273. offset: 1,
  274. pagecount: 1,
  275. returntype: 'Map',
  276. parammaps: {
  277. pastureid: Cookies.get('pastureid'),
  278. id: ''
  279. }
  280. },
  281. tableKey: 0,
  282. list: [],
  283. total: 0,
  284. listLoading: true
  285. },
  286. // 混料详情
  287. table3: {
  288. getdataListParm: {
  289. name: 'getprocessAnalysisHL',
  290. page: 1,
  291. offset: 1,
  292. pagecount: '',
  293. returntype: 'Map',
  294. parammaps: {
  295. pastureid: Cookies.get('pastureid'),
  296. pid: ''
  297. }
  298. },
  299. tableKey: 0,
  300. list: [],
  301. total: 0,
  302. listLoading: true
  303. },
  304. // 撒料详情
  305. table4: {
  306. getdataListParm: {
  307. name: 'getprocessAnalysisSL',
  308. page: 1,
  309. offset: 1,
  310. pagecount: '',
  311. returntype: 'Map',
  312. parammaps: {
  313. pastureid: Cookies.get('pastureid'),
  314. pid: ''
  315. }
  316. },
  317. tableKey: 0,
  318. list: [],
  319. total: 0,
  320. listLoading: true
  321. },
  322. chart1: {
  323. getdataListParm: {
  324. name: 'getprocessAnalysisTB',
  325. page: 1,
  326. offset: 1,
  327. pagecount: '',
  328. returntype: 'Map',
  329. parammaps: {
  330. pastureid: Cookies.get('pastureid'),
  331. pid: ''
  332. }
  333. },
  334. tableKey: 0,
  335. list: [],
  336. total: 0,
  337. listLoading: false,
  338. chartLine_data:[]
  339. },
  340. chartLine: null,
  341. chartLine_data1: {
  342. 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', '06:44:44', '06:44:59', '06:45:14', '06:45:30', '06:45:45', '06:46:00', '06:46:15', '06:46:30', '06:46:45', '06:47:00', '06:47:15', '06:47:30', '06:47:40', '06:47:45', '06:48:00', '06:48:15', '06:48:30', '06:48:45', '06:49:00', '06:49:15', '06:49:20', '06:49:30', '06:49:45', '06:50:00', '06:50:15', '06:50:30', '06:50:45', '06:51:00', '06:51:15', '06:51:30', '06:51:45', '06:52:00', '06:52:15', '06:52:30', '06:52:45', '06:53:00', '06:53:14', '06:53:15', '06:53:30', '06:53:45', '06:54:00', '06:54:15', '06:54:30', '06:54:45', '06:55:00', '06:55:15', '06:55:30', '06:55:45', '06:56:00', '06:56:15', '06:56:30', '06:56:45', '06:57:00', '06:57:15', '06:57:30', '06:57:45', '06:58:00', '06:58:16', '06:58:31', '06:58:46', '06:59:01', '06:59:03', '06:59:16', '06:59:31', '06:59:46', '07:00:01', '07:00:16', '07:00:31', '07:00:46', '07:01:01', '07:01:16', '07:01:31', '07:01:46', '07:02:01', '07:02:01', '07:02:16', '07:02:31', '07:02:46', '07:03:01', '07:03:16', '07:03:31', '07:03:46', '07:04:01', '07:04:16', '07:04:31', '07:04:46', '07:05:01', '07:05:16', '07:05:20', '07:05:31', '07:05:46', '07:06:01', '07:06:16', '07:06:31', '07:06:46', '07:07:01', '07:07:10', '07:07:16', '07:07:31', '07:07:46', '07:08:01', '07:08:16', '07:08:31', '07:08:46', '07:09:01', '07:09:16', '07:09:31', '07:09:46'],
  343. data2: [141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 141.6, 341.46, 341.46, 341.46, 341.46, 341.46, 341.46, 341.46, 437.73, 437.73, 437.73, 437.73, 437.73, 437.73, 687.33, 687.33, 687.33, 687.33, 687.33, 687.33, 687.33, 959.24, 959.24, 959.24, 959.24, 959.24, 959.24, 959.24, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6, 1107.6, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 2496.22, 3233.97, 3233.97, 3233.97, 3233.97, 3233.97, 3233.97, 3233.97, 3233.97, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3834.38, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 3027.62, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 1223.14, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 702.38, 351.82, 351.82, 351.82, 351.82, 351.82, 351.82, 351.82, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48, -16.48],
  344. 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, 958, 962, 955, 961, 956, 956, 968, 1100, 1099, 1102, 1115, 1103, 1217, 1266, 1681, 1919, 1968, 2139, 2426, 2479, 2486, 2489, 2480, 2502, 2498, 2769, 3097, 3224, 3236, 3242, 3238, 3282, 3320, 3369, 3411, 3458, 3499, 3540, 3580, 3632, 3668, 3708, 3753, 3798, 3830, 3830, 3837, 3840, 3832, 3829, 3842, 3817, 3825, 3822, 3850, 3820, 3830, 3837, 3833, 3830, 3832, 3829, 3814, 3681, 3575, 3423, 3268, 3138, 3036, 3032, 3039, 3032, 3017, 3025, 3036, 2926, 2895, 2696, 2315, 1831, 1379, 1232, 1232, 1227, 1228, 1224, 1225, 1213, 1230, 1209, 1221, 1225, 1231, 1138, 928, 736, 708, 707, 674, 540, 530, 527, 437, 390, 356, 325, 307, 309, 310, 308, 294, 308, 306, 293, 278, 226],
  345. data4: [
  346. ['06:34:10', -8],
  347. ['06:37:28', 142],
  348. ['06:37:29', 143],
  349. ['06:38:59', 338],
  350. ['06:38:59', 337],
  351. ['06:40:08', 438],
  352. ['06:40:08', 438],
  353. ['06:41:40', 680],
  354. ['06:41:44', 678],
  355. ['06:43:09', 958],
  356. ['06:43:09', 958],
  357. ['06:44:44', 1100],
  358. ['06:44:44', 1099],
  359. ['06:47:40', 2486],
  360. ['06:47:45', 2489],
  361. ['06:49:20', 3236],
  362. ['06:49:20', 3236],
  363. ['06:53:14', 3830],
  364. ['06:53:15', 3830],
  365. ['06:59:01', 3036],
  366. ['06:59:03', 3032],
  367. ['07:02:01', 1232],
  368. ['07:02:01', 1232],
  369. ['07:05:16', 736],
  370. ['07:05:20', 708],
  371. ['07:07:10', 356],
  372. ['07:07:10', 356]
  373. ]
  374. },
  375. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  376. cellStyle: { padding: 0 + 'px' }
  377. }
  378. },
  379. created() {
  380. this.getList()
  381. },
  382. mounted() {
  383. // this.roadChartLine1(this.chartLine_data1)
  384. },
  385. methods: {
  386. // TMR设备列表
  387. getList() {
  388. this.table.listLoading = true
  389. GetDataByName(this.table.getdataListParm).then(response => {
  390. console.log('TMR设备列表table数据', response.data.list)
  391. if (response.data.list !== null) {
  392. this.table.list = response.data.list
  393. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  394. this.table3.getdataListParm.parammaps.pid = response.data.list[0].pid
  395. this.table4.getdataListParm.parammaps.pid = response.data.list[0].pid
  396. this.chart1.getdataListParm.parammaps.pid = response.data.list[0].pid
  397. this.getList2()
  398. this.getList3()
  399. this.getList4()
  400. this.getChart1()
  401. } else {
  402. this.table.list = []
  403. this.table2.list = []
  404. this.table3.list = []
  405. this.table2.listLoading = false
  406. this.table3.listLoading = false
  407. this.table4.listLoading = false
  408. this.chart1.listLoading = false
  409. }
  410. setTimeout(() => {
  411. this.table.listLoading = false
  412. }, 100)
  413. })
  414. },
  415. handleSearch() {
  416. console.log('点击了查询')
  417. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  418. this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  419. this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  420. } else {
  421. this.table.getdataListParm.parammaps.inputDatetime = ''
  422. this.table.getdataListParm.parammaps.startTime = ''
  423. this.table.getdataListParm.parammaps.stopTime = ''
  424. }
  425. this.table.getdataListParm.offset = 1
  426. this.getList()
  427. },
  428. handleRefresh() {
  429. console.log('点击了重置')
  430. this.table.getdataListParm.parammaps.barid = ''
  431. this.table.getdataListParm.parammaps.cowclass = ''
  432. this.table.getdataListParm.parammaps.startTime = ''
  433. this.table.getdataListParm.parammaps.stopTime = ''
  434. this.table.getdataListParm.parammaps.inputDatetime = ''
  435. this.table.getdataListParm.offset = 1
  436. this.getList()
  437. },
  438. rowClick(row, column, event) {
  439. this.table2.getdataListParm.parammaps.id = row.id
  440. this.table3.getdataListParm.parammaps.pid = row.pid
  441. this.table4.getdataListParm.parammaps.pid = row.pid
  442. this.chart1.getdataListParm.parammaps.pid = row.pid
  443. this.getList2()
  444. this.getList3()
  445. this.getList4()
  446. this.getChart1()
  447. },
  448. // 过程详情
  449. getList2() {
  450. this.table2.listLoading = true
  451. GetDataByName(this.table2.getdataListParm).then(response => {
  452. console.log('过程详情table数据', response.data.list)
  453. if (response.data.list !== null) {
  454. this.table2.list = response.data.list
  455. } else {
  456. this.table2.list = []
  457. }
  458. setTimeout(() => {
  459. this.table2.listLoading = false
  460. }, 100)
  461. })
  462. },
  463. // 混料详情
  464. getList3() {
  465. this.table3.listLoading = true
  466. GetDataByName(this.table3.getdataListParm).then(response => {
  467. console.log('混料详情table数据', response.data.list)
  468. if (response.data.list !== null) {
  469. this.table3.list = response.data.list
  470. } else {
  471. this.table3.list = []
  472. }
  473. setTimeout(() => {
  474. this.table3.listLoading = false
  475. }, 100)
  476. })
  477. },
  478. // 撒料详情
  479. getList4() {
  480. this.table4.listLoading = true
  481. GetDataByName(this.table4.getdataListParm).then(response => {
  482. console.log('撒料详情table数据', response.data.list)
  483. if (response.data.list !== null) {
  484. this.table4.list = response.data.list
  485. } else {
  486. this.table4.list = []
  487. }
  488. setTimeout(() => {
  489. this.table4.listLoading = false
  490. }, 100)
  491. })
  492. },
  493. getChart1() {
  494. this.chart1.listLoading = true
  495. GetReportform(this.chart1.getdataListParm).then(response => {
  496. if (response.data.list !== null) {
  497. this.chart1.list = response.data.data
  498. this.chart1.chartLine_data = response.data.list
  499. this.chart1.total = response.data.total
  500. this.roadChartLine1(this.chart1.chartLine_data)
  501. } else {
  502. this.chart1.list = []
  503. }
  504. setTimeout(() => {
  505. this.chart1.listLoading = false
  506. }, 100)
  507. })
  508. },
  509. roadChartLine1(chartLine_data1) {
  510. if (this.chartLine != null) {
  511. this.chartLine.dispose()
  512. }
  513. this.chartLine = echarts.init(document.getElementById('chartLine'))
  514. var option = {
  515. title: {
  516. text: '',
  517. subtext: ''
  518. },
  519. color: ['#61a5e8', '#ff3131'], // 关键加上这句话,legend的颜色和折线的自定义颜色就一致了
  520. legend: {
  521. icon: 'rectangle',
  522. data: ['设计重量', '实际重量'],
  523. // right: '20%',
  524. textStyle: {
  525. fontSize: 12,
  526. color: '#666'
  527. }
  528. },
  529. /* grid:{y:15},*/
  530. tooltip: {
  531. trigger: 'axis'
  532. },
  533. calculable: true,
  534. yAxis: [
  535. {
  536. type: 'value',
  537. name: '重量(kg)',
  538. splitLine: { show: false }, // 去除网格线
  539. axisLabel: {
  540. show: true,
  541. textStyle: {
  542. color: '#666' // 这里用参数代替了
  543. }
  544. }
  545. }
  546. ],
  547. xAxis: [
  548. {
  549. type: 'category',
  550. splitLine: { show: false }, // 去除网格线
  551. name: '时间',
  552. data: chartLine_data1.data1,
  553. axisLabel: {
  554. show: true,
  555. textStyle: {
  556. color: '#666' // 这里用参数代替了
  557. }
  558. }
  559. }
  560. ],
  561. series: [{
  562. symbol: 'none',
  563. name: '实际重量',
  564. type: 'line',
  565. // step: 'end',
  566. data: chartLine_data1.data3,
  567. smooth: true,
  568. barWidth: '37',
  569. itemStyle: {
  570. normal: {
  571. lineStyle: { color: '#61a5e8' }
  572. }
  573. }
  574. }, {
  575. symbol: 'none',
  576. name: '设计重量',
  577. type: 'line',
  578. barWidth: '37',
  579. data: chartLine_data1.data2
  580. }, {
  581. symbol: 'triangle',
  582. symbolSize: 10,
  583. itemStyle: {
  584. normal: {
  585. lineStyle: { color: '#ff3131' },
  586. color: function(param) {
  587. const colorList = ['#61a5e8', '#ff3131']
  588. let x = ''
  589. param.dataIndex % 2 == 0 ? x = 1 : x = 2
  590. if (x == '1') {
  591. return colorList[1]
  592. } else {
  593. return colorList[0]
  594. }
  595. }
  596. }
  597. },
  598. data: chartLine_data1.data4,
  599. type: 'scatter'
  600. }]
  601. }
  602. this.chartLine.setOption(option)
  603. window.onresize = function() {
  604. this.chartLine.resize()
  605. }
  606. }
  607. }
  608. }
  609. </script>
  610. <style lang="scss" scoped>
  611. .search{padding-top:10px;clear: both;}
  612. .table{margin-top:10px;}
  613. .detail{
  614. height:84px;border: 1px solid #EBEEF5;padding-left:10px;font:16px/32px '';color:#333;
  615. .detail-t{margin-top: 10px;}
  616. .detail-b{margin-bottom: 10px;}
  617. }
  618. </style>