From f789550dfe6051680a3467299107f98036ba6196 Mon Sep 17 00:00:00 2001 From: shijing Date: Thu, 21 Dec 2023 14:33:19 +0800 Subject: [PATCH 1/2] home --- src/views/home/widgets/index_photon.vue | 198 +++++++++++++----------- 1 file changed, 107 insertions(+), 91 deletions(-) diff --git a/src/views/home/widgets/index_photon.vue b/src/views/home/widgets/index_photon.vue index e6ee7962..8a295056 100644 --- a/src/views/home/widgets/index_photon.vue +++ b/src/views/home/widgets/index_photon.vue @@ -20,27 +20,57 @@
预制棒合格数

{{dayPassNum7}}

-

同比前天 8.63%▲

+

同比前天 + + {{tongbi7}}% + + + +

预制管合格数

{{dayPassNum10}}

-

同比前天 8.63%▲

+

同比前天 + + {{tongbi10}}% + + + +

AVG合格数

{{dayAVGcountOk}}

-

同比前天 8.63%▼

+

同比前天 + + {{AVGOktongbi}}% + + + +

预制棒管交付数

{{ dayPayNum6 }}

-

同比前天 8.63%▲

+

同比前天 + + {{tongbi06}}% + + + +

AVG交付数

{{dayAVGcountDelivered}}

-

同比前天 8.63%▲

+

同比前天 + + {{AVGDelivertongbi}}% + + + +

