a05eba772a551f2c6f8a1bac2be934761868a499.svn-base 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  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 } 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. chartLine: null,
  323. chartLine_data1: {
  324. 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'],
  325. 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],
  326. 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],
  327. data4: [
  328. ['06:34:10', -8],
  329. ['06:37:28', 142],
  330. ['06:37:29', 143],
  331. ['06:38:59', 338],
  332. ['06:38:59', 337],
  333. ['06:40:08', 438],
  334. ['06:40:08', 438],
  335. ['06:41:40', 680],
  336. ['06:41:44', 678],
  337. ['06:43:09', 958],
  338. ['06:43:09', 958],
  339. ['06:44:44', 1100],
  340. ['06:44:44', 1099],
  341. ['06:47:40', 2486],
  342. ['06:47:45', 2489],
  343. ['06:49:20', 3236],
  344. ['06:49:20', 3236],
  345. ['06:53:14', 3830],
  346. ['06:53:15', 3830],
  347. ['06:59:01', 3036],
  348. ['06:59:03', 3032],
  349. ['07:02:01', 1232],
  350. ['07:02:01', 1232],
  351. ['07:05:16', 736],
  352. ['07:05:20', 708],
  353. ['07:07:10', 356],
  354. ['07:07:10', 356]
  355. ]
  356. },
  357. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  358. cellStyle: { padding: 0 + 'px' }
  359. }
  360. },
  361. created() {
  362. this.getList()
  363. },
  364. mounted() {
  365. this.roadChartLine1(this.chartLine_data1)
  366. },
  367. methods: {
  368. // TMR设备列表
  369. getList() {
  370. this.table.listLoading = true
  371. GetDataByName(this.table.getdataListParm).then(response => {
  372. console.log('TMR设备列表table数据', response.data.list)
  373. if (response.data.list !== null) {
  374. this.table.list = response.data.list
  375. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  376. this.table3.getdataListParm.parammaps.pid = response.data.list[0].pid
  377. this.table4.getdataListParm.parammaps.pid = response.data.list[0].pid
  378. this.getList2()
  379. this.getList3()
  380. this.getList4()
  381. } else {
  382. this.table.list = []
  383. this.table2.list = []
  384. this.table3.list = []
  385. this.table2.listLoading = false
  386. this.table3.listLoading = false
  387. this.table4.listLoading = false
  388. }
  389. setTimeout(() => {
  390. this.table.listLoading = false
  391. }, 100)
  392. })
  393. },
  394. handleSearch() {
  395. console.log('点击了查询')
  396. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  397. this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  398. this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  399. } else {
  400. this.table.getdataListParm.parammaps.inputDatetime = ''
  401. this.table.getdataListParm.parammaps.startTime = ''
  402. this.table.getdataListParm.parammaps.stopTime = ''
  403. }
  404. this.table.getdataListParm.offset = 1
  405. this.getList()
  406. },
  407. handleRefresh() {
  408. console.log('点击了重置')
  409. this.table.getdataListParm.parammaps.barid = ''
  410. this.table.getdataListParm.parammaps.cowclass = ''
  411. this.table.getdataListParm.parammaps.startTime = ''
  412. this.table.getdataListParm.parammaps.stopTime = ''
  413. this.table.getdataListParm.parammaps.inputDatetime = ''
  414. this.table.getdataListParm.offset = 1
  415. this.getList()
  416. },
  417. rowClick(row, column, event) {
  418. this.table2.getdataListParm.parammaps.id = row.id
  419. this.table3.getdataListParm.parammaps.pid = row.pid
  420. this.table4.getdataListParm.parammaps.pid = row.pid
  421. this.getList2()
  422. this.getList3()
  423. this.getList4()
  424. },
  425. // 过程详情
  426. getList2() {
  427. this.table2.listLoading = true
  428. GetDataByName(this.table2.getdataListParm).then(response => {
  429. console.log('过程详情table数据', response.data.list)
  430. if (response.data.list !== null) {
  431. this.table2.list = response.data.list
  432. } else {
  433. this.table2.list = []
  434. }
  435. setTimeout(() => {
  436. this.table2.listLoading = false
  437. }, 100)
  438. })
  439. },
  440. // 混料详情
  441. getList3() {
  442. this.table3.listLoading = true
  443. GetDataByName(this.table3.getdataListParm).then(response => {
  444. console.log('混料详情table数据', response.data.list)
  445. if (response.data.list !== null) {
  446. this.table3.list = response.data.list
  447. } else {
  448. this.table3.list = []
  449. }
  450. setTimeout(() => {
  451. this.table3.listLoading = false
  452. }, 100)
  453. })
  454. },
  455. // 撒料详情
  456. getList4() {
  457. this.table4.listLoading = true
  458. GetDataByName(this.table4.getdataListParm).then(response => {
  459. console.log('撒料详情table数据', response.data.list)
  460. if (response.data.list !== null) {
  461. this.table4.list = response.data.list
  462. } else {
  463. this.table4.list = []
  464. }
  465. setTimeout(() => {
  466. this.table4.listLoading = false
  467. }, 100)
  468. })
  469. },
  470. roadChartLine1(chartLine_data1) {
  471. if (this.chartLine != null) {
  472. this.chartLine.dispose()
  473. }
  474. this.chartLine = echarts.init(document.getElementById('chartLine'))
  475. var option = {
  476. title: {
  477. text: '',
  478. subtext: ''
  479. },
  480. color: ['#61a5e8', '#ff3131'], // 关键加上这句话,legend的颜色和折线的自定义颜色就一致了
  481. legend: {
  482. icon: 'rectangle',
  483. data: ['设计重量', '实际重量'],
  484. // right: '20%',
  485. textStyle: {
  486. fontSize: 12,
  487. color: '#666'
  488. }
  489. },
  490. /* grid:{y:15},*/
  491. tooltip: {
  492. trigger: 'axis'
  493. },
  494. calculable: true,
  495. yAxis: [
  496. {
  497. type: 'value',
  498. name: '重量(kg)',
  499. splitLine: { show: false }, // 去除网格线
  500. axisLabel: {
  501. show: true,
  502. textStyle: {
  503. color: '#666' // 这里用参数代替了
  504. }
  505. }
  506. }
  507. ],
  508. xAxis: [
  509. {
  510. type: 'category',
  511. splitLine: { show: false }, // 去除网格线
  512. name: '时间',
  513. data: chartLine_data1.data1,
  514. axisLabel: {
  515. show: true,
  516. textStyle: {
  517. color: '#666' // 这里用参数代替了
  518. }
  519. }
  520. }
  521. ],
  522. series: [{
  523. symbol: 'none',
  524. name: '实际重量',
  525. type: 'line',
  526. // step: 'end',
  527. data: chartLine_data1.data3,
  528. smooth: true,
  529. barWidth: '37',
  530. itemStyle: {
  531. normal: {
  532. lineStyle: { color: '#61a5e8' }
  533. }
  534. }
  535. }, {
  536. symbol: 'none',
  537. name: '设计重量',
  538. type: 'line',
  539. barWidth: '37',
  540. data: chartLine_data1.data2
  541. }, {
  542. symbol: 'triangle',
  543. symbolSize: 10,
  544. itemStyle: {
  545. normal: {
  546. lineStyle: { color: '#ff3131' },
  547. color: function(param) {
  548. const colorList = ['#61a5e8', '#ff3131']
  549. let x = ''
  550. param.dataIndex % 2 == 0 ? x = 1 : x = 2
  551. if (x == '1') {
  552. return colorList[1]
  553. } else {
  554. return colorList[0]
  555. }
  556. }
  557. }
  558. },
  559. data: chartLine_data1.data4,
  560. type: 'scatter'
  561. }]
  562. }
  563. this.chartLine.setOption(option)
  564. window.onresize = function() {
  565. this.chartLine.resize()
  566. }
  567. }
  568. }
  569. }
  570. </script>
  571. <style lang="scss" scoped>
  572. .search{padding-top:10px;clear: both;}
  573. .table{margin-top:10px;}
  574. .detail{
  575. height:84px;border: 1px solid #EBEEF5;padding-left:10px;font:16px/32px '';color:#333;
  576. .detail-t{margin-top: 10px;}
  577. .detail-b{margin-bottom: 10px;}
  578. }
  579. </style>