Commit 4e333334 by hulei

保存按钮增加校验信息回显

parent 87956aa6
...@@ -12,12 +12,15 @@ export default { ...@@ -12,12 +12,15 @@ export default {
type: "success", type: "success",
}); });
this.$router.history.push("/business/trnrel"); this.$router.history.push("/business/trnrel");
} else { } else{
this.$notify({ this.$notify({
title: "失败", title: "失败",
message: "保存失败", message: "保存失败",
type: "error", type: "error",
}); });
if(Object.keys(result.fieldErrors).length > 0 ){
this.$notify.error({ title: "错误", message: result.respMsg });
}
} }
}, },
// 表单暂存 // 表单暂存
...@@ -41,9 +44,7 @@ export default { ...@@ -41,9 +44,7 @@ export default {
// 表单校验 // 表单校验
async handleCheck() { async handleCheck() {
let result = await this.checkAll(); let result = await this.checkAll();
if (result.respCode != SUCCESS && Object.keys(result.fieldErrors).length == 0) { if (result.respCode == SUCCESS && Object.keys(result.fieldErrors).length == 0) {
this.$notify.error({ title: "错误", message: result.respMsg });
} else {
// 清除之前的校验状态 // 清除之前的校验状态
this.$refs.modelForm.clearValidate(); this.$refs.modelForm.clearValidate();
const fields = this.$refs.modelForm.fields; const fields = this.$refs.modelForm.fields;
...@@ -55,6 +56,8 @@ export default { ...@@ -55,6 +56,8 @@ export default {
// tab切换之后,需出发tab-click的事件 // tab切换之后,需出发tab-click的事件
this.tabClick(tab); this.tabClick(tab);
} }
} else {
this.$notify.error({ title: "错误", message: result.respMsg });
} }
}, },
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment