diff --git a/src/views/workCenter/enterpriseStandardInspectionProcess/EnterpriseStandardInspectionProcess.vue b/src/views/workCenter/enterpriseStandardInspectionProcess/EnterpriseStandardInspectionProcess.vue index 889466e4..51ad5c2d 100644 --- a/src/views/workCenter/enterpriseStandardInspectionProcess/EnterpriseStandardInspectionProcess.vue +++ b/src/views/workCenter/enterpriseStandardInspectionProcess/EnterpriseStandardInspectionProcess.vue @@ -265,13 +265,16 @@ export default { // 草稿状态回显 if (draftId) { - const { draftData, personInfo } = JSON.parse(data.infoJsonStr || '{}') - console.log('草稿回显', JSON.parse(data.infoJsonStr || '{}'), draftData, personInfo) + const infoJson = JSON.parse(data.infoJsonStr || '{}') + console.log('草稿回显', JSON.parse(data.infoJsonStr || '{}'), infoJson) // 节点1 回显人员信息 if (this.isInitiate) { - this.draftInitPersonInfo(personInfo) + this.draftInitPersonInfo(infoJson.personInfo) + } + // 回显业务信息,如果有标识属性就是强制撤回 + if (Object.hasOwnProperty.call(infoJson, 'revocation')) { + this.$refs.inspectionProcessTable.setData(infoJson.draftData) } - // 回显业务信息(需要等后端调整) } } }).finally(() => { @@ -382,6 +385,14 @@ export default { params.processApprovalRecord = Object.assign({}, this.info.processApprovalRecord, formDataList[1], { projectId: this.projectId }) + + // 保存草稿信息 + params.infoJsonStr = JSON.stringify({ + // 人员信息(要重新获取,流程里的信息不能直接用,后端需要多选人员处理成数组了) + personInfo: this.$refs.personnelInfo.getDataObj(), + // 业务表格数据,用于强制撤回后回显 + draftData: params.processEsInspectList + }) return params }, /** @@ -418,13 +429,6 @@ export default { if (this.loading) return this.loading = true this.getPageParams(false).then(res => { - // 保存草稿信息 - res.infoJsonStr = JSON.stringify({ - // 人员信息(要重新获取,流程里的信息不能直接用,后端需要多选人员处理成数组了) - personInfo: this.$refs.personnelInfo.getDataObj() - // 业务数据(需要等后端调整) - // draftData: - }) // 1待办 2草稿 res.saveSource = (this.$route.query.draftId || !this.$route.query.projectId) ? 2 : 1 console.log(res) diff --git a/src/views/workCenter/enterpriseStandardInspectionRectification/EnterpriseStandardInspectionRectification.vue b/src/views/workCenter/enterpriseStandardInspectionRectification/EnterpriseStandardInspectionRectification.vue index df051a75..6788839e 100644 --- a/src/views/workCenter/enterpriseStandardInspectionRectification/EnterpriseStandardInspectionRectification.vue +++ b/src/views/workCenter/enterpriseStandardInspectionRectification/EnterpriseStandardInspectionRectification.vue @@ -215,15 +215,6 @@ export default { }) this.initPersonInfoData(this.isUploadRectificationResult) }) - getInspectRectifyDataById({ projectId }).then(res => { - if (res.success) { - const data = res.result || {} - this.formInfo = data - this.$nextTick(() => { - this.$refs.baseInfoForm.initData(data) - }) - } - }) // 如果是待办或草稿进来,就获取详情数据 if (this.$route.query.projectId) { this.loadPage() @@ -258,13 +249,30 @@ export default { // 草稿状态回显 if (draftId) { - const { draftData, personInfo } = JSON.parse(data.infoJsonStr || '{}') - console.log('草稿回显', JSON.parse(data.infoJsonStr || '{}'), draftData, personInfo) + const infoJson = JSON.parse(data.infoJsonStr || '{}') + console.log('草稿回显', JSON.parse(data.infoJsonStr || '{}'), infoJson) // 节点1 回显人员信息 if (this.isUploadRectificationResult) { - this.draftInitPersonInfo(personInfo) + this.draftInitPersonInfo(infoJson.personInfo) } - // 回显业务信息(需要等后端调整) + // 回显业务信息,如果有标识属性就是强制撤回 + if (Object.hasOwnProperty.call(infoJson, 'revocation')) { + this.formInfo = infoJson.draftData + this.$nextTick(() => { + this.$refs.baseInfoForm.initData(this.formInfo) + }) + } + } else { + // 非草稿调用接口拿数据回显 + getInspectRectifyDataById({ projectId }).then(res => { + if (res.success) { + const data = res.result || {} + this.formInfo = data + this.$nextTick(() => { + this.$refs.baseInfoForm.initData(data) + }) + } + }) } } }).finally(() => { @@ -345,6 +353,14 @@ export default { params.processEsInspectRectify = Object.assign({}, formDataList[2], { id: this.formInfo.id }) + + // 保存草稿信息 + params.infoJsonStr = JSON.stringify({ + // 人员信息(要重新获取,流程里的信息不能直接用,后端需要多选人员处理成数组了) + personInfo: this.$refs.personnelInfo.getDataObj(), + // 业务表格数据,用于强制撤回后回显 + draftData: params.processEsInspectRectify + }) return params }, /** @@ -381,13 +397,6 @@ export default { if (this.loading) return this.loading = true this.getPageParams(false).then(res => { - // 保存草稿信息 - res.infoJsonStr = JSON.stringify({ - // 人员信息(要重新获取,流程里的信息不能直接用,后端需要多选人员处理成数组了) - personInfo: this.$refs.personnelInfo.getDataObj() - // 业务数据(需要等后端调整) - // draftData: - }) // 1待办 2草稿 res.saveSource = (this.$route.query.draftId || !this.$route.query.projectId) ? 2 : 1 console.log(res) diff --git a/src/views/workCenter/inspectionExtensionRequestProcess/InspectionExtensionRequestProcess.vue b/src/views/workCenter/inspectionExtensionRequestProcess/InspectionExtensionRequestProcess.vue index d32247ed..01fb79ac 100644 --- a/src/views/workCenter/inspectionExtensionRequestProcess/InspectionExtensionRequestProcess.vue +++ b/src/views/workCenter/inspectionExtensionRequestProcess/InspectionExtensionRequestProcess.vue @@ -263,13 +263,16 @@ export default { // 草稿状态回显 if (draftId) { - const { draftData, personInfo } = JSON.parse(data.infoJsonStr || '{}') - console.log('草稿回显', JSON.parse(data.infoJsonStr || '{}'), draftData, personInfo) + const infoJson = JSON.parse(data.infoJsonStr || '{}') + console.log('草稿回显', JSON.parse(data.infoJsonStr || '{}'), infoJson) // 节点1 回显人员信息 if (this.isInitiate) { - this.draftInitPersonInfo(personInfo) + this.draftInitPersonInfo(infoJson.personInfo) + } + // 回显业务信息,如果有标识属性就是强制撤回 + if (Object.hasOwnProperty.call(infoJson, 'revocation')) { + this.$refs.extensionRequestTable.setData(infoJson.draftData) } - // 回显业务信息(需要等后端调整) } } }).finally(() => { @@ -346,6 +349,14 @@ export default { params.processApprovalRecord = Object.assign({}, this.info.processApprovalRecord, formDataList[1], { projectId: this.projectId }) + + // 保存草稿信息 + params.infoJsonStr = JSON.stringify({ + // 人员信息(要重新获取,流程里的信息不能直接用,后端需要多选人员处理成数组了) + personInfo: this.$refs.personnelInfo.getDataObj(), + // 业务表格数据,用于强制撤回后回显 + draftData: params.processEsInspectDelayApplyList + }) return params }, /** @@ -382,13 +393,6 @@ export default { if (this.loading) return this.loading = true this.getPageParams(false).then(res => { - // 保存草稿信息 - res.infoJsonStr = JSON.stringify({ - // 人员信息(要重新获取,流程里的信息不能直接用,后端需要多选人员处理成数组了) - personInfo: this.$refs.personnelInfo.getDataObj() - // 业务数据(需要等后端调整) - // draftData: - }) // 1待办 2草稿 res.saveSource = (this.$route.query.draftId || !this.$route.query.projectId) ? 2 : 1 console.log(res) diff --git a/src/views/workCenter/permissionApplicationProcess/PermissionApplicationProcess.vue b/src/views/workCenter/permissionApplicationProcess/PermissionApplicationProcess.vue index add04a99..2e7110e7 100644 --- a/src/views/workCenter/permissionApplicationProcess/PermissionApplicationProcess.vue +++ b/src/views/workCenter/permissionApplicationProcess/PermissionApplicationProcess.vue @@ -312,25 +312,6 @@ export default { loadPage () { const { projectId, taskId, draftId } = this.$route.query this.loading = true - // 获取业务数据 - getPermissionApplyDataById({ projectId: this.projectId }).then(res => { - if (res.success) { - const data = res.result || {} - const list = data.lawsEnterpriseStandardList || [] - // 发起节点的表格和审批节点的表格,哪个存在回显哪个的数据 - this.$refs.baseInfoTable && this.$refs.baseInfoTable.setData(list) - this.$refs.applyPermissionTable && this.$refs.applyPermissionTable.setData(list) - // 保存并回显表单信息 - this.info = cloneDeep(data) - this.formInfo = data - this.baseInfoForm.setFieldsValue({ - expirationDate: data.expirationDate, - userDictText: data.userDictText, - standardNumbers: data.standardNumbers, - applyDetail: data.applyDetail - }) - } - }) // 获取流程数据 getPermissionApplyDetail({ projectId, @@ -354,13 +335,49 @@ export default { // 草稿状态回显 if (draftId) { - const { draftData, personInfo } = JSON.parse(data.infoJsonStr || '{}') - console.log('草稿回显', JSON.parse(data.infoJsonStr || '{}'), draftData, personInfo) + const infoJson = JSON.parse(data.infoJsonStr || '{}') + console.log('草稿回显', JSON.parse(data.infoJsonStr || '{}'), infoJson) // 节点1 回显人员信息 if (this.isInitiate) { - this.draftInitPersonInfo(personInfo) + this.draftInitPersonInfo(infoJson.personInfo) } - // 回显业务信息(需要等后端调整) + // 回显业务信息,如果有标识属性就是强制撤回 + if (Object.hasOwnProperty.call(infoJson, 'revocation')) { + const data = infoJson.draftData + const list = data.lawsEnterpriseStandardList || [] + // 发起节点的表格和审批节点的表格,哪个存在回显哪个的数据 + this.$refs.baseInfoTable && this.$refs.baseInfoTable.setData(list) + this.$refs.applyPermissionTable && this.$refs.applyPermissionTable.setData(list) + // 保存并回显表单信息 + this.info = cloneDeep(data) + this.formInfo = data + this.baseInfoForm.setFieldsValue({ + expirationDate: data.expirationDate, + userDictText: data.userDictText, + standardNumbers: data.standardNumbers, + applyDetail: data.applyDetail + }) + } + } else { + // 非草稿获取业务数据 + getPermissionApplyDataById({ projectId: this.projectId }).then(res => { + if (res.success) { + const data = res.result || {} + const list = data.lawsEnterpriseStandardList || [] + // 发起节点的表格和审批节点的表格,哪个存在回显哪个的数据 + this.$refs.baseInfoTable && this.$refs.baseInfoTable.setData(list) + this.$refs.applyPermissionTable && this.$refs.applyPermissionTable.setData(list) + // 保存并回显表单信息 + this.info = cloneDeep(data) + this.formInfo = data + this.baseInfoForm.setFieldsValue({ + expirationDate: data.expirationDate, + userDictText: data.userDictText, + standardNumbers: data.standardNumbers, + applyDetail: data.applyDetail + }) + } + }) } } }).finally(() => { @@ -466,6 +483,14 @@ export default { params.processEsPermissionApply.standardNumbers = this.$refs.baseInfoTable.getStandardNumbers() params.processEsPermissionApply.userId = this.$store.getters.userInfo.id } + + // 保存草稿信息 + params.infoJsonStr = JSON.stringify({ + // 人员信息(要重新获取,流程里的信息不能直接用,后端需要多选人员处理成数组了) + personInfo: this.$refs.personnelInfo.getDataObj(), + // 业务数据,用于强制撤回后回显 + draftData: params.processEsPermissionApply + }) return params }, /** @@ -502,13 +527,6 @@ export default { if (this.loading) return this.loading = true this.getPageParams(false).then(res => { - // 保存草稿信息 - res.infoJsonStr = JSON.stringify({ - // 人员信息(要重新获取,流程里的信息不能直接用,后端需要多选人员处理成数组了) - personInfo: this.$refs.personnelInfo.getDataObj() - // 业务数据(需要等后端调整) - // draftData: - }) // 1待办 2草稿 res.saveSource = (this.$route.query.draftId || !this.$route.query.projectId) ? 2 : 1 console.log(res) diff --git a/src/views/workCenter/postMeetingManageProcess/PostMeetingManageProcess.vue b/src/views/workCenter/postMeetingManageProcess/PostMeetingManageProcess.vue index 0307470f..28f936e1 100644 --- a/src/views/workCenter/postMeetingManageProcess/PostMeetingManageProcess.vue +++ b/src/views/workCenter/postMeetingManageProcess/PostMeetingManageProcess.vue @@ -252,17 +252,6 @@ export default { loadPage () { const { projectId, taskId, draftId } = this.$route.query this.loading = true - // 获取业务数据 - getPostMeetingManageDataById({ projectId: this.projectId }).then(res => { - if (res.success) { - const data = res.result || {} - // 保存并回显表单信息 - this.formInfo = data - this.$nextTick(() => { - this.$refs.baseInfoForm.initData(data) - }) - } - }) getPostMeetingManageDetail({ projectId, taskId @@ -285,13 +274,31 @@ export default { // 草稿状态回显 if (draftId) { - const { draftData, personInfo } = JSON.parse(data.infoJsonStr || '{}') - console.log('草稿回显', JSON.parse(data.infoJsonStr || '{}'), draftData, personInfo) + const infoJson = JSON.parse(data.infoJsonStr || '{}') + console.log('草稿回显', JSON.parse(data.infoJsonStr || '{}'), infoJson) // 节点1 回显人员信息 if (this.isInitiate) { - this.draftInitPersonInfo(personInfo) + this.draftInitPersonInfo(infoJson.personInfo) } - // 回显业务信息(需要等后端调整) + // 回显业务信息,如果有标识属性就是强制撤回 + if (Object.hasOwnProperty.call(infoJson, 'revocation')) { + this.formInfo = infoJson.draftData + this.$nextTick(() => { + this.$refs.baseInfoForm.initData(this.formInfo) + }) + } + } else { + // 非草稿获取业务数据 + getPostMeetingManageDataById({ projectId: this.projectId }).then(res => { + if (res.success) { + const data = res.result || {} + // 保存并回显表单信息 + this.formInfo = data + this.$nextTick(() => { + this.$refs.baseInfoForm.initData(data) + }) + } + }) } } }).finally(() => { @@ -382,6 +389,14 @@ export default { if (this.currentNode === PostMeetingManage.attendeesUploadMaterials.value) { params.fileIds = params.processMeetingManage.fileIds } + + // 保存草稿信息 + params.infoJsonStr = JSON.stringify({ + // 人员信息(要重新获取,流程里的信息不能直接用,后端需要多选人员处理成数组了) + personInfo: this.$refs.personnelInfo.getDataObj(), + // 业务数据,用于强制撤回后回显 + draftData: params.processMeetingManage + }) return params }, /** @@ -418,13 +433,6 @@ export default { if (this.loading) return this.loading = true this.getPageParams(false).then(res => { - // 保存草稿信息 - res.infoJsonStr = JSON.stringify({ - // 人员信息(要重新获取,流程里的信息不能直接用,后端需要多选人员处理成数组了) - personInfo: this.$refs.personnelInfo.getDataObj() - // 业务数据(需要等后端调整) - // draftData: - }) // 1待办 2草稿 res.saveSource = (this.$route.query.draftId || !this.$route.query.projectId) ? 2 : 1 console.log(res)