From 678fa7d9024d1dd18481e71e3a48f06bc54b6e30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AD=A3=E6=98=93?= Date: Tue, 2 Jul 2024 13:24:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A8=E9=87=8F=E6=8A=A5=E8=A1=A8=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=97=A5=E6=9C=9F=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FQC/qualityStatistics.vue | 61 ++++++++++++++++--- 1 file changed, 51 insertions(+), 10 deletions(-) diff --git a/src/views/qualityManagement/FQC/qualityStatistics.vue b/src/views/qualityManagement/FQC/qualityStatistics.vue index a79d7b0..f3d8d1e 100644 --- a/src/views/qualityManagement/FQC/qualityStatistics.vue +++ b/src/views/qualityManagement/FQC/qualityStatistics.vue @@ -4,11 +4,11 @@
- + - + @@ -189,7 +189,7 @@ downloadStatisticsTableExcel } from '@/api/qualityManagement/qualityStatistics_V2' export default { - name: 'qualityStatistics', + name: 'QualityStatistics', data() { return { inputWidth: '180px', @@ -219,8 +219,8 @@ }, ], }, search: { - starttime: new Date(new Date(new Date().toLocaleDateString()).getTime()), - endtime: new Date(new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1), + starttime: null, + endtime: null, team: null, workorderid: null, partnumber: null, @@ -284,11 +284,52 @@ }, } }, + watch: { + 'search.starttime'(newValue, oldValue) { + if (newValue != null && newValue != oldValue) { + try { + window.sessionStorage.setItem('QualityStatisticsStartTime', JSON.stringify(newValue)) + } catch (err) { + + } + } + }, + 'search.endtime'(newValue, oldValue) { + if (newValue != null && newValue != oldValue) { + try { + window.sessionStorage.setItem('QualityStatisticsEndTime', JSON.stringify(newValue)) + } catch (err) { + + } + } + } + }, mounted() { this.getList() }, - created() {}, + created() { + this.init(); + }, methods: { + init() { + const QualityStatisticsStartTime = JSON.parse(window.sessionStorage.getItem("QualityStatisticsStartTime")); + const QualityStatisticsEndTime = JSON.parse(window.sessionStorage.getItem("QualityStatisticsEndTime")); + if (this.search.starttime == null) { + if (QualityStatisticsStartTime) { + this.search.starttime = QualityStatisticsStartTime; + } else { + this.search.starttime = this.$dayjs().startOf('day').toDate(); + } + } + if (this.search.endtime == null) { + if (QualityStatisticsEndTime) { + this.search.endtime = QualityStatisticsEndTime; + } else { + this.search.endtime = this.$dayjs().endOf('day').toDate(); + } + + } + }, //todo 设置表合并行 mergeTable(num) { this.mergeCells = [] @@ -455,13 +496,13 @@ $table.resetColumn(); this.resetMergeTable(); }, - resetMergeTable(){ - if(this.search.reportType === 3){ + resetMergeTable() { + if (this.search.reportType === 3) { this.mergeTable(2); - }else{ + } else { this.mergeTable(3); } - + }, // 删除数据 removeData(row) {