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:{ mgroups:{
name: "获取可交接的工段", name: "获取可交接的工段",
req: async function (data) { req: async function (data) {

View File

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

View File

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