From 6c2f4b24b2a87b16334aaf749e1ef5ff4c54430f Mon Sep 17 00:00:00 2001 From: danshihao Date: Mon, 15 Jul 2024 18:31:03 +0800 Subject: [PATCH] =?UTF-8?q?[update=20=E6=A0=87=E5=87=86=E8=A7=A3=E8=AF=BB?= =?UTF-8?q?=E6=B5=81=E7=A8=8B]=20=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StandardInterpretationProcess.vue | 7 +++++-- .../InterpretationLiaisonDistribute.vue | 20 ++++++++++++------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/views/workCenter/standardInterpretationProcess/StandardInterpretationProcess.vue b/src/views/workCenter/standardInterpretationProcess/StandardInterpretationProcess.vue index a62a70b..2e7b451 100644 --- a/src/views/workCenter/standardInterpretationProcess/StandardInterpretationProcess.vue +++ b/src/views/workCenter/standardInterpretationProcess/StandardInterpretationProcess.vue @@ -432,8 +432,11 @@ export default { params.data.processStandardInterpretClauseList = [] // 将条款的表格复制到完整的条款解读表,id需要处理 params.data.processStandardInterpretClauseSublistList = compData.clauseData.map(item => { - item.standardInterpretClauseId = item.id - delete item.id + // 直接用完整表的不需要处理 + if (!item.standardInterpretClauseId) { + item.standardInterpretClauseId = item.id + delete item.id + } return item }) } diff --git a/src/views/workCenter/standardInterpretationProcess/modules/InterpretationLiaisonDistribute.vue b/src/views/workCenter/standardInterpretationProcess/modules/InterpretationLiaisonDistribute.vue index 148d848..3f85ca3 100644 --- a/src/views/workCenter/standardInterpretationProcess/modules/InterpretationLiaisonDistribute.vue +++ b/src/views/workCenter/standardInterpretationProcess/modules/InterpretationLiaisonDistribute.vue @@ -3,7 +3,7 @@
{{ $t('dispatchInformation') }}
- + @@ -27,6 +27,7 @@ import UserSelection from '@comp/selection/UserSelection' import InterpretationClauseTable from '@views/workCenter/standardInterpretationProcess/modules/InterpretationClauseTable' +import { YesOrNoEnum } from '@/enums/commonEnums' export default { name: 'InterpretationLiaisonDistribute', components: { InterpretationClauseTable, UserSelection }, @@ -62,7 +63,9 @@ export default { } }, // 表单的数据 - formInline: {} + formInline: {}, + // 是否显示条款表格 + showClauseTable: false } }, methods: { @@ -74,7 +77,7 @@ export default { const obj = {} if (isValidate) { // 至少一条数据 - if (!this.$refs.interpretationClauseTable.getData().length) { + if (this.showClauseTable && !this.$refs.interpretationClauseTable.getData().length) { this.$message.warn(this.$t('addAtLeastOneRowOfData')) this._flag = true } @@ -89,7 +92,7 @@ export default { obj.formData = this.form.getFieldsValue() } // 条款列表 - obj.clauseData = this.$refs.interpretationClauseTable.getData() + obj.clauseData = this.showClauseTable ? this.$refs.interpretationClauseTable.getData() : [] // 获取所有删除的id obj.processAllDelIds = this.$refs.interpretationClauseTable && this.$refs.interpretationClauseTable.processAllDelIds return obj @@ -97,9 +100,12 @@ export default { // 更新组件内的数据 setData (data) { this.clauseDataSource = data.data.processStandardInterpretClauseList || [] - this.$refs.interpretationClauseTable.setData(this.clauseDataSource) - this.formInline = data.data.processStandardInterpret - this.form.setFieldsValue(this.formInline) + this.formInline = data.data.processStandardInterpret || {} + this.showClauseTable = this.formInline.chooseClause === YesOrNoEnum.YES.value + this.$nextTick(() => { + this.form.setFieldsValue(this.formInline) + this.$refs.interpretationClauseTable.setData(this.clauseDataSource) + }) }, // 选择用户回显用户名 userSelectNameChange (value, fieldName) {