From e932d40c83ce59208e82fbf330ec4cdfc0588193 Mon Sep 17 00:00:00 2001 From: danshihao Date: Tue, 9 Jul 2024 17:44:06 +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=88=86=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/lang/workCenter/zh.js | 5 +- .../StandardInterpretationProcess.vue | 8 + .../InterpretationLiaisonDistribute.vue | 2 + ...nterpretationMainInterpreterDistribute.vue | 195 +++++++++++------- 4 files changed, 129 insertions(+), 81 deletions(-) diff --git a/src/common/lang/workCenter/zh.js b/src/common/lang/workCenter/zh.js index fd604bf..d3ec446 100644 --- a/src/common/lang/workCenter/zh.js +++ b/src/common/lang/workCenter/zh.js @@ -78,7 +78,10 @@ module.exports = { pleaseAddStandard: '请添加一条标准', mainInterpreter: '主解读人', interpretingTasksIsDistribute: '解读任务是否下发', - departInterpretingPeople: '各涉及部门解读人' + departInterpretingPeople: '各涉及部门解读人', + batchSelectionUser: '批量选择人员', + pleaseSelectTheNextStep: '请选择下一步', + }, // 流程配置 processConfig: { diff --git a/src/views/workCenter/standardInterpretationProcess/StandardInterpretationProcess.vue b/src/views/workCenter/standardInterpretationProcess/StandardInterpretationProcess.vue index 946c67a..6a13524 100644 --- a/src/views/workCenter/standardInterpretationProcess/StandardInterpretationProcess.vue +++ b/src/views/workCenter/standardInterpretationProcess/StandardInterpretationProcess.vue @@ -380,6 +380,14 @@ export default { }) // 条款列表 params.data.processStandardInterpretClauseList = compData.clauseData + } else if (this.currentNodeId === StandardInterpretationNodes.standardInterpreterDistribution.value) { + // 标准主解读人分发节点 + // 联络人分发节点 + params.data.processStandardInterpret = Object.assign({}, this.info.data.processStandardInterpret, compData.formData, { + projectId: this.projectId + }) + // 条款列表 + params.data.processStandardInterpretClauseList = compData.clauseData } // 如果有校验失败的,那就报错 if (flag) { diff --git a/src/views/workCenter/standardInterpretationProcess/modules/InterpretationLiaisonDistribute.vue b/src/views/workCenter/standardInterpretationProcess/modules/InterpretationLiaisonDistribute.vue index a7e17e3..f176934 100644 --- a/src/views/workCenter/standardInterpretationProcess/modules/InterpretationLiaisonDistribute.vue +++ b/src/views/workCenter/standardInterpretationProcess/modules/InterpretationLiaisonDistribute.vue @@ -147,6 +147,8 @@ export default { resolve(values) }) }) + } else { + obj.formData = this.form.getFieldsValue() } // 条款列表 obj.clauseData = this.clauseDataSource diff --git a/src/views/workCenter/standardInterpretationProcess/modules/InterpretationMainInterpreterDistribute.vue b/src/views/workCenter/standardInterpretationProcess/modules/InterpretationMainInterpreterDistribute.vue index cf576c4..cf77601 100644 --- a/src/views/workCenter/standardInterpretationProcess/modules/InterpretationMainInterpreterDistribute.vue +++ b/src/views/workCenter/standardInterpretationProcess/modules/InterpretationMainInterpreterDistribute.vue @@ -19,77 +19,81 @@
- 下一步 + + {{ $t('next') }}
- - @@ -177,7 +181,7 @@ export default { // 解读任务是否下发 isDistribute: { rules: [ - { required: false, message: this.$t('pleaseSelect') + this.$t('workCenter.standardInterpretationProcess.interpretingTasksIsDistribute') } + { required: true, message: this.$t('pleaseSelect') + this.$t('workCenter.standardInterpretationProcess.interpretingTasksIsDistribute') } ], validateTrigger: 'change' } @@ -236,25 +240,51 @@ export default { showSizeChanger: true, total: 0 }, - selectedClauseRowKeys: [] + selectedClauseRowKeys: [], + selectedClauseRows: [] } }, methods: { - getData (isValidate) { - + async getData (isValidate) { + const obj = {} + if (isValidate) { + obj.formData = await new Promise((resolve) => { + this.form.validateFields((err, values) => { + if (err) { obj._flag = true } + // 校验成功失败都返回表单数据 + resolve(values) + }) + }) + // 选择是否分发,校验是否下一步 + if (!this.isNextStep) { + obj._flag = true + this.$message.warn(this.$t('workCenter.standardInterpretationProcess.pleaseSelectTheNextStep')) + } + // 如果有没填各涉及部门解读人,提示请完善表格信息 + if (this.clauseDataSource.some(item => !item.interpretPersonIds)) { + obj._flag = true + this.$message.warn(this.$t('pleaseCompleteTableInfo')) + } + } else { + obj.formData = this.form.getFieldsValue() + } + obj.clauseData = this.clauseDataSource + return obj }, setData (data) { - + console.log(data) + this.dataSource = [data.data.processStandardInterpret] + this.formInline = data.data.processStandardInterpret + this.clauseDataSource = data.data.processStandardInterpretClauseList }, - // 是否下发 - hanldeChangeIsDistribute (val) { - if (val + '' === '1') { - this.isDistribute = true - } else if (val + '' === '2') { - this.isDistribute = false - } else { - this.isDistribute = null - } + // 下一步 + handleNextStep () { + this.form.validateFields((err, values) => { + if (!err) { + this.isDistribute = values.isDistribute === '1' + this.isNextStep = true + } + }) }, // 条款导出 handleExportClause () { @@ -271,7 +301,9 @@ export default { content: this.$t('deleteAData'), onOk: () => { this.clauseDataSource = this.clauseDataSource.filter(item => !this.selectedClauseRowKeys.includes(item.id)) + this.clauseIpagination.total = this.clauseDataSource.length this.selectedClauseRowKeys = [] + this.selectedClauseRows = [] // 重新计算分页问题 that.handleClauseReCalculatePage(that.selectedClauseRowKeys.length) } @@ -307,8 +339,9 @@ export default { } }, // 勾选条款 - onSelectClauseChange (keys) { + onSelectClauseChange (keys, rows) { this.selectedClauseRowKeys = keys + this.selectedClauseRows = rows }, /** * 显示条款内容、条文解读弹框 @@ -334,19 +367,21 @@ export default { this.$refs.userSelectModal.open() }, // 批量选择人员回调 - handleClauseBatchSelectUserCallback (user) { - // this.clauseDataSource.forEach(item => { - // if (this.selectedClauseRowKeys.includes(item.id)) { - // item.interpretPersonIds = user - // } - // }) - console.log(user) + handleClauseBatchSelectUserCallback (userList) { + const ids = userList.map(item => item.id).join(',') + const names = userList.map(item => `${item.realname}(${item.username})`).join(',') + this.selectedClauseRows.forEach(item => { + item.interpretPersonIds = ids + item.interpretPersonIds_dictText = names + }) } } } -