Commit f96dfed7 by Joey

fix(@gms/gms-plugin-billexpand): 保存和审批按钮报错信息

parent 1bfe9f4c
...@@ -8,7 +8,8 @@ export default { ...@@ -8,7 +8,8 @@ export default {
let selectedApprovers = [] let selectedApprovers = []
window.GMS.$http.get(`/bpm/bill/selectApprover/ApproverList/${taskId}`).then((res) => { window.GMS.$http.get(`/bpm/bill/selectApprover/ApproverList/${taskId}`).then((res) => {
if (res.data.code != 200) { if (res.data.code != 200) {
this.executeApproval(bill, param) // this.executeApproval(bill, param)
GMS.$hideContainer.$Message.error(res.data.msg || '获取审批人列表失败');
return return
} }
const nodeData = res.data.ApproverVo const nodeData = res.data.ApproverVo
...@@ -47,7 +48,7 @@ export default { ...@@ -47,7 +48,7 @@ export default {
} }
}); });
}).catch(() => { }).catch(() => {
GMS.$hideContainer.$message.error('获取审批人列表失败'); GMS.$hideContainer.$Message.error('获取审批人列表失败');
}) })
} else { } else {
alert('缺少参数'); alert('缺少参数');
......
import Bridge from '../components-control/util/bridge' import Bridge from '../components-control/util/bridge'
import typesBill from '../components-control/typesBill.vue'; import typesBill from '../components-control/typesBill.vue';
import errorMessageUtil from "./util/errorMessageUtil";
import { getUUID } from "../query-actions/util/lib"; import { getUUID } from "../query-actions/util/lib";
export default { export default {
...@@ -47,8 +48,11 @@ export default { ...@@ -47,8 +48,11 @@ export default {
// }) // })
// } // }
} else if (code === 201) { } else if (code === 201) {
GMS.$hideContainer.$Spin.hide(); GMS.$hideContainer.$Spin.hide()
GMS.$hideContainer.$Message.error("提交失败"); data.message && GMS.$hideContainer.$Message.error({
content: errorMessageUtil.submitAction.getErrorMessage(data.message),
duration: 3
});
} else if (code === 202) { } else if (code === 202) {
GMS.$hideContainer.$Spin.hide(); GMS.$hideContainer.$Spin.hide();
GMS.$hideContainer.$Message.error("暂存单据异常请联系管理员"); GMS.$hideContainer.$Message.error("暂存单据异常请联系管理员");
......
...@@ -36,5 +36,27 @@ export default { ...@@ -36,5 +36,27 @@ export default {
} }
return errorPreMessage === "" ? this.commonMessage : errorPreMessage + this.getErrorBaseDataName(a); return errorPreMessage === "" ? this.commonMessage : errorPreMessage + this.getErrorBaseDataName(a);
} }
},
submitAction: {
commonMessage: "提交失败,请联系系统管理员。",
customMessageList: [
{
preMessage: "No participant founds for user task",
convertMessage: "提交失败,没有找到下一步审批人",
}
],
getErrorMessage(a) {
if (!a || !_.isString(a)) {
return this.commonMessage
}
let errorPreMessage = "";
for (let i = 0; i < this.customMessageList.length; i++) {
if (a.indexOf(this.customMessageList[i].preMessage) > -1) {
errorPreMessage = this.customMessageList[i].convertMessage
break
}
}
return errorPreMessage === "" ? this.commonMessage : errorPreMessage
}
} }
} }
\ No newline at end of file
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