|
@@ -109,16 +109,26 @@ export async function queryDingSchema(params) {
|
|
|
return request(`/api/v1/purchase/bom/ding/schema?${stringify(params)}`);
|
|
|
}
|
|
|
export async function queryDingInstanceDetail(params) {
|
|
|
- return request(`/api/v1/purchase/bom/ding/instance-detail`, {
|
|
|
+ let res = await request(`/api/v1/purchase/bom/ding/instance-detail`, {
|
|
|
method: 'POST',
|
|
|
body: params,
|
|
|
});
|
|
|
+ if (res.data.errcode != 0) {
|
|
|
+ message.error(res.data.errmsg);
|
|
|
+ throw new Error(res.data.errmsg);
|
|
|
+ }
|
|
|
+ return res;
|
|
|
}
|
|
|
export async function queryDingInstanceExecute(params) {
|
|
|
- return request(`/api/v1/purchase/bom/ding/instance-execute`, {
|
|
|
+ let res = await request(`/api/v1/purchase/bom/ding/instance-execute`, {
|
|
|
method: 'POST',
|
|
|
body: params,
|
|
|
});
|
|
|
+ if (res.data.errcode != 0) {
|
|
|
+ message.error("审批失败,请联系管理员。");
|
|
|
+ throw new Error(res.data.errmsg);
|
|
|
+ }
|
|
|
+ return res;
|
|
|
}
|
|
|
export async function queryListParentByUser(params) {
|
|
|
return request(`/api/v1/purchase/bom/ding/department/list-parent-by-user`, {
|
|
@@ -339,6 +349,9 @@ export async function uploadFile(data) {
|
|
|
ContentType: 'application/x-www-form-urlencoded',
|
|
|
},
|
|
|
});
|
|
|
+ if (res.data.errcode != 0) {
|
|
|
+ throw new Error(res.data.errmsg);
|
|
|
+ }
|
|
|
return res.data;
|
|
|
}
|
|
|
|
|
@@ -346,5 +359,8 @@ export async function bindDDCode(userId, code) {
|
|
|
let res = await request(`/api/v1/purchase/bom/ding/set-ding-user-code?ucode=${userId}:${code}`, {
|
|
|
method: 'GET',
|
|
|
});
|
|
|
+ if (res.data.errcode != 0) {
|
|
|
+ throw new Error(res.data.errmsg);
|
|
|
+ }
|
|
|
return res.data;
|
|
|
}
|