From 2febe5a12a973f9e66e9912229e37ed5d1f97ba1 Mon Sep 17 00:00:00 2001 From: lb Date: Mon, 7 Aug 2023 10:46:26 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=A3=80=E6=B5=8B=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=20search=20time?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/summaryTable.vue | 11 ++-- .../monitoring/qualityStatistics/index.vue | 62 ++++++++++++------- 2 files changed, 47 insertions(+), 26 deletions(-) diff --git a/src/views/quality/monitoring/qualityStatistics/components/summaryTable.vue b/src/views/quality/monitoring/qualityStatistics/components/summaryTable.vue index dad49dac..34250cc4 100644 --- a/src/views/quality/monitoring/qualityStatistics/components/summaryTable.vue +++ b/src/views/quality/monitoring/qualityStatistics/components/summaryTable.vue @@ -9,6 +9,7 @@ @@ -40,27 +41,27 @@ export default { }, tableProps: [ { - prop: 'pl', + prop: 'lineName', label: '产线', align: 'center', }, { - prop: 'upTotal', + prop: 'sumUp', label: '上片总数', align: 'center', }, { - prop: 'downTotal', + prop: 'sumDown', label: '下片总数', align: 'center', }, { - prop: 'total', + prop: 'sumCheck', label: '检测总数', align: 'center', }, { - prop: 'ratio', + prop: 'scrapRatio', label: '比例(%)', align: 'center', }, diff --git a/src/views/quality/monitoring/qualityStatistics/index.vue b/src/views/quality/monitoring/qualityStatistics/index.vue index f66fad69..f3c69bd7 100644 --- a/src/views/quality/monitoring/qualityStatistics/index.vue +++ b/src/views/quality/monitoring/qualityStatistics/index.vue @@ -62,12 +62,13 @@ export default { dateType: 'daterange', // datetimerange // format: 'yyyy-MM-dd HH:mm:ss', format: 'yyyy-MM-dd', - valueFormat: 'yyyy-MM-dd HH:mm:ss', + // valueFormat: 'yyyy-MM-dd HH:mm:ss', + valueFormat: 'timestamp', rangeSeparator: '-', startPlaceholder: '开始日期', endPlaceholder: '结束日期', defaultTime: ['00:00:00', '23:59:59'], - param: 'checkTime', + param: 'timerange', }, { type: 'button', @@ -219,6 +220,7 @@ export default { queryParams: { pageNo: 1, pageSize: 10, + param: null, }, summaryList: [], summaryOpen: false, @@ -283,32 +285,41 @@ export default { }, /** 获取 检测总数 列表 */ async getSummaryList() { - const response = await this.$axios( - '/monitoring/statistical-data/getUpPart', - { - params: { - startTime: '2023-07-01 00:00:00', - endTime: '2023-08-10 00:00:00', + const response = await this.$axios({ + url: '/monitoring/statistical-data/getUpPart', + method: 'get', + params: this.queryParams.param ? { + param: { + // startTime: new Date(2022, 6, 1, 0, 0, 0).getTime(), // '2023-07-01 00:00:00', + // endTime: new Date(2023, 7, 10, 0, 0, 0).getTime(), // '2023-08-10 00:00:00', + startTime: this.queryParams.param.startTime, + endTime: this.queryParams.param.endTime }, - } - ); + } : null + }); this.summaryList = response.data; + console.log('summaryList', this.summaryList); }, /** 获取 检测内容和产线关联 列表 */ async getDetailedList() { const { data: { data, otherList, otherMap, nameData }, - } = await this.$axios('/monitoring/statistical-data/getDownPart', { - params: { - startTime: '2023-07-01 00:00:00', - endTime: '2023-08-10 00:00:00', - }, + } = await this.$axios({ + url: '/monitoring/statistical-data/getDownPart', + params: this.queryParams.param ? { + param: { + // startTime: new Date(2023, 6, 1).getTime(), // '2023-07-01 00:00:00', + // endTime: new Date(2023, 7, 22).getTime(), // '2023-08-10 00:00:00', + startTime: this.queryParams.param.startTime, + endTime: this.queryParams.param.endTime + }, + } : null }); // this.list = response.data; - console.log("data", data); - console.log("otherList", otherList); - console.log("otherMap", otherMap); - console.log("nameData", nameData); + console.log('data', data); + console.log('otherList', otherList); + console.log('otherMap', otherMap); + console.log('nameData', nameData); }, /** 总览关闭 */ handleSummaryClose() { @@ -316,10 +327,15 @@ export default { }, /** 搜索按钮 */ handleSearchBarBtnClick(btn) { + console.log('bnt, ', btn); switch (btn.btnName) { case 'search': - this.queryParams[key] = btn[key] || null; - // this.handleQuery(); + if (btn.timerange && typeof btn.timerange === 'object') { + this.queryParams.param = {} + this.$set(this.queryParams.param, 'startTime', btn.timerange[0]); + this.$set(this.queryParams.param, 'endTime', btn.timerange[1]); + } + this.handleQuery(); break; case 'summary': this.summaryOpen = true; @@ -336,6 +352,10 @@ export default { break; } }, + handleQuery() { + this.getSummaryList(); + this.getDetailedList(); + }, /** 处理表格事件 */ handleEmitFun() {}, },