From 14e2fe211dd9e2166a4d4e64ec2124fa5bf4bf3a Mon Sep 17 00:00:00 2001 From: shijing Date: Wed, 28 Aug 2024 14:02:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=85=89=E8=8A=AF=E5=90=88=E6=A0=BC?= =?UTF-8?q?=E6=95=B0=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/statistics/pass_num_gx.vue | 83 ++++++++++++++++++---------- 1 file changed, 55 insertions(+), 28 deletions(-) diff --git a/src/views/statistics/pass_num_gx.vue b/src/views/statistics/pass_num_gx.vue index a1885073..c8aa0265 100644 --- a/src/views/statistics/pass_num_gx.vue +++ b/src/views/statistics/pass_num_gx.vue @@ -13,7 +13,7 @@ 0) { - let seriesData = [], - nameList = []; + let dataList = [], + nameList = [], + datas = []; tableData.forEach((ite) => { - if (nameList.indexOf(ite.物料名) > -1) { - } else { + if (nameList.indexOf(ite.物料名) > -1) {} else { nameList.push(ite.物料名); - seriesData.push(0); + datas.push([0,0,0,0,0,0,0]); } }); + that.xAxisData = nameList; tableData.forEach((item) => { let indexX = nameList.indexOf(item.物料名); - seriesData[indexX] += item.合格数; + dataList[indexX].push(item); }); + for(let i = 0;i { + let obj = { + data: datas[index], + stack: "Ad", + type: "bar", + barWidth: "15px", + }; + ption.series[index].data = serisData; + }); that.setChart("bachart1", option); } else { that.setChart("bachart1", option); @@ -227,9 +256,7 @@ export default { }); }, handleQuery() { - let that = this; - that.query.end_date = that.query.start_date ; - that.getData(); + this.getWeekDate(this.queryDate); }, handleExport(val) { this.exportLoading = true;