diff --git a/src/views/modules/plugins/point/icpointvaccinesinoculation-add-or-update.vue b/src/views/modules/plugins/point/icpointvaccinesinoculation-add-or-update.vue index e3430eea..b7b781a9 100644 --- a/src/views/modules/plugins/point/icpointvaccinesinoculation-add-or-update.vue +++ b/src/views/modules/plugins/point/icpointvaccinesinoculation-add-or-update.vue @@ -39,11 +39,11 @@ > - + - + 0) { - let hour_0 = Number(this.startTime[0].substring(0, 2)); - let hour_1 = Number(this.startTime[1].substring(0, 2)); + if (Array.isArray(this.morningTime) && this.morningTime.length > 0) { + let hour_0 = Number(this.morningTime[0].substring(0, 2)); + let hour_1 = Number(this.morningTime[1].substring(0, 2)); if (hour_0 >= 12 || hour_1 >= 12) { this.$message.error("请选择00:00-11:59时间段的时间"); - this.startTime = null; + this.morningTime = null; return false; } - this.dataForm.moStartTime = this.startTime[0]; - this.dataForm.moEndTime = this.startTime[1]; + this.dataForm.moStartTime = this.morningTime[0]; + this.dataForm.moEndTime = this.morningTime[1]; } }, endTimeChange() { - if (Array.isArray(this.endTime) && this.endTime.length > 0) { - let hour_0 = Number(this.endTime[0].substring(0, 2)); - let hour_1 = Number(this.endTime[1].substring(0, 2)); + if (Array.isArray(this.afterTime) && this.afterTime.length > 0) { + let hour_0 = Number(this.afterTime[0].substring(0, 2)); + let hour_1 = Number(this.afterTime[1].substring(0, 2)); if (hour_0 < 12 || hour_1 < 12) { this.$message.error("请选择12:00-23:59时间段的时间"); - this.endTime = null; + this.afterTime = null; return false; } - this.dataForm.afStartTime = this.endTime[0]; - this.dataForm.afEndTime = this.endTime[1]; + this.dataForm.afStartTime = this.afterTime[0]; + this.dataForm.afEndTime = this.afterTime[1]; } }, closeSubmit() { @@ -435,8 +435,8 @@ export default { ...this.dataForm, ...res.data, }; - this.startTime = [res.data.moStartTime,res.data.moEndTime] - this.endTime = [res.data.afStartTime,res.data.afEndTime] + this.morningTime = [res.data.moStartTime,res.data.moEndTime] + this.afterTime = [res.data.afStartTime,res.data.afEndTime] this.initMap(); }) .catch(() => {}); @@ -448,11 +448,11 @@ export default { if (!valid) { return false; } - if(this.startTime === null){ + if(this.morningTime === null){ this.$message.error('请填写上午接种时间'); return false } - if(this.endTime === null ){ + if(this.afterTime === null ){ this.$message.error('请填写下午接种时间'); return false }