From dcda3a62940186eb00b4af00ecac4a1ce121bcc6 Mon Sep 17 00:00:00 2001 From: lb Date: Fri, 22 Sep 2023 10:54:21 +0800 Subject: [PATCH] bugfix --- .../qualityInspectionBoxBtn/dialogForm.vue | 13 ++- .../qualityInspectionRecord/index.vue | 3 +- .../monitoring/qualityStatistics/index.vue | 86 +++++++++++-------- 3 files changed, 61 insertions(+), 41 deletions(-) diff --git a/src/views/quality/base/qualityInspectionBoxBtn/dialogForm.vue b/src/views/quality/base/qualityInspectionBoxBtn/dialogForm.vue index 141266eb..11653f55 100644 --- a/src/views/quality/base/qualityInspectionBoxBtn/dialogForm.vue +++ b/src/views/quality/base/qualityInspectionBoxBtn/dialogForm.vue @@ -54,6 +54,7 @@ label="按钮盒识别码" prop="buttonId" :rules="[ + { required: true, message: '不能为空', trigger: 'blur' }, { type: 'number', message: '请输入整数', @@ -98,12 +99,16 @@ label="按钮值" prop="keyValue" :rules="[ + { required: true, message: '不能为空', trigger: 'blur' }, { type: 'number', message: '请输入100以内的整数', trigger: 'blur', transform: (val) => - Number(val) <= 100 && Number.isInteger(+val) && Number(val), + Number.isInteger(+val) && + Number(val) >= 0 && + Number(val) <= 100 && + Number(val), }, ]"> moment(val).format('yyyy-MM-DD HH:mm:ss'), + filter: (val) => + val != null ? moment(val).format('yyyy-MM-DD HH:mm:ss') : '-', }, { width: 90, diff --git a/src/views/quality/monitoring/qualityStatistics/index.vue b/src/views/quality/monitoring/qualityStatistics/index.vue index b5b7a100..2c3fa236 100644 --- a/src/views/quality/monitoring/qualityStatistics/index.vue +++ b/src/views/quality/monitoring/qualityStatistics/index.vue @@ -332,33 +332,51 @@ export default { }, mounted() { if (this.$route.params.startTime && this.$route.params.endTime) { - this.searchBarFormConfig[0].defaultSelect = [this.$route.params.startTime, this.$route.params.endTime] + this.searchBarFormConfig[0].defaultSelect = [ + this.$route.params.startTime, + this.$route.params.endTime, + ]; this.queryParams.param = {}; - this.$set(this.queryParams.param, 'startTime', this.$route.params.startTime); + this.$set( + this.queryParams.param, + 'startTime', + this.$route.params.startTime + ); this.$set(this.queryParams.param, 'endTime', this.$route.params.endTime); - } else { - this.searchBarFormConfig[0].defaultSelect = [] - } + } else { + this.searchBarFormConfig[0].defaultSelect = []; + } this.getList(); }, watch: { - $route: 'initData' - }, + $route: 'initData', + }, methods: { initData(to) { // console.log(to) - if (to.name === 'QualityStatistics') { - if (this.$route.params.startTime && this.$route.params.endTime) { - this.searchBarFormConfig[0].defaultSelect = [this.$route.params.startTime, this.$route.params.endTime] + if (to.name === 'QualityStatistics') { + if (this.$route.params.startTime && this.$route.params.endTime) { + this.searchBarFormConfig[0].defaultSelect = [ + this.$route.params.startTime, + this.$route.params.endTime, + ]; this.queryParams.param = {}; - this.$set(this.queryParams.param, 'startTime', this.$route.params.startTime); - this.$set(this.queryParams.param, 'endTime', this.$route.params.endTime); + this.$set( + this.queryParams.param, + 'startTime', + this.$route.params.startTime + ); + this.$set( + this.queryParams.param, + 'endTime', + this.$route.params.endTime + ); } else { - this.searchBarFormConfig[0].defaultSelect = [] + this.searchBarFormConfig[0].defaultSelect = []; } this.getList(); } - }, + }, getList() { this.getSummaryList(); this.getDetailedList(); @@ -367,20 +385,17 @@ export default { async getSummaryList() { const response = await this.$axios({ url: '/monitoring/statistical-data/getUpPart', - method: 'get', - params: this.queryParams.param + method: 'post', + data: 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, - }, + // 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() { @@ -388,22 +403,21 @@ export default { data: { data, otherList, otherMap, nameData }, } = await this.$axios({ url: '/monitoring/statistical-data/getDownPart', - params: this.queryParams.param + method: 'post', + data: 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, - }, + // 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); this.dynamicProps = this.filterNameData(nameData); this.list = this.filterData(data);