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,24 +629,25 @@ 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.$API.wpm.handover.submit.req(res.id).then((res1) => {
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) => {
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; that.isSaveing = false;
return err; return err;
}); });
@ -657,14 +657,13 @@ export default {
that.$emit("success", that.form, that.mode); that.$emit("success", that.form, that.mode);
that.visible = false; that.visible = false;
that.$message.success("操作成功"); that.$message.success("操作成功");
}) }).catch((err) => {
.catch((err) => {
//
that.isSaveing = false; that.isSaveing = false;
return err; return err;
}); });
} }
} }
}
}); });
}, },
// //

View File

@ -524,29 +524,24 @@ 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.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.isSaveing = false;
that.$emit("success"); that.$emit("success");
that.visible = false; that.visible = false;
that.$message.success("操作成功"); that.$message.success("操作成功");
}).catch((err) => {
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; that.isSaveing = false;
return err; return err;
}); });
@ -556,14 +551,13 @@ export default {
that.$emit("success", that.form, that.mode); that.$emit("success", that.form, that.mode);
that.visible = false; that.visible = false;
that.$message.success("操作成功"); that.$message.success("操作成功");
}) }).catch((err) => {
.catch((err) => {
//
that.isSaveing = false; that.isSaveing = false;
return err; return err;
}); });
} }
} }
}
}); });
}, },
// //