流程保存

This commit is contained in:
宋伟佳
2021-08-09 16:06:56 +08:00
parent 5a12b79c43
commit ef0242e7b6
7 changed files with 244 additions and 121 deletions
@@ -678,7 +678,6 @@ export default {
taskIds: this.taskIds, taskIds: this.taskIds,
pId: this.pId pId: this.pId
}).then(res => { }).then(res => {
console.log(res.mesg)
if (res) { if (res) {
const processForm = JSON.parse(res.mesg) const processForm = JSON.parse(res.mesg)
this.getFormFieldList(processForm) this.getFormFieldList(processForm)
@@ -718,22 +717,19 @@ export default {
this.saveLoading = true; this.saveLoading = true;
let _formData = new FormData(); let _formData = new FormData();
_formData.append("id", this.bpnId || ""); _formData.append("id", this.bpnId || "");
_formData.append("createUser", this.$store.getters.userInfo.userId);
_formData.append("createUserName", this.$store.getters.userInfo.userName);
_formData.append("prcType", "4"); _formData.append("prcType", "4");
_formData.append('taskIds', this.taskIds) _formData.append('taskIds', this.taskIds)
_formData.append("json", JSON.stringify({ _formData.append("json", JSON.stringify({
form: this.listForm, form: this.listForm,
commentText: this.commentText commentText: this.commentText
})); }));
saveTaskForPub(_formData).then(res => {
// saveTaskForPub(_formData).then(res => { this.saveLoading = false;
// this.saveLoading = false; this.$message.success("保存成功");
// this.$message.success("保存成功"); this.bpnId = res.result;
// this.bpnId = res.result; }).catch(e => {
// }).catch(e => { this.saveLoading = false;
// this.saveLoading = false; });
// });
}, },
//提交事件 //提交事件
handleSubmit() { handleSubmit() {
@@ -222,7 +222,7 @@
import ProcessHeader from "../../components/ProcessHeader"; import ProcessHeader from "../../components/ProcessHeader";
import ProcessFooter from "../../components/ProcessFooter"; import ProcessFooter from "../../components/ProcessFooter";
import ProcessTitle from "../../components/ProcessTitle"; import ProcessTitle from "../../components/ProcessTitle";
import { inboundLiaisonDetail, queryDetail } from "api/process"; import { inboundLiaisonDetail, saveTaskForPub } from "api/process";
export default { export default {
name: "xmpgStep3", name: "xmpgStep3",
@@ -348,7 +348,6 @@ export default {
taskIds: this.taskIds, taskIds: this.taskIds,
pId: this.pId pId: this.pId
}).then(res => { }).then(res => {
console.log(res.mesg)
if (res) { if (res) {
const processForm = JSON.parse(res.mesg); const processForm = JSON.parse(res.mesg);
this.getFormFieldList(processForm); this.getFormFieldList(processForm);
@@ -362,36 +361,41 @@ export default {
*/ */
getFormFieldList(item) { getFormFieldList(item) {
this.listForm = JSON.parse(JSON.stringify(item)); this.listForm = JSON.parse(JSON.stringify(item));
this.listForm.prcNum = this.prcNum; if(item.form === undefined){
this.listForm.prcName = this.prcName; this.listForm.prcNum = this.prcNum;
this.listForm["id"] = item.id; this.listForm.prcName = this.prcName;
this.listForm = JSON.parse(JSON.stringify(item.pepdtos[0])); this.listForm["id"] = item.id;
this.listForm.breakdownList = []; this.listForm = JSON.parse(JSON.stringify(item.pepdtos[0]));
for (let i = 0; i < item.pepdtos.length; i++) { this.listForm.breakdownList = [];
for (let j = 0; j < item.pepdtos[i].breakdownList.length; j++) { for (let i = 0; i < item.pepdtos.length; i++) {
this.listForm.breakdownList.push({ for (let j = 0; j < item.pepdtos[i].breakdownList.length; j++) {
itemsName: item.pepdtos[i].breakdownList[j].itemsName, this.listForm.breakdownList.push({
itemNum: item.pepdtos[i].breakdownList[j].itemsNum, itemsName: item.pepdtos[i].breakdownList[j].itemsName,
responsibleEngineer: item.pepdtos[i].breakdownList[j].responsibleEngineer, itemNum: item.pepdtos[i].breakdownList[j].itemsNum,
responsibleUnit: item.pepdtos[i].breakdownList[j].responsibleUnit, responsibleEngineer: item.pepdtos[i].breakdownList[j].responsibleEngineer,
productLine: item.pepdtos[i].sarStandProjectLibraries.productLine, responsibleUnit: item.pepdtos[i].breakdownList[j].responsibleUnit,
projectNumber: item.pepdtos[i].sarStandProjectLibraries.projectNumber, productLine: item.pepdtos[i].sarStandProjectLibraries.productLine,
projectName: item.pepdtos[i].sarStandProjectLibraries.projectName, projectNumber: item.pepdtos[i].sarStandProjectLibraries.projectNumber,
implementer: item.pepdtos[i].breakdownList[j].implementer || null, projectName: item.pepdtos[i].sarStandProjectLibraries.projectName,
distributePerson: item.pepdtos[i].distributePerson, implementer: item.pepdtos[i].breakdownList[j].implementer || null,
distributePersonId: item.pepdtos[i].distributePersonId, distributePerson: item.pepdtos[i].distributePerson,
uname: item.pepdtos[i].uname, distributePersonId: item.pepdtos[i].distributePersonId,
projectManager: item.pepdtos[i].projectManager, uname: item.pepdtos[i].uname,
certifiedEngineerName: item.pepdtos[i].certifiedEngineerName, projectManager: item.pepdtos[i].projectManager,
qualityEngineerName: item.pepdtos[i].qualityEngineerName, certifiedEngineerName: item.pepdtos[i].certifiedEngineerName,
standNumber: item.pepdtos[i].standNumber, qualityEngineerName: item.pepdtos[i].qualityEngineerName,
standName: item.pepdtos[i].standName, standNumber: item.pepdtos[i].standNumber,
xCXSSRQ: item.pepdtos[i].xCXSSRQ, standName: item.pepdtos[i].standName,
zCCSSRQ: item.pepdtos[i].zCCSSRQ xCXSSRQ: item.pepdtos[i].xCXSSRQ,
}); zCCSSRQ: item.pepdtos[i].zCCSSRQ
});
}
} }
} else {
this.listForm = item.form
this.listForm.breakdownList = item.form.breakdownList
} }
console.log(this.listForm.breakdownList);
}, },
checkedRole (data) { checkedRole (data) {
if (this.type === 1) { if (this.type === 1) {
@@ -441,6 +445,22 @@ export default {
//保存事件 //保存事件
handleSave() { handleSave() {
this.saveLoading = true;
let _formData = new FormData();
_formData.append("id", this.bpnId || "");
_formData.append("prcType", "5");
_formData.append('taskIds', this.taskIds)
_formData.append("json", JSON.stringify({
form: this.listForm,
commentText: this.commentText
}));
saveTaskForPub(_formData).then(res => {
this.saveLoading = false;
this.$message.success("保存成功");
this.bpnId = res.result;
}).catch(e => {
this.saveLoading = false;
});
}, },
//提交事件 //提交事件
handleSubmit() { handleSubmit() {
@@ -347,7 +347,7 @@
import ProcessHeader from "../../components/ProcessHeader"; import ProcessHeader from "../../components/ProcessHeader";
import ProcessFooter from "../../components/ProcessFooter"; import ProcessFooter from "../../components/ProcessFooter";
import ProcessTitle from "../../components/ProcessTitle"; import ProcessTitle from "../../components/ProcessTitle";
import { inboundLiaisonDetail, queryDetail } from "api/process"; import { inboundLiaisonDetail, saveTaskForPub } from "api/process";
export default { export default {
name: "xmpgStep4", name: "xmpgStep4",
@@ -454,36 +454,59 @@ export default {
getFormFieldList(item) { getFormFieldList(item) {
this.$nextTick(() => { this.$nextTick(() => {
this.listForm = JSON.parse(JSON.stringify(item)); this.listForm = JSON.parse(JSON.stringify(item));
if (item.fenFlag === undefined ) { if(item.form === undefined){
item.step3DTOS.forEach(item => { if (item.fenFlag === undefined ) {
item.implementerId = this.$store.getters.userInfo.userId item.step3DTOS.forEach(item => {
item.implementer = this.$store.getters.userInfo.userName item.implementerId = this.$store.getters.userInfo.userId
}) item.implementer = this.$store.getters.userInfo.userName
this.dataList = item.step3DTOS; })
this.dataList = item.step3DTOS;
} else {
this.dataList = item.dataList;
this.dataList.forEach(item => {
item.implementerId = this.$store.getters.userInfo.userId
item.implementer = this.$store.getters.userInfo.userName
})
}
this.listForm.prcNum = this.prcNum;
this.listForm.prcName = this.prcName;
this.listForm["id"] = item.id;
this.listForm.standName = item.step3DTOS[0].standName;
this.listForm.standNumber = item.step3DTOS[0].standNumber;
this.listForm.qualityEngineerName = item.step3DTOS[0].qualityEngineerName;
this.listForm.certifiedEngineerName = item.step3DTOS[0].certifiedEngineerName;
this.listForm.itemsName = item.step3DTOS[0].itemsName;
this.listForm.itemNum = item.step3DTOS[0].itemNum;
this.listForm.responsibleUnit = item.step3DTOS[0].responsibleUnit;
this.listForm.responsibleEngineer = item.step3DTOS[0].responsibleEngineer;
} else { } else {
this.dataList = item.dataList; this.listForm = item.form
this.dataList.forEach(item => { this.dataList = item.form.dataList
item.implementerId = this.$store.getters.userInfo.userId
item.implementer = this.$store.getters.userInfo.userName
})
} }
this.listForm.prcNum = this.prcNum;
this.listForm.prcName = this.prcName;
this.listForm["id"] = item.id;
this.listForm.standName = item.step3DTOS[0].standName;
this.listForm.standNumber = item.step3DTOS[0].standNumber;
this.listForm.qualityEngineerName = item.step3DTOS[0].qualityEngineerName;
this.listForm.certifiedEngineerName = item.step3DTOS[0].certifiedEngineerName;
this.listForm.itemsName = item.step3DTOS[0].itemsName;
this.listForm.itemNum = item.step3DTOS[0].itemNum;
this.listForm.responsibleUnit = item.step3DTOS[0].responsibleUnit;
this.listForm.responsibleEngineer = item.step3DTOS[0].responsibleEngineer;
}); });
}, },
//保存事件 //保存事件
handleSave() { handleSave() {
this.saveLoading = true;
let _formData = new FormData();
this.listForm.dataList = this.dataList;
_formData.append("id", this.bpnId || "");
_formData.append("prcType", "5");
_formData.append('taskIds', this.taskIds)
_formData.append("json", JSON.stringify({
form:this.listForm,
commentText: this.commentText
}));
saveTaskForPub(_formData).then(res => {
this.saveLoading = false;
this.$message.success("保存成功");
this.bpnId = res.result;
}).catch(e => {
this.saveLoading = false;
});
}, },
//提交事件 //提交事件
handleSubmit() { handleSubmit() {
@@ -219,7 +219,7 @@
import ProcessHeader from "../../components/ProcessHeader"; import ProcessHeader from "../../components/ProcessHeader";
import ProcessFooter from "../../components/ProcessFooter"; import ProcessFooter from "../../components/ProcessFooter";
import ProcessTitle from "../../components/ProcessTitle"; import ProcessTitle from "../../components/ProcessTitle";
import { inboundLiaisonDetail, queryDetail } from "api/process"; import { inboundLiaisonDetail, saveTaskForPub } from "api/process";
export default { export default {
name: "xmpg2Step3", name: "xmpg2Step3",
@@ -339,18 +339,39 @@ export default {
getFormFieldList(item) { getFormFieldList(item) {
this.$nextTick(() => { this.$nextTick(() => {
this.listForm = JSON.parse(JSON.stringify(item)); this.listForm = JSON.parse(JSON.stringify(item));
this.listForm.prcNum = this.prcNum; if (item.form === undefined) {
this.listForm.prcName = this.prcName; this.listForm.prcNum = this.prcNum;
this.listForm["id"] = item.id; this.listForm.prcName = this.prcName;
this.listForm.dataList = item.dataList; this.listForm["id"] = item.id;
this.dataList = item.dataList; this.listForm.dataList = item.dataList;
this.dataList.distributePerson = item.dataList[0].distributePerson; this.dataList = item.dataList;
this.listForm.breakdownList = item.breakdownList; this.dataList.distributePerson = item.dataList[0].distributePerson;
this.listForm.breakdownList = item.breakdownList;
} else {
this.listForm = item.form
this.dataList = item.form.dataList
}
}); });
}, },
//保存事件 //保存事件
handleSave() { handleSave() {
this.saveLoading = true;
let _formData = new FormData();
_formData.append("id", this.bpnId || "");
_formData.append("prcType", "6");
_formData.append("taskIds", this.taskIds);
_formData.append("json", JSON.stringify({
form: this.listForm,
commentText: this.commentText
}));
saveTaskForPub(_formData).then(res => {
this.saveLoading = false;
this.$message.success("保存成功");
this.bpnId = res.result;
}).catch(e => {
this.saveLoading = false;
});
}, },
//提交事件 //提交事件
handleSubmit() { handleSubmit() {
@@ -225,7 +225,7 @@
import ProcessHeader from "../../components/ProcessHeader"; import ProcessHeader from "../../components/ProcessHeader";
import ProcessFooter from "../../components/ProcessFooter"; import ProcessFooter from "../../components/ProcessFooter";
import ProcessTitle from "../../components/ProcessTitle"; import ProcessTitle from "../../components/ProcessTitle";
import { inboundLiaisonDetail, queryDetail } from "api/process"; import { inboundLiaisonDetail, saveTaskForPub } from "api/process";
export default { export default {
name: "xmpg2Step4", name: "xmpg2Step4",
@@ -333,6 +333,7 @@ export default {
taskIds: this.taskIds, taskIds: this.taskIds,
pId: this.pId pId: this.pId
}).then(res => { }).then(res => {
console.log(res.mesg);
if (res) { if (res) {
const processForm = JSON.parse(res.mesg); const processForm = JSON.parse(res.mesg);
this.getFormFieldList(processForm); this.getFormFieldList(processForm);
@@ -345,18 +346,38 @@ export default {
getFormFieldList(item) { getFormFieldList(item) {
this.$nextTick(() => { this.$nextTick(() => {
this.listForm = JSON.parse(JSON.stringify(item)); this.listForm = JSON.parse(JSON.stringify(item));
this.listForm.prcNum = this.prcNum; if(item.form === undefined){
this.listForm.prcName = this.prcName; this.listForm.prcNum = this.prcNum;
this.listForm["id"] = item.id; this.listForm.prcName = this.prcName;
this.listForm.dataList = item.dataList; this.listForm["id"] = item.id;
this.dataList = item.dataList; this.listForm.dataList = item.dataList;
// this.dataList.distributePerson = item.dataList[0].distributePerson; this.dataList = item.dataList;
this.listForm.breakdownList = item.breakdownList; this.listForm.breakdownList = item.breakdownList;
} else {
this.listForm = item.form
this.dataList = item.form.dataList
}
}); });
}, },
//保存事件 //保存事件
handleSave() { handleSave() {
this.saveLoading = true;
let _formData = new FormData();
_formData.append("id", this.bpnId || "");
_formData.append("prcType", "6");
_formData.append("taskIds", this.taskIds);
_formData.append("json", JSON.stringify({
form: this.listForm,
commentText: this.commentText
}));
saveTaskForPub(_formData).then(res => {
this.saveLoading = false;
this.$message.success("保存成功");
this.bpnId = res.result;
}).catch(e => {
this.saveLoading = false;
});
}, },
//提交事件 //提交事件
handleSubmit() { handleSubmit() {
@@ -208,7 +208,7 @@
import ProcessHeader from "../../components/ProcessHeader"; import ProcessHeader from "../../components/ProcessHeader";
import ProcessFooter from "../../components/ProcessFooter"; import ProcessFooter from "../../components/ProcessFooter";
import ProcessTitle from "../../components/ProcessTitle"; import ProcessTitle from "../../components/ProcessTitle";
import { inboundLiaisonDetail, queryDetail } from "api/process"; import { inboundLiaisonDetail, saveTaskForPub } from "api/process";
export default { export default {
name: "xmpg2Step5", name: "xmpg2Step5",
@@ -328,43 +328,64 @@ export default {
getFormFieldList(item) { getFormFieldList(item) {
this.$nextTick(() => { this.$nextTick(() => {
this.listForm = JSON.parse(JSON.stringify(item)); this.listForm = JSON.parse(JSON.stringify(item));
this.listForm.prcNum = this.prcNum; if(item.form === undefined){
this.listForm.prcName = this.prcName; this.listForm.prcNum = this.prcNum;
this.listForm["id"] = item.id; this.listForm.prcName = this.prcName;
this.listForm.dataList = item.dataList; this.listForm["id"] = item.id;
this.dataList = item.dataList; this.listForm.dataList = item.dataList;
// this.dataList.standNumber = item.dataList.standSort + '\xa0\xa0' +item.dataList.standSort + '-' + item.dataList.standYear this.dataList = item.dataList;
let children = []; // this.dataList.standNumber = item.dataList.standSort + '\xa0\xa0' +item.dataList.standSort + '-' + item.dataList.standYear
item.breakdownList.forEach( let children = [];
item => { item.breakdownList.forEach(
let aa = { item => {
key: item.standId, let aa = {
id: item.id, key: item.standId,
standId: item.itemsNum, id: item.id,
itemsNum: item.itemsNum, standId: item.itemsNum,
itemsName: item.itemsName, itemsNum: item.itemsNum,
workPeople: "请选择责任人" itemsName: item.itemsName,
}; workPeople: "请选择责任人"
children.push(aa); };
} children.push(aa);
); }
this.dataList.forEach(key => { );
key["children"] = []; this.dataList.forEach(key => {
children.forEach(breakDown => { key["children"] = [];
if (key.standId === breakDown.key) { children.forEach(breakDown => {
key["children"].push(breakDown); if (key.standId === breakDown.key) {
key["children"].push(breakDown);
}
});
if (key["children"].length === 0) {
delete key["children"];
} }
}); });
if (key["children"].length === 0) { this.listForm.children = children;
delete key["children"]; } else {
} this.listForm = item.form
}); this.dataList = item.form.dataList
this.listForm.children = children; }
}); });
}, },
//保存事件 //保存事件
handleSave() { handleSave() {
this.saveLoading = true;
let _formData = new FormData();
_formData.append("id", this.bpnId || "");
_formData.append("prcType", "6");
_formData.append("taskIds", this.taskIds);
_formData.append("json", JSON.stringify({
form: this.listForm,
commentText: this.commentText
}));
saveTaskForPub(_formData).then(res => {
this.saveLoading = false;
this.$message.success("保存成功");
this.bpnId = res.result;
}).catch(e => {
this.saveLoading = false;
});
}, },
//提交事件 //提交事件
handleSubmit() { handleSubmit() {
@@ -338,7 +338,7 @@
import ProcessHeader from "../../components/ProcessHeader"; import ProcessHeader from "../../components/ProcessHeader";
import ProcessFooter from "../../components/ProcessFooter"; import ProcessFooter from "../../components/ProcessFooter";
import ProcessTitle from "../../components/ProcessTitle"; import ProcessTitle from "../../components/ProcessTitle";
import { inboundLiaisonDetail, queryDetail } from "api/process"; import { inboundLiaisonDetail, saveTaskForPub } from "api/process";
export default { export default {
name: "xmpg2Step6", name: "xmpg2Step6",
@@ -470,16 +470,37 @@ export default {
getFormFieldList(item) { getFormFieldList(item) {
this.$nextTick(() => { this.$nextTick(() => {
this.listForm = JSON.parse(JSON.stringify(item)); this.listForm = JSON.parse(JSON.stringify(item));
this.listForm.prcNum = this.prcNum; if(item.form === undefined){
this.listForm.prcName = this.prcName; this.listForm.prcNum = this.prcNum;
this.listForm["id"] = item.id; this.listForm.prcName = this.prcName;
// this.listForm.dataList = item.dataList; this.listForm["id"] = item.id;
this.dataList = this.listForm.dataList; // this.listForm.dataList = item.dataList;
this.dataList = this.listForm.dataList;
} else {
this.listForm = item.form
this.dataList = item.form.dataList
}
}); });
}, },
//保存事件 //保存事件
handleSave() { handleSave() {
this.saveLoading = true;
let _formData = new FormData();
_formData.append("id", this.bpnId || "");
_formData.append("prcType", "6");
_formData.append("taskIds", this.taskIds);
_formData.append("json", JSON.stringify({
form: this.listForm,
commentText: this.commentText
}));
saveTaskForPub(_formData).then(res => {
this.saveLoading = false;
this.$message.success("保存成功");
this.bpnId = res.result;
}).catch(e => {
this.saveLoading = false;
});
}, },
//提交事件 //提交事件
handleSubmit() { handleSubmit() {