fix(测试跟踪): 修复测试评审的截止时间可以早于当前时间的问题

This commit is contained in:
shiziyuan9527 2020-10-19 16:06:36 +08:00
parent 6cf026addc
commit 045f0fd180
1 changed files with 9 additions and 5 deletions

View File

@ -173,8 +173,9 @@ export default {
this.$warning(this.$t('test_track.plan.input_plan_name')); this.$warning(this.$t('test_track.plan.input_plan_name'));
return; return;
} }
if (this.operationType === 'save') {
this.compareTime(new Date().getTime(), this.form.endTime); if (!this.compareTime(new Date().getTime(), this.form.endTime)) {
return false;
} }
if (this.operationType === 'edit') { if (this.operationType === 'edit') {
@ -254,14 +255,17 @@ export default {
} }
}, },
endTimeChange(value) { endTimeChange(value) {
if (value) {
this.form.endTime = this.form.endTime.getTime(); this.form.endTime = this.form.endTime.getTime();
this.compareTime(new Date().getTime(), value.getTime()); this.compareTime(new Date().getTime(), value.getTime());
}
}, },
compareTime(ts1, ts2) { compareTime(ts1, ts2) {
if (ts1 > ts2) { if (ts1 > ts2) {
this.form.endTime = '';
this.$warning("截止时间不能早于当前时间!"); this.$warning("截止时间不能早于当前时间!");
return false;
} }
return true;
} }
} }
} }