From 5e26baf75fb08958d3106cb5648fe7026f28e1b1 Mon Sep 17 00:00:00 2001 From: shijing Date: Mon, 25 Dec 2023 11:03:15 +0800 Subject: [PATCH] =?UTF-8?q?6=E8=BD=A6=E9=97=B4=E7=9C=8B=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/bigScreen/index_6dept.vue | 174 ++++++++++++++++++------ src/views/home/widgets/index_photon.vue | 54 ++++---- 2 files changed, 156 insertions(+), 72 deletions(-) diff --git a/src/views/bigScreen/index_6dept.vue b/src/views/bigScreen/index_6dept.vue index 4fb96668..410bc15b 100644 --- a/src/views/bigScreen/index_6dept.vue +++ b/src/views/bigScreen/index_6dept.vue @@ -150,19 +150,17 @@ export default { bottom: '3%', containLabel: true }, - xAxis: [ - { - type: 'category', - boundaryGap: true, - data: ['1日','2日', '3日', '4日', '5日', '6日', '7日', '8日','9日','10日', '11日', '12日', '13日', '14日', '15日', '16日', '17日', '18日','19日','20日', '21日', '22日', '23日', '24日', '25日', '26日', '27日', '28日', '29日', '30日'], - nameTextStyle: { - color: '#ffffff' - }, - axisLabel: { - color: '#ffffff' - }, - } - ], + xAxis: { + type: 'category', + boundaryGap: true, + data: ['1日','2日', '3日', '4日', '5日', '6日', '7日', '8日','9日','10日', '11日', '12日', '13日', '14日', '15日', '16日', '17日', '18日','19日','20日', '21日', '22日', '23日', '24日', '25日', '26日', '27日', '28日', '29日', '30日'], + nameTextStyle: { + color: '#ffffff' + }, + axisLabel: { + color: '#ffffff' + }, + }, yAxis: [ { name: "生产统计", @@ -226,7 +224,7 @@ export default { position: 'insideTop', color:'#666' }, - data: [140, 232, 101, 264, 90, 340, 250,140, 232, 101, 264, 90, 340, 250,140, 232, 101, 264, 90, 340, 250,140, 232, 101, 264, 90, 340, 250, 340, 250] + data: [] }, { name: '管', @@ -272,7 +270,7 @@ export default { color:'#666', font:'10' }, - data:[100, 202, 101, 204, 190, 140, 150,100, 132, 161, 164, 190, 240, 150,110, 202, 100, 164, 90, 240, 150,340, 232, 101, 164, 190, 240, 250, 240, 150] + data:[] }, ] }, @@ -282,28 +280,8 @@ export default { table2Visible:false, refValue1:'moocBox1', refValue2:'moocBox2', - liData1: ['日期', '型号', '规格', '发货数量'], - listData1test: [ - [{elType:'primary',value:"2023-11-10"},{elType:'primary',value:"ZJ2"},{elType:'primary',value:"40/360"},{elType:'primary',value:368}], - [{elType:'primary',value:"2023-11-10"},{elType:'primary',value:"ZJ2"},{elType:'primary',value:"40/360"},{elType:'primary',value:368}], - [{elType:'primary',value:"2023-11-10"},{elType:'primary',value:"ZJ2"},{elType:'primary',value:"40/360"},{elType:'primary',value:368}], - [{elType:'primary',value:"2023-11-10"},{elType:'primary',value:"ZJ2"},{elType:'primary',value:"40/360"},{elType:'primary',value:368}], - [{elType:'primary',value:"2023-11-10"},{elType:'primary',value:"ZJ2"},{elType:'primary',value:"40/360"},{elType:'primary',value:368}], - [{elType:'primary',value:"2023-11-10"},{elType:'primary',value:"ZJ2"},{elType:'primary',value:"40/360"},{elType:'primary',value:368}], - [{elType:'primary',value:"2023-11-10"},{elType:'primary',value:"ZJ2"},{elType:'primary',value:"40/360"},{elType:'primary',value:368}], - [{elType:'primary',value:"2023-11-10"},{elType:'primary',value:"ZJ2"},{elType:'primary',value:"40/360"},{elType:'primary',value:368}], - ], - liData2: ['工序','产品名称', '型号', '计划数量', '合格数量', '完成进度', '合格率','操作人'], - listData2test: [ - [{elType:'primary',value:"平头"},{elType:'primary',value:"光纤预制管"},{elType:'primary',value:"ZJ2"}, {elType:'primary',value:368},{elType:'primary',value:368},{elType:'progress',value:100},{elType:'primary',value:'60%'},{elType:'primary',value:'李斯'}], - [{elType:'primary',value:"粘头"},{elType:'primary',value:"光纤预制管"},{elType:'primary',value:"ZJ2"}, {elType:'primary',value:368},{elType:'primary',value:360},{elType:'progress',value:99},{elType:'primary',value:'60%'},{elType:'primary',value:'王丽'}], - [{elType:'primary',value:"粗磨"},{elType:'primary',value:"光纤预制管"},{elType:'primary',value:"ZJ2"}, {elType:'primary',value:368},{elType:'primary',value:350},{elType:'progress',value:99},{elType:'primary',value:'60%'},{elType:'primary',value:'杜克'}], - [{elType:'primary',value:"中磨"},{elType:'primary',value:"光纤预制管"},{elType:'primary',value:"ZJ2"}, {elType:'primary',value:368},{elType:'primary',value:360},{elType:'progress',value:99},{elType:'primary',value:'60%'},{elType:'primary',value:'赵莉'}], - [{elType:'primary',value:"细磨"},{elType:'primary',value:"光纤预制管"},{elType:'primary',value:"ZJ2"}, {elType:'primary',value:368},{elType:'primary',value:340},{elType:'progress',value:99},{elType:'primary',value:'60%'},{elType:'primary',value:'钱多'}], - [{elType:'primary',value:"抛光"},{elType:'primary',value:"光纤预制管"},{elType:'primary',value:"ZJ2"}, {elType:'primary',value:368},{elType:'primary',value:300},{elType:'progress',value:99},{elType:'primary',value:'60%'},{elType:'primary',value:'孙桑'}], - [{elType:'primary',value:"开凿"},{elType:'primary',value:"光纤预制管"},{elType:'primary',value:"ZJ2"}, {elType:'primary',value:368},{elType:'primary',value:320},{elType:'progress',value:99},{elType:'primary',value:'60%'},{elType:'primary',value:'周欸'}], - [{elType:'primary',value:"配管"},{elType:'primary',value:"光纤预制管"},{elType:'primary',value:"ZJ2"}, {elType:'primary',value:368},{elType:'primary',value:330},{elType:'progress',value:99},{elType:'primary',value:'60%'},{elType:'primary',value:'吴思'}], - ], + liData1: ['序号','日期', '型号', '规格', '发货数量'], + liData2: ['序号','工序','产品名称', '型号', '计划数量', '合格数量', '完成进度', '合格率','操作人'], todayMtask:[], saleOutData:[], processData:[], @@ -312,6 +290,7 @@ export default { end_date:'', scrollVivible:true, dayInterval:null, + chartInterval1:null, currentTime:'', currentDay:'', @@ -342,9 +321,6 @@ export default { this.yesterday = yesterday.getFullYear()+"-" + (yesterday.getMonth()+1) + "-" + yesterday.getDate(); this.getsaleOut(); - let chart1Option = deepCopy(this.basicOption) - this.setChart("chart1", chart1Option); - let chart2Option = deepCopy(this.basicOption) chart2Option.yAxis[0].name = '交付统计'; chart2Option.series[0].type = 'line'; @@ -482,16 +458,128 @@ export default { query: {start_date:this.start_date,end_date:this.end_date,dept_name: "6车间"}, }; let obj1 ={ - query: {start_date:this.start_date,end_date:this.end_date}, + query: {start_date:this.start_date,end_date:this.end_date,dept_name: "6车间"}, }; //生产车间按日统计 - that.$API.bi.dataset.exec.req('lineDay', obj).then((doInRes) => { - console.log('生产车间按日统计:',doInRes); + that.$API.bi.dataset.exec.req('lineDay', obj).then((res1) => { + console.log('生产车间按日统计:',res1); + let list1 = res1.data2.ds0; + let seriesData1 = [],xAxisData1=[]; + for (let i = 0; i < that.days; i++) { + let day = i+1; + let text = day+'日'; + xAxisData1[i]=text; + } + if(list1.length>0){ + list1.forEach(item1=>{ + let index1 = item1.日-1; + seriesData1[index1] = item1.生产数; + }) + } + console.log(xAxisData1) + console.log(seriesData1) + console.log('00000000000') + let chart1Option = deepCopy(this.basicOption) + chart1Option.xAxis.data = xAxisData1; + chart1Option.series[0].data=seriesData1; + let chart1 = this.setChart("chart1", chart1Option); + let index1 = 0 + this.chartInterval1 = setInterval(function () { + if (index1 < chart1Option.series[0].data.length) { + chart1.dispatchAction({ type: 'downplay', seriesIndex: 0 }); + chart1.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index2 }); + chart1.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index2 }); + index1++; + } else { + index1 = 0; + } + }, 3000); debugger; }); //本月交付统计 that.$API.bi.dataset.exec.req('saleOutDay', obj1).then((saleOutRes) => { console.log('本月交付统计:',saleOutRes); + // chart2Option.yAxis.name='合格率'; + // chart2Option.legend = { + // icon: "stack", + // right: 0, + // data: [{ + // backgroundColor: 'rgb(250,205,0)', + // name: '合格率', + // itemStyle: { + // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + // { + // offset: 0, + // color: 'rgb(1,235,239)' + // }, + // { + // offset: 1, + // color: 'rgb(5, 158, 163)' + // } + // ]) + // }, + // textStyle: { + // color: '#fff' + // } + // }], + // }; + // let series2=[{ + // name: '合格率', + // type: 'line', + // smooth: true, + // lineStyle: { + // width: 1, color: 'rgb(1,235,239)' + // }, + // showSymbol: false, + // areaStyle: { + // opacity: 0.8, + // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + // { + // offset: 0, + // color: 'rgb(1,235,239)' + // }, + // { + // offset: 1, + // color: 'rgb(5, 158, 163)' + // } + // ]) + // }, + // emphasis: { + // focus: 'series' + // }, + // label: { + // show: true, + // position: 'top', + // color:'#fff' + // }, + // itemStyle: { + // borderRadius: [2, 2, 0, 0], + // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + // { + // offset: 0, + // color: 'rgb(250,205,0)' + // }, + // { + // offset: 1, + // color: 'rgb(254,129,0)' + // } + // ]) + // }, + // data: seriesData1 + // }]; + // chart2Option.series=series2; + // let chart2 = this.setChart("chart2", chart2Option); + // let index2 = 0 + // this.chartInterval2 = setInterval(function () { + // if (index2 < chart2Option.series[0].data.length) { + // chart2.dispatchAction({ type: 'downplay', seriesIndex: 0 }); + // chart2.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index2 }); + // chart2.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: index2 }); + // index2++; + // } else { + // index2 = 0; + // } + // }, 3000); debugger; }); }, diff --git a/src/views/home/widgets/index_photon.vue b/src/views/home/widgets/index_photon.vue index 8a295056..78170772 100644 --- a/src/views/home/widgets/index_photon.vue +++ b/src/views/home/widgets/index_photon.vue @@ -92,14 +92,14 @@
- +
预制棒合格率

{{monthPassRate7}}%

- +
预制管合格率

{{monthPassRate10}}%

@@ -107,7 +107,7 @@
- +
AVG合格率

{{monthRateAVG}}%

@@ -236,12 +236,6 @@
-
@@ -260,7 +254,7 @@ export default { year_s: '', day_s: '', month_s: '', - deptName:'7车间', + deptName:'10车间', yesterday:'', yesterdayBefore:'', yearData: [], @@ -425,31 +419,33 @@ export default { }); //10车间昨日合格数 that.$API.bi.dataset.exec.req('lineDay', obj10).then((res10) => { + console.log('res10',res10); let list10 = res10.data2.ds0; if(list10.length>0){ - 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 = list10[0].合格数; } + //10车间前天合格数 + that.$API.bi.dataset.exec.req('lineDay', obj010).then((res010) => { + console.log('res10',res010); + let list010 = res010.data2.ds0; + if(list010.length>0){ + this.tongbi10 =Math.floor((this.dayPassNum10- list010[0].合格数)/list010[0].合格数*100); + } + }); }); //6车昨日交付数 that.$API.bi.dataset.exec.req('saleOutDay', obj6).then((res6) => { let list6 = res6.data2.ds0; if(list6.length>0){ 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); - } - }); } + //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); + } + }); }); }, //本月合格数&本月交付统计 @@ -477,13 +473,12 @@ export default { }); rate = sum/list7.length; } - this.monthPassRate7 = rate; + this.monthPassRate7 = Math.floor(rate) ; // console.log('7车间本月合格率:',this.monthPassRate7); // debugger; }); //10车间本月合格率 that.$API.bi.dataset.exec.req('lineMonth', obj10).then((res10) => { - // console.log('10车间本月合格率:',res10); this.monthPassRate10 = 0; let list10 = res10.data2.ds0; let sum = 0,rate=0; @@ -493,7 +488,7 @@ export default { }); rate = sum/list10.length; } - this.monthPassRate10 = rate; + this.monthPassRate10 =Math.floor(rate) ; // console.log('10车间本月合格率:',this.monthPassRate10); // debugger; }); @@ -577,7 +572,8 @@ export default { let list = res.data2.ds0; let chartData = [],xAxisData=[]; for(let i=0;i