From a1b436d38f07607e94b2e6d7d3e8c29d6114ea43 Mon Sep 17 00:00:00 2001 From: shijing Date: Mon, 29 Jul 2024 10:57:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=BB=BC=E5=90=88=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A3=80=E9=AA=8C=E5=90=88=E6=A0=BC=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/statistics/total_statistics.vue | 100 ++++++++++++++++++++-- 1 file changed, 94 insertions(+), 6 deletions(-) diff --git a/src/views/statistics/total_statistics.vue b/src/views/statistics/total_statistics.vue index 332214bc..008272a5 100644 --- a/src/views/statistics/total_statistics.vue +++ b/src/views/statistics/total_statistics.vue @@ -4,7 +4,24 @@ -

棒数据

+ +

棒数据

+
+ + + +
+
+ +
@@ -99,6 +121,11 @@ + +
@@ -118,9 +145,23 @@ export default { tableData22: [], bangHeight: 300, guanHeight: 500, + query: { + date: "", + }, }; }, mounted() { + let date = new Date(); + let year = date.getFullYear(); + let month = date.getMonth() + 1; + let day = date.getDate(); + this.year = year; + this.month = month; + month = month < 10 ? "0" + month : month; + day = day < 10 ? "0" + day : day; + this.day = day; + this.query.date = `${year}-${month}-${day}`; + console.log(this.query.date); this.getSourceData(); this.bangHeight = document.getElementById("bangTable").offsetHeight - 20; @@ -129,17 +170,62 @@ export default { }, created() {}, methods: { + getCountOk() { + let that = this; + let params = { + query: { + start_date: that.query.date, + end_date: that.query.date, + + // start_date: "2024-01-16", + // end_date: "2024-01-16", + }, + }; + that.$API.bi.dataset.exec + .req("count_ok_day", params) + .then((res) => { + console.log(res); + let datas = res.data2.ds0; + datas.forEach((item) => { + let bang_model = "", + guan_model = ""; + if (item.型号.indexOf("+") > -1) { + bang_model = item.型号.split("+")[0]; + guan_model = item.型号.split("+")[1]; + } else { + bang_model = guan_model = item.型号; + } + that.tableData11.forEach((item1) => { + if (item1.版型 == bang_model) { + item1.检验合格数 += item.合格数; + } + }); + that.tableData22.forEach((item2) => { + if (item2.版型 == guan_model) { + item2.检验合格数 += item.合格数; + } + }); + }); + }); + }, //获取表格原始数据 getSourceData() { let that = this; - that.$API.bi.dataset.exec.req("gz_zh").then((res) => { + let obj = {}; + obj.timex__year = that.year; + obj.timex__month = that.month; + obj.timex__day = that.day; + obj.page = 0; + that.$API.bi.dataset.record.req(obj).then((res) => { // let res = that.mockData; - let data_b = [...res.data2.ds0, ...res.data2.ds2]; - let data_g = [...res.data2.ds1, ...res.data2.ds3]; - this.data_b = data_b; - this.data_g = data_g; + let datas = res[0].result.data2; + let data_b = [...datas.ds0, ...datas.ds2]; + let data_g = [...datas.ds1, ...datas.ds3]; + that.data_b = data_b; + that.data_g = data_g; that.getDataB(data_b); that.getDataG(data_g); + that.getCountOk(); }); }, //棒数据 @@ -181,6 +267,7 @@ export default { 开槽: 0, 配管: 0, 合计: 0, + 检验合格数: 0, }; itemArr.forEach((item1) => { obj.版型 = item1.型号; @@ -289,6 +376,7 @@ export default { 倒角: 0, 配棒: 0, 合计: 0, + 检验合格数: 0, }; item4.forEach((item5) => { let key = "";