diff --git a/src/views/workCenter/standardPromotionProcess/StandardPromotionProcess.vue b/src/views/workCenter/standardPromotionProcess/StandardPromotionProcess.vue index d54b3533..b04148aa 100644 --- a/src/views/workCenter/standardPromotionProcess/StandardPromotionProcess.vue +++ b/src/views/workCenter/standardPromotionProcess/StandardPromotionProcess.vue @@ -11,7 +11,7 @@ @@ -20,7 +20,7 @@ @@ -31,7 +31,7 @@ @@ -40,7 +40,7 @@
{{ $t('basicServiceInformation') }}
- +
{{ $t('processApprovalInformation') }}
@@ -50,16 +50,17 @@ - + -
+
{{ $t('cancel') }} @@ -76,6 +77,7 @@ import InternalDetailPage from '@comp/InternalDetailPage' import BaseInfoForm from '@views/workCenter/standardPromotionProcess/modules/BaseInfoForm' import { ProcessKey, StandardPromotion } from '@/enums/commonEnums' import { + getLookData, getStandardPromotionDataById, getStandardPromotionDetail, getStandardPromotionProjectId, saveStandardPromotion, @@ -89,6 +91,7 @@ export default { return { loading: false, switchValue: 'base', + disabledAll: false, // 禁用全部 labelCol: { xs: { span: 24 }, sm: { span: 4 } @@ -169,7 +172,8 @@ export default { // standardApproval }, created () { - const { projectId, nodeId, taskName } = this.$route.query + const { projectId, nodeId, taskName, isLook } = this.$route.query + this.disabledAll = isLook === '1' // 发起、草稿进来没有nodeId,就默认发起节点 this.currentNode = nodeId || StandardPromotion.initiate.value this.currentNodeName = taskName || StandardPromotion.initiate.text @@ -180,6 +184,11 @@ export default { // 提交按钮 this.btn = ['submit'] } + // 快照回显 + if (this.$route.query.snapshotId) { + this.loadSnapshotPage() + return + } // 如果是待办进来,就获取详情数据 if (this.$route.query.projectId) { this.loadPage() @@ -273,6 +282,8 @@ export default { this.$refs.baseInfoForm.getData() ] } + // 保存一下所有表单收集的数据用于快照回显 + params.formDataList = formDataList // 开始处理信息 // 流程信息 @@ -298,8 +309,47 @@ export default { projectId: this.projectId, id: this.formInfo.id }) + + // 发起保存草稿信息 + if (this.isInitiate) { + params.infoJsonStr = JSON.stringify({ + // 将流程数据保存json,后续进行快照回显 + prcData: params + }) + } + return params }, + // 回显快照页面 + loadSnapshotPage () { + const { snapshotId } = this.$route.query + if (!snapshotId) { + return + } + this.loading = true + getLookData({ snapshotId }).then(res => { + const result = res.result || {} + const jsonData = JSON.parse(result.infoJsonStr || '{}') + const prcData = jsonData.prcData || {} + this.info = prcData + // 保存并回显表单信息 + this.formInfo = prcData.processEsDeclare + this.$nextTick(() => { + this.$refs.baseInfoForm.initData(prcData.processEsDeclare) + }) + this.processInfoForm && this.processInfoForm.setFieldsValue({ + prcName: prcData.processAll.prcName, + dueTime: prcData.processAll.dueTime, + prcMes: prcData.processAll.prcMes + }) + this.approvalInfoForm && this.approvalInfoForm.setFieldsValue({ + commitText: prcData.processApprovalRecord.commitText, + commitFile: prcData.processApprovalRecord.commitFile + }) + }).finally(() => { + this.loading = false + }) + }, /** * 保存 */ diff --git a/src/views/workCenter/standardPromotionProcess/modules/BaseInfoForm.vue b/src/views/workCenter/standardPromotionProcess/modules/BaseInfoForm.vue index 143f74d6..7f722c16 100644 --- a/src/views/workCenter/standardPromotionProcess/modules/BaseInfoForm.vue +++ b/src/views/workCenter/standardPromotionProcess/modules/BaseInfoForm.vue @@ -11,7 +11,7 @@
- @@ -61,8 +61,9 @@
@@ -78,6 +79,7 @@ @@ -93,6 +95,7 @@ @@ -105,7 +108,7 @@ - @@ -120,7 +123,7 @@ @@ -156,6 +161,7 @@ @@ -179,7 +185,7 @@ - + @@ -197,6 +203,12 @@ export default { type: Boolean, required: false, default: false + }, + // 查看,禁用全部表单 + disabledAll: { + type: Boolean, + required: false, + default: false } }, data () { @@ -207,8 +219,6 @@ export default { model: {}, // 操作类型 operationType: null, - // 联络人名字 - initiatorName: '', // 是否禁用联络人 disabledInitiator: true, rules: { @@ -303,7 +313,6 @@ export default { this.formInline = { ...data } - this.initiatorName = data.initiatorDictText }, // 外层要获取数据 getData () { @@ -352,7 +361,7 @@ export default { const names = data.map(item => item.contactIdDictText).join(',') // 如果是清空,设置禁用,否则根据返回内容设置禁用 this.disabledInitiator = val ? !!ids : true - this.initiatorName = names + this.formInline.initiatorDictText = names this.$set(this.formInline, 'initiator', ids) // 如果接口有回显,就去掉校验信息 if (ids) { @@ -360,6 +369,9 @@ export default { } } }) + }, + nameChange (field, name) { + this.formInline[field] = name } } }