diff --git a/src/views/bigScreen/index_heihuadept.vue b/src/views/bigScreen/index_heihuadept.vue index efd98513..da2f4a04 100644 --- a/src/views/bigScreen/index_heihuadept.vue +++ b/src/views/bigScreen/index_heihuadept.vue @@ -6,56 +6,91 @@ - - -
-
-
- 黑化设备 + + + +
+
+
+ 黑化设备 +
+
+ + 保温中 + {{hh.bw}}台 +
+
+ + 冷却中 + {{hh.lq}}台 +
+
+ + 未运行 + {{hh.wyx}}台 +
+
+ + 故障 + {{hh.gz}}台 +
-
- - 保温中 - {{hh.bw}}台 -
-
- - 冷却中 - {{hh.lq}}台 -
-
- - 未运行 - {{hh.wyx}}台 -
-
- - 故障 - {{hh.gz}}台 +
+
+
-
-
- + + +
+
+
+ 退火设备 +
+
+ + 保温中 + {{th.bw}}台 +
+
+ + 冷却中 + {{th.lq}}台 +
+
+ + 未运行 + {{th.wyx}}台 +
+
+ + 故障 + {{th.gz}}台 +
+
+
+
+ +
-
+ - +
-
黑化任务进度
+
合格数统计
- +
- - +
@@ -191,11 +226,7 @@ export default { backgroundColor: "rgb(1,235,239)", name: "黑化", itemStyle: { - color: new echarts.graphic.LinearGradient( - 0, - 0, - 0, - 1, + color: new echarts.graphic.LinearGradient(0,0,0,1, [ { offset: 0, @@ -216,11 +247,7 @@ export default { backgroundColor: "rgb(250,205,0)", name: "退火", itemStyle: { - color: new echarts.graphic.LinearGradient( - 0, - 0, - 0, - 1, + color: new echarts.graphic.LinearGradient(0,0,0,1, [ { offset: 0, @@ -239,11 +266,6 @@ export default { }, ], }, - toolbox: { - feature: { - // saveAsImage: {} - }, - }, grid: { left: "3%", right: "2%", @@ -394,18 +416,18 @@ export default { waitTime:1000, // columnWidth: [,,50] }, - configData1:{ - headerBGC:'#0a3f44', - header:['产出名称','规格','型号','开始时间','结束时间','完成进度','产量','状态'], - headerHeight:40, - data:[] - }, - configData2:{ - headerBGC:'#0a3f44', - header:['产出名称','规格','型号','开始时间','结束时间','完成进度','产量','状态'], - headerHeight:40, - data:[] - }, + // configData1:{ + // headerBGC:'#0a3f44', + // header:['产出名称','规格','型号','开始时间','结束时间','完成进度','产量','状态'], + // headerHeight:40, + // data:[] + // }, + // configData2:{ + // headerBGC:'#0a3f44', + // header:['产出名称','规格','型号','开始时间','结束时间','完成进度','产量','状态'], + // headerHeight:40, + // data:[] + // }, configData01:{ headerBGC:'#0a3f44', header:['设备名称','设备编号','设备状态','生产进度','物料数量','保温剩余时间'], @@ -423,6 +445,8 @@ export default { today: "", end_time:'', start_time:'', + end_date:'', + start_date:'', }; }, mounted() { @@ -448,14 +472,10 @@ export default { let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd hh:mm:ss"); this.start_time = start_time; this.end_time = end_time; + this.start_date = daysArr[0]; + this.end_date = daysArr[6]; this.getMgroups(); this.$nextTick(() => { - //设备数据 - // this.getEqState1(); - // this.getEqState2(); - //任务进度 - this.getMtask1(); - this.getMtask2(); //投产/生产分析 this.getProductLine1(); this.getProductLine2(); @@ -465,6 +485,7 @@ export default { this.getLeftBottomNum(); //工段生产数量 this.getMgroupCount(); + this.getCountOkNok(); }) }, methods: { @@ -611,75 +632,20 @@ export default { res.forEach((item) => { if(item.name == '黑化'){ that.mgroup_hh = item.id; - console.log('黑化',item.id); that.getEqState1(); } if(item.name == '退火'){ that.mgroup_th = item.id; - console.log('退火',item.id); that.getEqState2(); } }); }); }, - //黑化设备运行状态0 - getEqState10() { - let that = this; - that.$API.wpm.ana.equipLastMlog.req({mgroup_name: '黑化'}).then((res) => { - console.log('黑化设备运行状态',res); - that.hh.bw = res.保温; - that.hh.lq = res.冷却; - that.hh.wyx = res.未运行; - that.hh.gz = res.故障; - let processData = []; - let now = new Date(res.now).getTime(); - if(res.rows.length>0){ - res.rows.forEach((item) => { - let arr = [],obj1 = {},obj2 = {},obj3 = {},obj4 = {},obj5 = {}; - obj1.elType = "primary"; - obj1.value = item.name; - obj2.elType = "primary"; - obj2.value = item.number; - obj3.elType = "elicon"; - obj3.value = item.mstate; - obj4.elType = "progress"; - let process = 0; - let startTime = new Date(item.work_start_time).getTime(); - let endTime = new Date(item.work_end_time).getTime(); - let sumTime =0; - if(item.reminder_interval_list&&item.reminder_interval_list>0){ - sumTime = item.reminder_interval_list[0]+item.reminder_interval_list[1]; - }else{ - sumTime = endTime - startTime; - } - if(now>startTime&&nowendTime){ - process = 100; - } - obj4.value = process; - obj5.elType = "primary"; - obj5.value = item.t_count_use; - arr.push(obj1); - arr.push(obj2); - arr.push(obj3); - arr.push(obj4); - arr.push(obj5); - processData.push(arr); - }); - this.processData01 = processData; - } - - }); - }, //黑化设备运行状态 getEqState1() { let that = this; that.$API.wpm.ana.equipLastMlog.req({mgroup:that.mgroup_hh}).then((res) => { - console.log('黑化设备运行状态',res); that.hh.bw = res.保温; that.hh.lq = res.冷却; that.hh.wyx = res.未运行; @@ -727,40 +693,10 @@ export default { } }); }, - //黑化任务进度 - getMtask1() { - let that = this; - let obj = {}; - obj.mgroup__name = that.mgroup_hh; - obj.page = 0; - that.$API.pm.mtask.list.req(obj).then((res) => { - that.configData1.data = []; - res.forEach((item) => { - let arr = []; - arr[0] = item.material_out_.name; - arr[1] = item.material_out_.specification; - arr[2] = item.material_out_.model; - arr[3] = item.start_date; - arr[4] = item.end_date; - let process = Math.round((item.count_ok / item.count) * 100)+'%'; - arr[5] = process; - arr[6] = item.count_ok; - if(item.state==20){ - arr[7]='已下达'; - }else if(item.state==34){ - arr[7]='已停止'; - }else if(item.state==40){ - arr[7]='已提交'; - } - that.configData1.data.push(arr); - }); - }); - }, //退火设备运行状态 getEqState2() { let that = this; that.$API.wpm.ana.equipLastMlog.req({mgroup:that.mgroup_th}).then((res) => { - console.log('退火设备运行状态',res); that.th.bw = res.保温; that.th.lq = res.冷却; that.th.wyx = res.未运行; @@ -808,35 +744,6 @@ export default { } }); }, - //退火任务进度 - getMtask2() { - let that = this; - let obj = {}; - obj.mgroup__name = '退火'; - obj.page = 0; - that.$API.pm.mtask.list.req(obj).then((res) => { - that.configData2.data = []; - res.forEach((item) => { - let arr = []; - arr[0] = item.material_out_.name; - arr[1] = item.material_out_.specification; - arr[2] = item.material_out_.model; - arr[3] = item.start_date; - arr[4] = item.end_date; - let process = Math.round((item.count_ok / item.count) * 100)+'%'; - arr[5] = process; - arr[6] = item.count_ok; - if(item.state==20){ - arr[7]='已下达'; - }else if(item.state==34){ - arr[7]='已停止'; - }else if(item.state==40){ - arr[7]='已提交'; - } - that.configData2.data.push(arr); - }); - }); - }, getLeftBottomNum(){ let that = this; this.$API.wpm.ana.put_prod.req().then((res) => { @@ -865,7 +772,6 @@ export default { let that = this; that.$API.bi.dataset.exec.req(" gdscs").then((res) => { let arr = res.data2.ds0; - console.log('工段生产数量',arr) arr.forEach((item) => { if(item.工段=='退火'){ that.kctj.thz = item.生产中数; @@ -877,6 +783,82 @@ export default { }) }) }, + //合格不合格统计 + getCountOkNok(){ + let that = this; + let chart3Option = deepCopy(this.basicOption); + chart3Option.xAxis.data = that.xAxisData; + chart3Option.series[0].name = '合格数'; + chart3Option.series[1].name = '不合格数'; + let seriesData1 = [0,0,0,0,0,0,0],seriesData2 = [0,0,0,0,0,0,0]; + let params = { + query: { + end_date: that.end_date, + start_date: that.start_date, + mgroup_name: "黑化", + group_bys_date: ", 月, 日", + order_bys_date: ", 月, 日", + select_cols_date: ",EXTRACT(MONTH FROM mlog.handle_date) AS 月,EXTRACT(DAY FROM mlog.handle_date) AS 日" + }, + }; + that.$API.bi.dataset.exec.req("lineDay_m2",params).then((res) => { + let arr = res.data2.ds0; + arr.forEach((item) => { + let month = item.月<10?'0'+item.月:item.月; + let day = item.日<10?'0'+item.日:item.日; + let date = month+'-'+day; + let index = that.xAxisData.indexOf(date); + seriesData1[index] += item.合格数; + seriesData2[index] += item.不合格数; + }) + let params2 = { + query: { + end_date: that.end_date, + start_date: that.start_date, + mgroup_name: "退火", + group_bys_date: ", 月, 日", + order_bys_date: ", 月, 日", + select_cols_date: ",EXTRACT(MONTH FROM mlog.handle_date) AS 月,EXTRACT(DAY FROM mlog.handle_date) AS 日" + }, + }; + that.$API.bi.dataset.exec.req("lineDay_m2",params2).then((res) => { + let arr2 = res.data2.ds0; + arr2.forEach((item2) => { + let month2 = item2.月<10?'0'+item2.月:item2.月; + let day2 = item2.日<10?'0'+item2.日:item2.日; + let date2 = month2 +'-'+day2; + let index2 = that.xAxisData.indexOf(date2); + seriesData1[index2] += item2.合格数; + seriesData2[index2] += item2.不合格数; + }) + chart3Option.series[0].data = seriesData1; + chart3Option.series[1].data = seriesData2; + let chart3 = this.setChart("chart3", chart3Option); + let index3 = 0; + this.chartInterval2 = setInterval(function () { + if (index3 < chart3Option.series[0].data.length) { + chart3.dispatchAction({ + type: "downplay", + seriesIndex: 0, + }); + chart3.dispatchAction({ + type: "highlight", + seriesIndex: 0, + dataIndex: index3, + }); + chart3.dispatchAction({ + type: "showTip", + seriesIndex: 0, + dataIndex: index3, + }); + index3++; + } else { + index3 = 0; + } + }, 3000); + }); + }) + }, }, }; @@ -973,6 +955,9 @@ export default { .boxmain.boxmainbottom{ height: calc(100% - 120px); } +.boxmain.boxmaintop{ + height: calc(100% - 10px); +} .lineDiv { height: 40px; line-height: 40px;