From 892989a0d40becd3353b9e8d49cc82b4ce3348b4 Mon Sep 17 00:00:00 2001 From: 123456 <17862666717> Date: Wed, 29 Jun 2022 13:40:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...pointvaccinesinoculation-add-or-update.vue | 42 +++++++++++++++++-- 1 file changed, 39 insertions(+), 3 deletions(-) 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 f6b4daa9..cc273057 100644 --- a/src/views/modules/plugins/point/icpointvaccinesinoculation-add-or-update.vue +++ b/src/views/modules/plugins/point/icpointvaccinesinoculation-add-or-update.vue @@ -263,11 +263,29 @@ export default { 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时间段的时间"); + let minute_0 = Number(this.morningTime[0].substring(3, 5)); + let minute_1 = Number(this.morningTime[1].substring(3, 5)); + let second_0 = Number(this.morningTime[0].substring(6, 8)); + let second_1 = Number(this.morningTime[1].substring(6, 8)); + if (hour_0 > 12 || hour_1 > 12) { + this.$message.error("请选择00:00-12:00时间段的时间"); this.morningTime = null; return false; } + if (hour_0 == 12) { + if(minute_0 > 0 || second_0 > 0){ + this.$message.error("请选择00:00-12:00时间段的时间"); + this.morningTime = null; + return false; + } + } + if (hour_1 == 12) { + if(minute_1 > 0 || second_1 > 0){ + this.$message.error("请选择00:00-12:00时间段的时间"); + this.morningTime = null; + return false; + } + } this.dataForm.moStartTime = this.morningTime[0]; this.dataForm.moEndTime = this.morningTime[1]; } @@ -276,11 +294,29 @@ export default { 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)); + let minute_0 = Number(this.afterTime[0].substring(3, 5)); + let minute_1 = Number(this.afterTime[1].substring(3, 5)); + let second_0 = Number(this.afterTime[0].substring(6, 8)); + let second_1 = Number(this.afterTime[1].substring(6, 8)); if (hour_0 < 12 || hour_1 < 12) { - this.$message.error("请选择12:00-23:59时间段的时间"); + this.$message.error("请选择12:01-23:59时间段的时间"); this.afterTime = null; return false; } + if (hour_0 == 12) { + if(minute_0 == 0 && second_0 == 0){ + this.$message.error("请选择12:01-23:59时间段的时间"); + this.afterTime = null; + return false; + } + } + if (hour_1 == 12) { + if(minute_1 == 0 && second_1 == 0){ + this.$message.error("请选择12:01-23:59时间段的时间"); + this.afterTime = null; + return false; + } + } this.dataForm.afStartTime = this.afterTime[0]; this.dataForm.afEndTime = this.afterTime[1]; }