fix:分批合批报废交接更换接口
This commit is contained in:
parent
2a685608a4
commit
b56e82df7a
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue