Commit f96dfed7 by Joey

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

parent 1bfe9f4c
......@@ -8,7 +8,8 @@ export default {
let selectedApprovers = []
window.GMS.$http.get(`/bpm/bill/selectApprover/ApproverList/${taskId}`).then((res) => {
if (res.data.code != 200) {
this.executeApproval(bill, param)
// this.executeApproval(bill, param)
GMS.$hideContainer.$Message.error(res.data.msg || '获取审批人列表失败');
return
}
const nodeData = res.data.ApproverVo
......@@ -47,7 +48,7 @@ export default {
}
});
}).catch(() => {
GMS.$hideContainer.$message.error('获取审批人列表失败');
GMS.$hideContainer.$Message.error('获取审批人列表失败');
})
} else {
alert('缺少参数');
......
import Bridge from '../components-control/util/bridge'
import typesBill from '../components-control/typesBill.vue';
import errorMessageUtil from "./util/errorMessageUtil";
import { getUUID } from "../query-actions/util/lib";
export default {
......@@ -47,8 +48,11 @@ export default {
// })
// }
} else if (code === 201) {
GMS.$hideContainer.$Spin.hide();
GMS.$hideContainer.$Message.error("提交失败");
GMS.$hideContainer.$Spin.hide()
data.message && GMS.$hideContainer.$Message.error({
content: errorMessageUtil.submitAction.getErrorMessage(data.message),
duration: 3
});
} else if (code === 202) {
GMS.$hideContainer.$Spin.hide();
GMS.$hideContainer.$Message.error("暂存单据异常请联系管理员");
......
......@@ -36,5 +36,27 @@ export default {
}
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