@@ -232,6 +262,7 @@ export default { month_s: '', deptName:'7车间', yesterday:'', + yesterdayBefore:'', yearData: [], monthData: [], warningNum: 0, @@ -247,17 +278,24 @@ export default { 40: '禁用', }, dayPassNum7:0, + tongbi7:0, dayPassNum10:0, + tongbi10:0, dayPayNum6:0,//交付数 + tongbi06:0, monthPayNum6:0, monthPassRate7:0, monthPassRate10:0, - monthRateAVG:0, + dayAVGcountOk:0, + AVGOktongbi:0, dayAVGcountDelivered:0, + AVGDelivertongbi:0, + monthRateAVG:0, monthPayNumAVG:0, + option:{ grid: { // 图表距离边框的距离,可用百分比和数字(px)配置 top: '5%', @@ -303,16 +341,29 @@ export default { let yesterday = new Date(myDate.getTime()-24*60*60*1000); this.yesterday = yesterday.getFullYear()+"-" + (yesterday.getMonth()+1) + "-" + yesterday.getDate(); + let yesterdayBefore = new Date(yesterday.getTime()-24*60*60*1000); + this.yesterdayBefore = yesterdayBefore.getFullYear()+"-" + (yesterdayBefore.getMonth()+1) + "-" + yesterdayBefore.getDate(); that.getdayData(); that.getMonthData(); this.getAVGDayData(); - // that.initChart(); this.calendarValue = new Date(); this.getEquipList(); this.getMaterialList(); this.getProductStatistic(); }, methods: { + // 动态绑定Class + bindClass(rate) { + let classInfo = { + socketDom: true, redColor: false,greenColor: true + } + if (rate>0) { + classInfo.greenColor = true + }else if(rate<0){ + classInfo.redColor = true + } + return classInfo + }, getEquipList() { this.$API.em.equipment.list.req({ page: 0, type: 10 }).then(res => { this.equipList = res @@ -326,74 +377,15 @@ export default { console.log('getMaterialList',res) }) }, - // 动态绑定Class - bindClass(type) { - let classInfo = { - socketDom: true, redColor: false, - orangeColor: false, yellowColor: false, blueColor: true - } - if (type == '') { - classInfo.redColor = true - } - return classInfo - }, - getMessage(msg) { - console.log(msg); - }, - close() { - if (this.ws) { - this.ws.close(); - this.ws = null; - console.log("socket已经关闭"); - } - }, + showTime() { this.time = this.$TOOL.dateFormat(new Date(), 'hh:mm:ss') this.day = this.$TOOL.dateFormat(new Date(), 'yyyy年MM月dd日') }, - interEvent() { - this.$router.replace({ path: '/events' }) - }, interEquipment() { - this.$router.replace({ path: '/em/equipmentc' }) + this.$router.replace({ path: '/em/equipment' }) }, - // initChart() { - // //柱状图 - // var dom = document.getElementById("barCharts"); - // var myChart = echarts.init(dom); - // let option = { - // grid: { // 图表距离边框的距离,可用百分比和数字(px)配置 - // top: '5%', - // left: '1%', - // right: '1%', - // bottom: '5%', - // containLabel: true - // }, - // xAxis: { - // type: 'category', - // axisLabel: { - // // show: false, // X 轴标签文字旋转角度 - // }, - // data: ['1号', '2号', '3号', '4号', '5号', '6号', '7号', '8号', '9号', '10号'] - // }, - // yAxis: { - // type: 'value', - // axisLabel: { - // show: false, // X 轴标签文字旋转角度 - // }, - // }, - // series: [{ - // data: [10, 9, 8, 11, 12, 10, 9, 10, 8, 9, 10], - // type: 'bar', - // barMaxWidth: 50, - // itemStyle: { - // normal: { color: 'rgb(20, 141, 255)' } - // } - // }] - // }; - // myChart.setOption(option, true); - // }, - //昨日合格数&昨日交付统计 + //昨日数据 getdayData(){ let that = this; let date = that.yesterday; @@ -406,47 +398,58 @@ export default { let obj10 ={ query: {start_date:date,end_date:date,dept_name: "10车间"}, }; + + let date0 = that.yesterdayBefore; + let obj06 ={ + query: {start_date:date0,end_date:date0}, + }; + let obj07 ={ + query: {start_date:date0,end_date:date0,dept_name: "7车间"}, + }; + let obj010 ={ + query: {start_date:date0,end_date:date0,dept_name: "10车间"}, + }; //7车间昨日合格数 that.$API.bi.dataset.exec.req('lineDay', obj7).then((res7) => { - // console.log('7车间按日统计:',res7); let list7 = res7.data2.ds0; - let sum = 0; if(list7.length>0){ - list7.forEach(item => { - sum = sum+item.合格数; - }); + this.dayPassNum7 = list7[0].合格数; } - this.dayPassNum7 = sum; - // console.log('10车间昨日合格数:',this.dayPassNum7); - // debugger; + //7车间前天合格数 + that.$API.bi.dataset.exec.req('lineDay', obj07).then((res07) => { + let list07 = res07.data2.ds0; + if(list07.length>0){ + this.tongbi7 =Math.floor((this.dayPassNum7- list07[0].合格数)/list07[0].合格数*100); + } + }); }); //10车间昨日合格数 that.$API.bi.dataset.exec.req('lineDay', obj10).then((res10) => { - console.log('10车间昨日合格数:',res10); let list10 = res10.data2.ds0; - let sum = 0; if(list10.length>0){ - list10.forEach(item => { - sum = sum+item.合格数; + this.dayPassNum10 = list10[0].合格数; + //10车间前天合格数 + that.$API.bi.dataset.exec.req('lineDay', obj010).then((res010) => { + let list010 = res010.data2.ds0; + if(list010.length>0){ + this.tongbi10 =Math.floor((this.dayPassNum10- list010[0].合格数)/list010[0].合格数*100); + } }); } - this.dayPassNum10 = sum; - // console.log('10车间昨日合格数:',this.dayPassNum10); - // debugger; }); //6车昨日交付数 that.$API.bi.dataset.exec.req('saleOutDay', obj6).then((res6) => { - // console.log('6车间按日交付统计:',res6); let list6 = res6.data2.ds0; - let sum = 0; if(list6.length>0){ - list6.forEach(item => { - sum = sum+item.交付数; + this.dayPayNum6 = list6[0].交付数; + //6车昨日交付数 + that.$API.bi.dataset.exec.req('saleOutDay', obj06).then((res06) => { + let list06 = res06.data2.ds0; + if(list06.length>0){ + this.tongbi06 = Math.floor((this.dayPayNum6- list06[0].交付数)/list06[0].交付数*100); + } }); } - this.dayPayNum6 = sum; - // console.log('6车间本月交付数:',this.dayPayNum6); - // debugger; }); }, //本月合格数&本月交付统计 @@ -512,6 +515,7 @@ export default { getAVGDayData(){ let that = this; let date = that.yesterday; + let date0 = that.yesterdayBefore; this.$API.wpm.otherlog.list.req({product:'AVG',page:0,handle_date__gte:date,handle_date__lte:date}).then(res=>{ let list = res; let count_ok = 0,count_delivered = 0; @@ -522,6 +526,18 @@ export default { }) that.dayAVGcountOk = count_ok; that.dayAVGcountDelivered = count_delivered; + this.$API.wpm.otherlog.list.req({product:'AVG',page:0,handle_date__gte:date0,handle_date__lte:date0}).then(res0=>{ + let list0 = res0; + let count_ok0 = 0,count_delivered0 = 0; + if(list0.length>0){ + list0.forEach(item0=>{ + count_ok0=count_ok0+item0.count_ok; + count_delivered0 = count_delivered0+item0.count_delivered; + }) + that.AVGOktongbi = Math.floor((count_ok-count_ok0)/count_ok0*100); + that.AVGDelivertongbi = Math.floor((count_delivered-count_delivered0)/count_delivered0*100); + } + }) } }) }, From 976c92cdec68420dfdf76eda32a447028da6f30c Mon Sep 17 00:00:00 2001 From: shijing Date: Thu, 21 Dec 2023 14:44:24 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8A=A0=E5=B7=A5=E8=B7=AF=E7=BA=BF?= =?UTF-8?q?=E4=B8=ADstep=E5=B1=85=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mtm/route.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/views/mtm/route.vue b/src/views/mtm/route.vue index 8877a428..3760dc5b 100644 --- a/src/views/mtm/route.vue +++ b/src/views/mtm/route.vue @@ -18,7 +18,7 @@
- +
@@ -235,4 +235,16 @@ export default { } } } - \ No newline at end of file + + \ No newline at end of file