[update 标准解读流程] 完善

This commit is contained in:
danshihao
2024-07-15 18:31:03 +08:00
parent d731c1e59e
commit 6c2f4b24b2
2 changed files with 18 additions and 9 deletions
@@ -432,8 +432,11 @@ export default {
params.data.processStandardInterpretClauseList = [] params.data.processStandardInterpretClauseList = []
// 将条款的表格复制到完整的条款解读表,id需要处理 // 将条款的表格复制到完整的条款解读表,id需要处理
params.data.processStandardInterpretClauseSublistList = compData.clauseData.map(item => { 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 return item
}) })
} }
@@ -3,7 +3,7 @@
<a-spin :spinning="loading"> <a-spin :spinning="loading">
<div class="process-part-title">{{ $t('dispatchInformation') }}</div> <div class="process-part-title">{{ $t('dispatchInformation') }}</div>
<!-- 条款的表格 --> <!-- 条款的表格 -->
<interpretation-clause-table ref="interpretationClauseTable" :disabled="disabled" :current-node-id="currentNodeId"/> <interpretation-clause-table v-if="showClauseTable" ref="interpretationClauseTable" :disabled="disabled" :current-node-id="currentNodeId"/>
<a-form :form="form" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form :form="form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row> <a-row>
<a-col :span="8"> <a-col :span="8">
@@ -27,6 +27,7 @@
import UserSelection from '@comp/selection/UserSelection' import UserSelection from '@comp/selection/UserSelection'
import InterpretationClauseTable import InterpretationClauseTable
from '@views/workCenter/standardInterpretationProcess/modules/InterpretationClauseTable' from '@views/workCenter/standardInterpretationProcess/modules/InterpretationClauseTable'
import { YesOrNoEnum } from '@/enums/commonEnums'
export default { export default {
name: 'InterpretationLiaisonDistribute', name: 'InterpretationLiaisonDistribute',
components: { InterpretationClauseTable, UserSelection }, components: { InterpretationClauseTable, UserSelection },
@@ -62,7 +63,9 @@ export default {
} }
}, },
// 表单的数据 // 表单的数据
formInline: {} formInline: {},
// 是否显示条款表格
showClauseTable: false
} }
}, },
methods: { methods: {
@@ -74,7 +77,7 @@ export default {
const obj = {} const obj = {}
if (isValidate) { if (isValidate) {
// 至少一条数据 // 至少一条数据
if (!this.$refs.interpretationClauseTable.getData().length) { if (this.showClauseTable && !this.$refs.interpretationClauseTable.getData().length) {
this.$message.warn(this.$t('addAtLeastOneRowOfData')) this.$message.warn(this.$t('addAtLeastOneRowOfData'))
this._flag = true this._flag = true
} }
@@ -89,7 +92,7 @@ export default {
obj.formData = this.form.getFieldsValue() obj.formData = this.form.getFieldsValue()
} }
// 条款列表 // 条款列表
obj.clauseData = this.$refs.interpretationClauseTable.getData() obj.clauseData = this.showClauseTable ? this.$refs.interpretationClauseTable.getData() : []
// 获取所有删除的id // 获取所有删除的id
obj.processAllDelIds = this.$refs.interpretationClauseTable && this.$refs.interpretationClauseTable.processAllDelIds obj.processAllDelIds = this.$refs.interpretationClauseTable && this.$refs.interpretationClauseTable.processAllDelIds
return obj return obj
@@ -97,9 +100,12 @@ export default {
// 更新组件内的数据 // 更新组件内的数据
setData (data) { setData (data) {
this.clauseDataSource = data.data.processStandardInterpretClauseList || [] this.clauseDataSource = data.data.processStandardInterpretClauseList || []
this.$refs.interpretationClauseTable.setData(this.clauseDataSource) this.formInline = data.data.processStandardInterpret || {}
this.formInline = data.data.processStandardInterpret this.showClauseTable = this.formInline.chooseClause === YesOrNoEnum.YES.value
this.form.setFieldsValue(this.formInline) this.$nextTick(() => {
this.form.setFieldsValue(this.formInline)
this.$refs.interpretationClauseTable.setData(this.clauseDataSource)
})
}, },
// 选择用户回显用户名 // 选择用户回显用户名
userSelectNameChange (value, fieldName) { userSelectNameChange (value, fieldName) {