diff --git a/src/components/rightBox/report/ReportBox.vue b/src/components/rightBox/report/ReportBox.vue index c77d8401..ac866f82 100644 --- a/src/components/rightBox/report/ReportBox.vue +++ b/src/components/rightBox/report/ReportBox.vue @@ -292,15 +292,9 @@ export default { if (time.getTime() > new Date()) { return true } - if (startTime.value !== '' && startTime.value > time) { - return true - } } const startDisabledDate = (time) => { - if (time.getTime() > new Date()) { - return true - } - if (endTime.value !== '' && endTime.value < time) { + if (time.getTime() > (new Date()).getTime()) { return true } } @@ -323,14 +317,14 @@ export default { } const startTimeValidator = (rule, value, callback) => { const form = proxy.$refs.reportForm - if (form.model && form.model.config && form.model.config.endTime) { + if (proxy.endTime || (proxy.editObject && proxy.editObject.config && proxy.editObject.config.endTime)) { form.validateField('config.endTime', () => null) } callback() } const endTimeValidator = (rule, value, callback) => { let validate = true - if (startTime.value !== '' && value <= startTime.value) { + if (startTime.value !== '' && endTime.value <= startTime.value) { validate = false } return validate diff --git a/src/views/report/Report.vue b/src/views/report/Report.vue index 491bd5e3..15302eb4 100644 --- a/src/views/report/Report.vue +++ b/src/views/report/Report.vue @@ -317,10 +317,17 @@ export default { type: 'warning' }).catch(() => {}) } else { - const curRecord = this.batchDeleteObjs[0] - this.initConfig(curRecord) - this.object = curRecord - this.rightBox.show = true + axios.get(`${this.url}/${this.batchDeleteObjs[0].id}`).then(response => { + if (response.status === 200) { + const curRecord = response.data.data + if (curRecord.config) { + curRecord.config = JSON.parse(curRecord.config) + } + this.initConfig(curRecord) + this.object = curRecord + this.rightBox.show = true + } + }) } }, initConfig (u) {