修复:调整延时解锁创建校验规则(仅当延续保护线路存在时,进行解锁区段解锁时间校验,否则直接放弃创建或删除延续保护)

This commit is contained in:
fan 2019-12-23 13:32:11 +08:00
parent 065a3ba72e
commit 663d43c5d2

View File

@ -277,40 +277,40 @@ export default {
this.createProtect('saveProtectSuccess');
},
update() {
if (this.addModel.code && this.addModel.unlockSectionCode && this.addModel.relSectionSwitchList.length) {
if (this.addModel.code && this.addModel.unlockSectionCode && this.addModel.relSectionSwitchList.length && this.addModel.unlockTime) {
const model = this.buildModel();
putContinueProtect(model).then(resp => {
this.$emit('updateProtectSuccess', model.code);
}).catch(() => {
this.$messageBox('更新延续保护失败!');
});
} else if (this.addModel.code && !this.addModel.unlockSectionCode && !this.addModel.relSectionSwitchList.length) {
} else if (this.addModel.code && !this.addModel.relSectionSwitchList.length) {
delContinueProtect(this.addModel.id).then(resp => {
this.$emit('updateProtectSuccess', '');
});
} else if (this.addModel.code && !this.addModel.unlockSectionCode && this.addModel.relSectionSwitchList.length) {
this.$messageBox('请填写延续保护解锁区段或清除延续保护相关数据!');
} else if (this.addModel.code && this.addModel.unlockSectionCode && !this.addModel.relSectionSwitchList.length) {
this.$messageBox('请生成延续保护线路或清除延续保护相关数据!');
} else if (this.addModel.code && !this.addModel.unlockSectionCode) {
this.$messageBox('请填写延续保护解锁区段或清除延续保护线路相关数据!');
} else if (this.addModel.code && this.addModel.unlockTime) {
this.$messageBox('请填写延续保护解锁时间或清除延续保护线路相关数据!');
} else {
this.createProtect('updateProtectSuccess');
}
},
createProtect(parentFunction) {
if (this.addModel.unlockSectionCode && this.addModel.relSectionSwitchList.length) {
if (this.addModel.unlockSectionCode && this.addModel.relSectionSwitchList.length && this.addModel.unlockTime) {
const model = this.buildModel(setUID('Protect'));
postContinueProtect(model).then(resp => {
this.$emit(parentFunction, model.code);
}).catch(() => {
this.$messageBox('创建延续保护失败!');
});
} else if (!this.addModel.unlockSectionCode && !this.addModel.relSectionSwitchList.length) {
} else if (!this.addModel.relSectionSwitchList.length) {
this.$emit(parentFunction, '');
} else {
if (!this.addModel.unlockSectionCode) {
this.$messageBox('请填写延续保护解锁区段或清除延续保护相关数据!');
} else if (!this.addModel.relSectionSwitchList.length) {
this.$messageBox('请生成延续保护线路或清除延续保护相关数据!');
this.$messageBox('请填写延续保护解锁区段或清除延续保护线路相关数据!');
} else if (!this.addModel.unlockTime.length) {
this.$messageBox('请填写延续保护解锁时间或清除延续保护线路相关数据!');
}
}
},