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
@@ -221,6 +221,10 @@ export default {
},
processDisabled () {
return this.currentNode !== EsInspectionPlan.initiate.value
},
// 是否发起节点
isInitiate () {
return this.currentNode === EsInspectionPlan.initiate.value
}
},
created () {
@@ -237,9 +241,9 @@ export default {
}
// 查询人员信息
this.getPersonInfoStructure(this.processKey, () => {
this.initPersonInfoData(this.currentNode === EsInspectionPlan.initiate.value)
this.initPersonInfoData(this.isInitiate)
})
// 如果是待办进来,就获取详情数据
// 如果是待办或草稿进来,就获取详情数据
if (this.$route.query.projectId) {
this.loadPage()
return
@@ -266,7 +270,7 @@ export default {
* 获取页面详情
*/
loadPage () {
const { projectId, taskId } = this.$route.query
const { projectId, taskId, draftId } = this.$route.query
this.loading = true
getInspectPlanDetail({
projectId,
@@ -296,6 +300,17 @@ export default {
})
// 触发会签改变
this.changeIsCountersign(data.countersignTag)
// 草稿状态回显
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
@@ -306,7 +321,7 @@ export default {
let personnelObj = {}
const funName = isValidate ? 'getDataObjVerify' : 'getDataObj'
// 节点1:所有的人员信息
if (this.currentNode === EsInspectionPlan.initiate.value) {
if (this.isInitiate) {
// 人员信息的数据, 处理成对象
personnelObj = this.$refs.personnelInfo[funName]()
if (!personnelObj) {
@@ -318,9 +333,11 @@ export default {
personnelObj[key] = personnelObj[key].split(',')
}
}
// 通过表格中的所属部门人员获取稽查征求意见对象
const userList = this.$refs.inspectionPlanTable.dataSource.map(item => item.objectOfConsultation.split(',')).flat(Infinity)
personnelObj.opinionFillList = Array.from(new Set(userList)).filter(item => item)
// 发起节点:通过表格中的员获取所属部门人稽查征求意见对象
if (this.isInitiate) {
const userList = this.$refs.inspectionPlanTable.dataSource.map(item => item.objectOfConsultation.split(',')).flat(Infinity)
personnelObj.opinionFillList = Array.from(new Set(userList)).filter(item => item)
}
}
return personnelObj
},
@@ -347,8 +364,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')
}
@@ -361,7 +378,7 @@ export default {
})
// 处理其他参数
params.map = Object.assign({}, formDataList[1], getPersonInfo)
params.map = Object.assign({}, formDataList[1], personInfo)
// 节点三:会签表单放到对象最外层单独存储业务信息,params.map里是流程用的
if (this.currentNode === EsInspectionPlan.liaisonCollect.value && Object.hasOwnProperty.call(params.map, 'countersignTag')) {
params.countersignTag = params.map.countersignTag
@@ -412,6 +429,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 saveInspectPlan(res)
}).then(res => {
@@ -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 => {
@@ -185,6 +185,10 @@ export default {
},
processDisabled () {
return this.currentNode !== EsInspectionRectification.uploadRectificationResult.value
},
// 是否节点1
isUploadRectificationResult () {
return this.currentNode === EsInspectionRectification.uploadRectificationResult.value
}
},
created () {
@@ -209,7 +213,7 @@ export default {
}
return item
})
this.initPersonInfoData(this.currentNode === EsInspectionRectification.uploadRectificationResult.value)
this.initPersonInfoData(this.isUploadRectificationResult)
})
getInspectRectifyDataById({ projectId }).then(res => {
if (res.success) {
@@ -220,7 +224,7 @@ export default {
})
}
})
// 如果是待办进来,就获取详情数据
// 如果是待办或草稿进来,就获取详情数据
if (this.$route.query.projectId) {
this.loadPage()
}
@@ -230,7 +234,7 @@ export default {
* 获取页面详情
*/
loadPage () {
const { projectId, taskId } = this.$route.query
const { projectId, taskId, draftId } = this.$route.query
this.loading = true
getInspectRectifyDetail({
projectId,
@@ -251,6 +255,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.isUploadRectificationResult) {
this.draftInitPersonInfo(personInfo)
}
// 回显业务信息(需要等后端调整)
}
}
}).finally(() => {
this.loading = false
@@ -261,7 +276,7 @@ export default {
let personnelObj = {}
const funName = isValidate ? 'getDataObjVerify' : 'getDataObj'
// 节点1:所有的人员信息
if (this.currentNode === EsInspectionRectification.uploadRectificationResult.value) {
if (this.isUploadRectificationResult) {
// 人员信息的数据, 处理成对象
personnelObj = this.$refs.personnelInfo[funName]()
if (!personnelObj) {
@@ -296,8 +311,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], {
@@ -365,6 +380,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 saveInspectRectify(res)
}).then(res => {
@@ -189,6 +189,9 @@ export default {
},
processDisabled () {
return this.currentNode !== InspectionExtensionRequestProcess.initiate.value
},
isInitiate () {
return this.currentNode === InspectionExtensionRequestProcess.initiate.value
}
},
created () {
@@ -205,9 +208,9 @@ export default {
}
// 查询人员信息
this.getPersonInfoStructure(this.processKey, () => {
this.initPersonInfoData(this.currentNode === InspectionExtensionRequestProcess.initiate.value)
this.initPersonInfoData(this.isInitiate)
})
// 如果是待办进来,就获取详情数据
// 如果是待办或草稿进来,就获取详情数据
if (this.$route.query.projectId) {
this.loadPage()
return
@@ -234,7 +237,7 @@ export default {
* 获取页面详情
*/
loadPage () {
const { projectId, taskId } = this.$route.query
const { projectId, taskId, draftId } = this.$route.query
this.loading = true
getInspectExtensionDetail({
projectId,
@@ -255,6 +258,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
@@ -265,7 +279,7 @@ export default {
let personnelObj = {}
const funName = isValidate ? 'getDataObjVerify' : 'getDataObj'
// 节点1:所有的人员信息
if (this.currentNode === InspectionExtensionRequestProcess.initiate.value) {
if (this.isInitiate) {
// 人员信息的数据, 处理成对象
personnelObj = this.$refs.personnelInfo[funName]()
if (!personnelObj) {
@@ -305,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')
}
@@ -319,7 +333,7 @@ export default {
})
// 处理其他参数
params.map = Object.assign({}, getPersonInfo)
params.map = Object.assign({}, personInfo)
// 流程审批信息
params.processApprovalRecord = Object.assign({}, this.info.processApprovalRecord, formDataList[1], {
@@ -361,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 saveInspectExtension(res)
}).then(res => {
@@ -383,7 +404,7 @@ export default {
if (this.loading) return
// 节点1 判断表格是否填写:稽查联络人 && 申请延期日期
if (
this.currentNode === InspectionExtensionRequestProcess.initiate.value &&
this.isInitiate &&
this.$refs.extensionRequestTable.dataSource.some(item => {
// 稽查联络人 申请延期日期 任意一个为空都不能发起
return !item.liaisons || !item.liaisons.length || !item.requestDelayDate
@@ -281,9 +281,9 @@ export default {
}
// 查询人员信息
this.getPersonInfoStructure(this.processKey, () => {
this.initPersonInfoData(this.currentNode === PermissionApply.initiate.value)
this.initPersonInfoData(this.isInitiate)
})
// 如果是待办进来,就获取详情数据
// 如果是待办或草稿进来,就获取详情数据
if (this.$route.query.projectId) {
this.loadPage()
return
@@ -310,7 +310,7 @@ export default {
* 获取页面详情
*/
loadPage () {
const { projectId, taskId } = this.$route.query
const { projectId, taskId, draftId } = this.$route.query
this.loading = true
// 获取业务数据
getPermissionApplyDataById({ projectId: this.projectId }).then(res => {
@@ -351,6 +351,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
@@ -361,7 +372,7 @@ export default {
let personnelObj = {}
const funName = isValidate ? 'getDataObjVerify' : 'getDataObj'
// 节点1:所有的人员信息
if (this.currentNode === PermissionApply.initiate.value) {
if (this.isInitiate) {
// 人员信息的数据, 处理成对象
personnelObj = this.$refs.personnelInfo[funName]()
if (!personnelObj) {
@@ -413,8 +424,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')
}
@@ -427,7 +438,7 @@ export default {
})
// 处理其他参数
params.map = Object.assign({}, getPersonInfo)
params.map = Object.assign({}, personInfo)
// 流程审批信息
params.processApprovalRecord = Object.assign({}, this.info.processApprovalRecord, formDataList[1], {
@@ -480,6 +491,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 savePermissionApply(res)
}).then(res => {
@@ -197,6 +197,10 @@ export default {
},
processDisabled () {
return this.currentNode !== PostMeetingManage.initiate.value
},
// 发起节点节点1
isInitiate () {
return this.currentNode === PostMeetingManage.initiate.value
}
},
created () {
@@ -213,9 +217,9 @@ export default {
}
// 查询人员信息
this.getPersonInfoStructure(this.processKey, () => {
this.initPersonInfoData(this.currentNode === PostMeetingManage.initiate.value)
this.initPersonInfoData(this.isInitiate)
})
// 如果是待办进来,就获取详情数据
// 如果是待办或草稿进来,就获取详情数据
if (this.$route.query.projectId) {
this.loadPage()
return
@@ -246,7 +250,7 @@ export default {
* 获取页面详情
*/
loadPage () {
const { projectId, taskId } = this.$route.query
const { projectId, taskId, draftId } = this.$route.query
this.loading = true
// 获取业务数据
getPostMeetingManageDataById({ projectId: this.projectId }).then(res => {
@@ -278,6 +282,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
@@ -288,7 +303,7 @@ export default {
let personnelObj = {}
const funName = isValidate ? 'getDataObjVerify' : 'getDataObj'
// 节点1:所有的人员信息
if (this.currentNode === PostMeetingManage.initiate.value) {
if (this.isInitiate) {
// 人员信息的数据, 处理成对象
personnelObj = this.$refs.personnelInfo[funName]()
if (!personnelObj) {
@@ -335,8 +350,8 @@ export default {
}
// 收集人员信息
const getPersonInfo = this.getPersonInfo(isValidate)
if (!getPersonInfo) {
const personInfo = this.getPersonInfo(isValidate)
if (!personInfo) {
throw new Error('user')
}
@@ -349,7 +364,7 @@ export default {
})
// 处理其他参数
params.map = Object.assign({}, getPersonInfo)
params.map = Object.assign({}, personInfo)
// 流程审批信息
params.processApprovalRecord = Object.assign({}, this.info.processApprovalRecord, formDataList[1], {
@@ -402,6 +417,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 savePostMeetingManage(res)
}).then(res => {