update 流程保存草稿人员信息

This commit is contained in:
danshihao
2023-12-28 14:51:58 +08:00
parent f4998c71f5
commit d5b83ba72a
6 changed files with 175 additions and 46 deletions
@@ -186,6 +186,10 @@ export default {
},
processDisabled () {
return this.currentNode !== EsInspectionProcess.initiate.value
},
// 是否发起节点
isInitiate () {
return this.currentNode === EsInspectionProcess.initiate.value
}
},
created () {
@@ -202,9 +206,9 @@ export default {
}
// 查询人员信息
this.getPersonInfoStructure(this.processKey, () => {
this.initPersonInfoData(this.currentNode === EsInspectionProcess.initiate.value)
this.initPersonInfoData(this.isInitiate)
})
// 如果是待办进来,就获取详情数据
// 如果是待办或草稿进来,就获取详情数据
if (this.$route.query.projectId) {
this.loadPage()
return
@@ -231,7 +235,7 @@ export default {
* 获取页面详情
*/
loadPage () {
const { projectId, taskId } = this.$route.query
const { projectId, taskId, draftId } = this.$route.query
this.loading = true
getInspectProcessDetail({
projectId,
@@ -252,6 +256,17 @@ export default {
commitText: processApprovalRecord.commitText,
commitFile: processApprovalRecord.commitFile
})
// 草稿状态回显
if (draftId) {
const { draftData, personInfo } = JSON.parse(data.infoJsonStr || '{}')
console.log('草稿回显', JSON.parse(data.infoJsonStr || '{}'), draftData, personInfo)
// 节点1 回显人员信息
if (this.isInitiate) {
this.draftInitPersonInfo(personInfo)
}
// 回显业务信息(需要等后端调整)
}
}
}).finally(() => {
this.loading = false
@@ -262,7 +277,7 @@ export default {
let personnelObj = {}
const funName = isValidate ? 'getDataObjVerify' : 'getDataObj'
// 节点1:所有的人员信息
if (this.currentNode === EsInspectionProcess.initiate.value) {
if (this.isInitiate) {
// 人员信息的数据, 处理成对象
personnelObj = this.$refs.personnelInfo[funName]()
if (!personnelObj) {
@@ -304,8 +319,8 @@ export default {
this.approvalInfoForm.validateFields(['commitText'], { force: true }, () => {})
}
// 收集人员信息
const getPersonInfo = this.getPersonInfo(isValidate)
if (!getPersonInfo) {
const personInfo = this.getPersonInfo(isValidate)
if (!personInfo) {
throw new Error('user')
}
@@ -318,7 +333,7 @@ export default {
})
// 处理其他参数
params.map = Object.assign({}, getPersonInfo)
params.map = Object.assign({}, personInfo)
// 流程审批信息
params.processApprovalRecord = Object.assign({}, this.info.processApprovalRecord, formDataList[1], {
@@ -360,6 +375,13 @@ export default {
if (this.loading) return
this.loading = true
this.getPageParams(false).then(res => {
// 保存草稿信息
res.infoJsonStr = JSON.stringify({
// 人员信息(要重新获取,流程里的信息不能直接用,后端需要多选人员处理成数组了)
personInfo: this.$refs.personnelInfo.getDataObj()
// 业务数据(需要等后端调整)
// draftData:
})
console.log(res)
return saveInspectProcess(res)
}).then(res => {