Browse Source

fix:修改时间选择判断

master
123456 3 years ago
parent
commit
892989a0d4
  1. 42
      src/views/modules/plugins/point/icpointvaccinesinoculation-add-or-update.vue

42
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) { if (Array.isArray(this.morningTime) && this.morningTime.length > 0) {
let hour_0 = Number(this.morningTime[0].substring(0, 2)); let hour_0 = Number(this.morningTime[0].substring(0, 2));
let hour_1 = Number(this.morningTime[1].substring(0, 2)); let hour_1 = Number(this.morningTime[1].substring(0, 2));
if (hour_0 >= 12 || hour_1 >= 12) { let minute_0 = Number(this.morningTime[0].substring(3, 5));
this.$message.error("请选择00:00-11:59时间段的时间"); 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; this.morningTime = null;
return false; 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.moStartTime = this.morningTime[0];
this.dataForm.moEndTime = this.morningTime[1]; this.dataForm.moEndTime = this.morningTime[1];
} }
@ -276,11 +294,29 @@ export default {
if (Array.isArray(this.afterTime) && this.afterTime.length > 0) { if (Array.isArray(this.afterTime) && this.afterTime.length > 0) {
let hour_0 = Number(this.afterTime[0].substring(0, 2)); let hour_0 = Number(this.afterTime[0].substring(0, 2));
let hour_1 = Number(this.afterTime[1].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) { if (hour_0 < 12 || hour_1 < 12) {
this.$message.error("请选择12:00-23:59时间段的时间"); this.$message.error("请选择12:01-23:59时间段的时间");
this.afterTime = null; this.afterTime = null;
return false; 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.afStartTime = this.afterTime[0];
this.dataForm.afEndTime = this.afterTime[1]; this.dataForm.afEndTime = this.afterTime[1];
} }

Loading…
Cancel
Save