From 348bd899d5d4f2dc3928435566ae042a05f210df Mon Sep 17 00:00:00 2001 From: shijing Date: Mon, 22 Jan 2024 08:50:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F=E4=B8=BA?= =?UTF-8?q?=E6=98=A8=E6=97=A5=E5=91=A8=E6=89=80=E5=9C=A8=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/bigScreen/index_photon.vue | 14 ++++- src/views/statistics/product_check.vue | 85 +++++++++++++------------- 2 files changed, 54 insertions(+), 45 deletions(-) diff --git a/src/views/bigScreen/index_photon.vue b/src/views/bigScreen/index_photon.vue index b6db9f8c..bb1c8793 100644 --- a/src/views/bigScreen/index_photon.vue +++ b/src/views/bigScreen/index_photon.vue @@ -379,9 +379,18 @@ export default { let cDate = new Date(); let yesterday = new Date(cDate.getTime()-ondDayTime); let week = yesterday.getDay();//当前时间的week数 - // let time = ' 星期' + '日一二三四五六'.charAt(week);//当前时间周几 + console.log(week); let weekFirst = week - 1;//第一天对应的天数 let weekLast = 7 - week;//最后一天对应的天数 + if(week==0){ + weekFirst = 6; + weekLast = 0;//周日特殊处理 + }else{ + weekFirst = week - 1; + weekLast = 7 - week; + } + // let time = ' 星期' + '日一二三四五六'.charAt(week);//当前时间周几 + let first = new Date(new Date(yesterday.getTime() - (weekFirst * ondDayTime)));//本周周一 let last = new Date(new Date(yesterday.getTime() + (weekLast * ondDayTime)));//本周周日 let dateArr = []; @@ -395,6 +404,9 @@ export default { this.end_date = last.getFullYear() + '-' + (last.getMonth() + 1) + '-' + last.getDate(); // let yesterday = new Date(cDate.getTime()-ondDayTime); this.yesterday = yesterday.getFullYear()+"-" + (yesterday.getMonth()+1) + "-" + yesterday.getDate(); + console.log(this.start_date); + console.log(this.end_date); + console.log(this.yesterday); this.getsaleOut(); this.getPlanRate(); this.getMaterialList(); diff --git a/src/views/statistics/product_check.vue b/src/views/statistics/product_check.vue index ad03cbb5..e4444e42 100644 --- a/src/views/statistics/product_check.vue +++ b/src/views/statistics/product_check.vue @@ -39,11 +39,9 @@ - + - - - + @@ -79,11 +77,9 @@ - + - - - + @@ -123,11 +119,9 @@ - + - - - + @@ -283,23 +277,24 @@ getData(){ let that = this; that.tableData8 = []; - let exec = that.queryType=='月'?'lineWeek':'lineMonth'; + let exec = that.queryType=='月'?'lineMonth':'lineYear'; let obj = { query: { start_date: this.start_date, end_date: this.end_date, dept_name: "8车间" }, }; that.$API.bi.dataset.exec.req(exec, obj).then((res) => { console.log('退火车间统计:',res); - if(res.length>0){ - that.tableData8 = res; - that.option1.series.data[0].value = res[0].合格数; - that.option1.series.data[1].value = res[0].弯曲; - that.option1.series.data[2].value = res[0].条纹; - that.option1.series.data[3].value = res[0].断裂; - that.option1.series.data[4].value = res[0].偏壁; - that.option1.series.data[5].value = res[0].大小头; - that.option1.series.data[6].value = res[0].结石; - that.option1.series.data[7].value = res[0].气线; - that.option1.series.data[8].value = res[0].箱中破; + let data = res.data2.ds0; + if(data.length>0){ + that.tableData8 = data; + that.option1.series.data[0].value = data[0].合格数; + that.option1.series.data[1].value = data[0].弯曲; + that.option1.series.data[2].value = data[0].条纹; + that.option1.series.data[3].value = data[0].断裂; + that.option1.series.data[4].value = data[0].偏壁; + that.option1.series.data[5].value = data[0].大小头; + that.option1.series.data[6].value = data[0].结石; + that.option1.series.data[7].value = data[0].气线; + that.option1.series.data[8].value = data[0].箱中破; } // debugger; }); @@ -310,17 +305,18 @@ let obj = { query: { start_date: this.start_date, end_date: this.end_date, dept_name: "7车间" }, }; - let exec = that.queryType=='月'?'lineWeek':'lineMonth'; + let exec = that.queryType=='月'?'lineMonth':'lineYear'; that.$API.bi.dataset.exec.req(exec, obj).then((res) => { console.log('7生产车间统计:',res); - if(res.length>0){ - that.tableData7 = res; - that.option1.series.data[0].value = res[0].合格数; - that.option1.series.data[1].value = res[0].炸纹; - that.option1.series.data[2].value = res[0].条纹; - that.option1.series.data[3].value = res[0].气泡; - that.option1.series.data[4].value = res[0].弯曲; - that.option1.series.data[5].value = res[0].其他; + let data = res.data2.ds0; + if(data.length>0){ + that.tableData7 = data; + that.option1.series.data[0].value = data[0].合格数; + that.option1.series.data[1].value = data[0].炸纹; + that.option1.series.data[2].value = data[0].条纹; + that.option1.series.data[3].value = data[0].气泡; + that.option1.series.data[4].value = data[0].弯曲; + that.option1.series.data[5].value = data[0].其他; } }); }, @@ -328,20 +324,21 @@ let that = this; that.tableData10 = []; let obj = { - query: { start_date: this.start_date, end_date: this.end_date, dept_name: "10·车间" }, + query: { start_date: this.start_date, end_date: this.end_date, dept_name: "10车间" }, }; - let exec = that.queryType=='月'?'lineWeek':'lineMonth'; + let exec = that.queryType=='月'?'lineMonth':'lineYear'; that.$API.bi.dataset.exec.req(exec, obj).then((res) => { console.log('10生产车间统计:',res); - if(res.length>0){ - that.tableData10 = res; - that.option2.series.data[0].value = res[0].合格数; - that.option2.series.data[1].value = res[0].断裂; - that.option2.series.data[2].value = res[0].条纹; - that.option2.series.data[3].value = res[0].偏壁; - that.option2.series.data[4].value = res[0].大小头; - that.option2.series.data[5].value = res[0].结石; - that.option2.series.data[6].value = res[0].气线; + let data = res.data2.ds0; + if(data.length>0){ + that.tableData10 = data; + that.option2.series.data[0].value = data[0].合格数; + that.option2.series.data[1].value = data[0].断裂; + that.option2.series.data[2].value = data[0].条纹; + that.option2.series.data[3].value = data[0].偏壁; + that.option2.series.data[4].value = data[0].大小头; + that.option2.series.data[5].value = data[0].结石; + that.option2.series.data[6].value = data[0].气线; } }); },