fix(测试跟踪): 测试计划开始结束时间校验

This commit is contained in:
chenjianxing 2020-11-26 10:34:38 +08:00
parent ab31922cb7
commit 479beca209
1 changed files with 12 additions and 2 deletions

View File

@ -193,8 +193,7 @@ export default {
let param = {};
Object.assign(param, this.form);
param.name = param.name.trim();
if (param.name === '') {
this.$warning(this.$t('test_track.plan.input_plan_name'));
if (!this.validate(param)) {
return;
}
param.workspaceId = localStorage.getItem(WORKSPACE_ID);
@ -227,6 +226,17 @@ export default {
}
});
},
validate(param) {
if (param.name === '') {
this.$warning(this.$t('test_track.plan.input_plan_name'));
return false;
}
if (param.plannedStartTime > param.plannedEndTime) {
this.$warning(this.$t('commons.date.data_time_error'));
return false;
}
return true;
},
editTestPlan(param) {
this.$post('/test/plan/' + this.operationType, param, () => {
this.$success(this.$t('commons.save_success'));