fix:分批合批报废交接更换接口

This commit is contained in:
shijing 2025-03-24 16:54:48 +08:00
parent 2a685608a4
commit b56e82df7a
3 changed files with 65 additions and 64 deletions

View File

@ -422,6 +422,14 @@ export default {
);
},
},
createsubmit: {
name: "创建并提交",
req: async function (data) {
return await http.post(
`${config.API_URL}/wpm/handover/create_and_submit/`,data
);
},
},
mgroups:{
name: "获取可交接的工段",
req: async function (data) {

View File

@ -582,7 +582,6 @@ export default {
that.getWprList(item.id,index);
})
}
that.totalCount = totalCount;
that.form.handoverb = data;
},
@ -630,39 +629,39 @@ export default {
that.form.mtype = 30;
that.form.recive_mgroup = that.form.send_mgroup;
}
if (that.mode == "add") {
that.$API.wpm.handover.create.req(that.form).then((res) => {
if(that.type==40||that.mtype==30){
//
that.$API.wpm.handover.submit.req(res.id).then((res1) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
});
}else{
//
if(that.mtype==20||that.mtype==30||that.type==40){
that.$API.wpm.handover.createsubmit.req(that.form).then((res) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
}).catch((err) => {
that.isSaveing = false;
return err;
});
}else{
if (that.mode == "add") {
that.$API.wpm.handover.create.req(that.form).then((res) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
}
}).catch((err) => {
//
that.isSaveing = false;
return err;
});
} else if (that.mode == "edit") {
that.$API.wpm.handover.update.req(that.form.id, that.form).then((res) => {
that.isSaveing = false;
that.$emit("success", that.form, that.mode);
that.visible = false;
that.$message.success("操作成功");
})
.catch((err) => {
//
that.isSaveing = false;
return err;
});
}).catch((err) => {
that.isSaveing = false;
return err;
});
} else if (that.mode == "edit") {
that.$API.wpm.handover.update.req(that.form.id, that.form).then((res) => {
that.isSaveing = false;
that.$emit("success", that.form, that.mode);
that.visible = false;
that.$message.success("操作成功");
}).catch((err) => {
that.isSaveing = false;
return err;
});
}
}
}
});

View File

@ -524,44 +524,38 @@ export default {
let that = this;
that.$refs.dialogForm.validate(async (valid) => {
if (valid) {
if (that.mode == "add") {
if(that.mtype==30){
that.form.mtype =30;
that.form.recive_user = that.form.send_user;
that.form.recive_mgroup = that.form.send_mgroup;
}
that.$API.wpm.handover.create.req(that.form).then((res) => {
if(that.type==40||that.mtype==20||that.mtype==30){
//
that.$API.wpm.handover.submit.req(res.id).then((res1) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
});
}else{
if(that.mtype==20||that.mtype==30||that.type==40){
that.$API.wpm.handover.createsubmit.req(that.form).then((res) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
}).catch((err) => {
that.isSaveing = false;
return err;
});
}else{
if (that.mode == "add") {
that.$API.wpm.handover.create.req(that.form).then((res) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
}
}).catch((err) => {
//
that.isSaveing = false;
return err;
});
} else if (that.mode == "edit") {
that.$API.wpm.handover.update.req(that.form.id, that.form).then((res) => {
that.isSaveing = false;
that.$emit("success", that.form, that.mode);
that.visible = false;
that.$message.success("操作成功");
})
.catch((err) => {
//
that.isSaveing = false;
return err;
});
}).catch((err) => {
that.isSaveing = false;
return err;
});
} else if (that.mode == "edit") {
that.$API.wpm.handover.update.req(that.form.id, that.form).then((res) => {
that.isSaveing = false;
that.$emit("success", that.form, that.mode);
that.visible = false;
that.$message.success("操作成功");
}).catch((err) => {
that.isSaveing = false;
return err;
});
}
}
}
});