From 074deb26b7737ad958748c11d35c8597430ff2e0 Mon Sep 17 00:00:00 2001 From: danshihao Date: Thu, 11 Jul 2024 15:45:19 +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 --- src/api/workCenter.js | 9 ++ src/enums/commonEnums.js | 5 + src/views/dashboard/modules/ToDoTaskCard.vue | 8 +- .../StandardInterpretationProcess.vue | 106 +++++++++++------- .../modules/InterpretationClauseTable.vue | 36 +++++- .../InterpretationClauseTableModal.vue | 18 +-- .../InterpretationInterpreterFillInfo.vue | 6 +- ...nterpretationMainInterpreterDistribute.vue | 16 +-- 8 files changed, 135 insertions(+), 69 deletions(-) diff --git a/src/api/workCenter.js b/src/api/workCenter.js index 97eaa2e..d132d4f 100644 --- a/src/api/workCenter.js +++ b/src/api/workCenter.js @@ -79,6 +79,12 @@ const interpretGetClauseList = (params) => getAction('/process/standardInterpret const interpretFlowApproval = (params) => postAction('/process/standardInterpretFlow/flowApproval', params) // 发起 const interpretFlowStart = (params) => postAction('/process/standardInterpretFlow/flowStart', params) +// 驳回 +const interpretFlowReject = (params) => postAction('/process/standardInterpretFlow/flowReject', params) +// 保存 +const interpretFlowSave = (params) => postAction('/process/standardInterpretFlow/flowSave', params) +// 保存 +const interpretFlowTransfer = (params) => postAction('/process/standardInterpretFlow/flowTransfer', params) // 获取详情 const interpretGetDetail = (params) => getAction('/process/standardInterpretFlow/queryDetail', params) @@ -145,6 +151,9 @@ export { interpretGetClauseList, interpretFlowApproval, interpretFlowStart, + interpretFlowReject, + interpretFlowSave, + interpretFlowTransfer, interpretGetDetail, compulsoryWithdrawal, diff --git a/src/enums/commonEnums.js b/src/enums/commonEnums.js index 9f53cb8..8a5dd82 100644 --- a/src/enums/commonEnums.js +++ b/src/enums/commonEnums.js @@ -250,3 +250,8 @@ export const AddType = { SELECT_STANDARD: { text: '选择标准', value: '1' }, MANUAL_ADD: { text: '手动新增', value: '2' } } + +export const IsDistribute = { + DISTRIBUTE: { text: '是', value: '1' }, + NOT_DISTRIBUTE: { text: '否', value: '2' } +} diff --git a/src/views/dashboard/modules/ToDoTaskCard.vue b/src/views/dashboard/modules/ToDoTaskCard.vue index c6432b7..09b0cde 100644 --- a/src/views/dashboard/modules/ToDoTaskCard.vue +++ b/src/views/dashboard/modules/ToDoTaskCard.vue @@ -172,8 +172,14 @@ export default { @size: 48px; .todo-card { height: calc(100vh - 611px); + /deep/ .ant-spin-container, + /deep/ .ant-spin-nested-loading, + /deep/ .ant-card-body { + height: 100%; + } } .content-wrapper { + height: calc(100% - 30px - 12px); margin-top: 10px; overflow-y: auto; @@ -224,7 +230,7 @@ export default { height: calc(100vh - 424px); } .content-wrapper { - height: calc(100vh - 506px); + //height: calc(100vh - 506px); .content-item { font-size: 14px; diff --git a/src/views/workCenter/standardInterpretationProcess/StandardInterpretationProcess.vue b/src/views/workCenter/standardInterpretationProcess/StandardInterpretationProcess.vue index 2558a30..6e85cfd 100644 --- a/src/views/workCenter/standardInterpretationProcess/StandardInterpretationProcess.vue +++ b/src/views/workCenter/standardInterpretationProcess/StandardInterpretationProcess.vue @@ -69,7 +69,7 @@ :current-node-id="currentNodeId" :disabled="disabled" ref="businessComp"/> - @@ -131,7 +131,12 @@ import { } from '@/enums/commonEnums' import { interpretGetProjectId, - interpretGetDetail, interpretFlowStart, interpretFlowApproval + interpretGetDetail, + interpretFlowStart, + interpretFlowApproval, + interpretFlowSave, + interpretFlowReject, + interpretFlowTransfer } from '@api/workCenter' import InterpretationInitiate from '@views/workCenter/standardInterpretationProcess/modules/InterpretationInitiate' import UserSelectModal from '@comp/selection/UserSelectModal' @@ -149,6 +154,11 @@ export default { mixins: [WorkCenterMixin], data () { return { + // 主解读人分发节点 + mainInterpreterDistributeNodes: [ + StandardInterpretationNodes.standardInterpreterDistribution.value, + StandardInterpretationNodes.standardInterpreterReDistribution.value + ], StandardInterpretationNodes, EN: 'en-us', processKey: ProcessKey.STANDARD_INTERPRETATION_PROCESS.value, @@ -378,23 +388,29 @@ export default { standardId: compData.standardData[0] && compData.standardData[0].id, projectId: this.projectId }) - // 条款列表 params.data.processStandardInterpretClauseList = compData.clauseData } else if (this.currentNodeId === StandardInterpretationNodes.controlDepartLiaisonDistribution.value) { // 联络人分发节点 params.data.processStandardInterpret = Object.assign({}, this.info.data.processStandardInterpret, compData.formData, { projectId: this.projectId }) - // 条款列表 params.data.processStandardInterpretClauseList = compData.clauseData - } else if (this.currentNodeId === StandardInterpretationNodes.standardInterpreterDistribution.value) { + } else if (this.mainInterpreterDistributeNodes.includes(this.currentNodeId)) { // 标准主解读人分发节点 - // 联络人分发节点 params.data.processStandardInterpret = Object.assign({}, this.info.data.processStandardInterpret, compData.formData, { projectId: this.projectId }) - // 条款列表 - params.data.processStandardInterpretClauseList = compData.clauseData + // 条款列表(分发和不分发传入的字段不一样) + if (compData.isDistribute) { + params.data.processStandardInterpretClauseList = compData.clauseData + } else { + // 将条款的表格复制到完整的条款解读表,id需要处理 + params.data.processStandardInterpretClauseSublistList = compData.clauseData.map(item => { + item.standardInterpretClauseId = item.id + delete item.id + return item + }) + } } else { // 解读人填写节点 及 后续节点 params.data.processStandardInterpret = Object.assign({}, this.info.data.processStandardInterpret, compData.formData, { @@ -418,26 +434,26 @@ export default { }, // 转办 continueTurnTo (userId) { - // if (this.loading) return - // this.loading = true - // const params = { - // taskId: this.$route.query.taskId, - // userId - // } - // transferInspectPlan(params).then(res => { - // if (res.success) { - // this.$message.success(res.message) - // this.goBack() - // } else { - // this.$message.warn(res.message) - // } - // }).catch(() => { - // this.loading = false - // }).finally(() => { - // setTimeout(() => { - // this.loading = false - // }, 1000) - // }) + if (this.loading) return + this.loading = true + const params = { + taskId: this.$route.query.taskId, + userId + } + interpretFlowTransfer(params).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warn(res.message) + } + }).catch(() => { + this.loading = false + }).finally(() => { + setTimeout(() => { + this.loading = false + }, 1000) + }) }, // 保存 handleSave () { @@ -447,14 +463,14 @@ export default { // 1待办 2草稿 res.saveSource = (this.$route.query.draftId || !this.$route.query.projectId) ? 2 : 1 console.log(res) - // return saveInspectPlan(res) + return interpretFlowSave(res) }).then(res => { - // if (res.success) { - // this.$message.success(res.message) - // this.goBack() - // } else { - // this.$message.warn(res.message) - // } + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warn(res.message) + } }).catch((err) => { console.log(err) this.loading = false @@ -547,18 +563,22 @@ export default { return } this.loading = true - this.getPageParams().then(res => { + this.getPageParams(false).then(res => { res.map.pass = false + // 解读人分发节点点击驳回特殊处理 + if (this.mainInterpreterDistributeNodes.includes(this.currentNodeId)) { + res.map.passFirst = 0 + } // 审批意见 res.processApprovalRecord.commitFlag = ApprovalOpinions.REJECT.value - // return rejectInspectPlan(res) + return interpretFlowReject(res) }).then(res => { - // if (res.success) { - // this.$message.success(res.message) - // this.goBack() - // } else { - // this.$message.warn(res.message) - // } + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warn(res.message) + } }).catch((err) => { if (err && err.message && tabList.includes(err.message)) { this.switchChange(err.message) diff --git a/src/views/workCenter/standardInterpretationProcess/modules/InterpretationClauseTable.vue b/src/views/workCenter/standardInterpretationProcess/modules/InterpretationClauseTable.vue index 1a3b7e1..dd39bbf 100644 --- a/src/views/workCenter/standardInterpretationProcess/modules/InterpretationClauseTable.vue +++ b/src/views/workCenter/standardInterpretationProcess/modules/InterpretationClauseTable.vue @@ -12,6 +12,10 @@ @change="handleImport"> {{ $t('import') }} + + + {{$t('workCenter.standardInterpretationProcess.batchEdit')}} + {{ $t('export') }} @@ -391,7 +395,11 @@ export default { selectionRows: [], url: { // 导入 - importExcelUrl: '' + importExcelUrl: '/process/standardInterpretFlow/importExcelByUnDistribute', + // 标准主解读人节点选择分发的导出 + exportDistribute: '/process/standardInterpretFlow/exportExcelByDistribute', + // 标准主解读人节点选择不分发的导出 + exportUnDistribute: '/process/standardInterpretFlow/exportExcelByUnDistribute' } } }, @@ -468,6 +476,13 @@ export default { ...mainInterpreterDistributeNodes // 标准主解读人分发节点 ].includes(this.currentNodeId) }, + // 显示批量编辑按钮 + showBatchEditBtn () { + return [ + StandardInterpretationNodes.interpreterFillInfoOne.value, // 解读人填写信息 + StandardInterpretationNodes.interpreterFillInfoTwo.value // 解读人填写信息 + ].includes(this.currentNodeId) + }, // 是否显示编辑按钮 showEditBtn () { // 标准主解读人分发节点 && 不分发 显示编辑按钮 @@ -558,13 +573,13 @@ export default { } // 前端存储,没有id的数据,前端加上uuid const data = info.file.response.result || [] - this.dataSource.push(...data.map((item, index) => { + this.dataSource = data.map(item => { // 导入的时候生成前端id,不用索引防止禁用出错 item.id = randomUUID() // 有该标识返回数据的时候把id给去掉,这里的id前端生成的 item[uuidFlag] = true return item - })) + }) } else { if (Array.isArray(info.file.response.result) && info.file.response.result.length > 0) { this.messageLineFeed(this.$t('fileImportError'), info.file.response.result) @@ -605,7 +620,11 @@ export default { if (!fileName || typeof fileName !== 'string') { fileName = '导出文件' } - const param = {} + const param = { + projectId: this.$route.query.projectId, + nodeId: this.$route.query.nodeId, + taskId: this.$route.query.taskId + } if (this.selectedRowKeys && this.selectedRowKeys.length > 0) { param.selections = this.selectedRowKeys.join(',') } @@ -620,7 +639,12 @@ export default { style: 'display: none' } }) - const url = '' + let url = '' + // 解读人分发节点 + if (this.isMainInterpreterDistribute) { + // 根据是否分发选择对应的接口 + url = this.isDistribute ? this.url.exportDistribute : this.url.exportUnDistribute + } downFile(url, param).then((data) => { if (!data) { this.$message.warning('文件下载失败') @@ -693,7 +717,7 @@ export default { const row = this.dataSource.find(item => item[this.rowKey] === formData[this.rowKey]) Object.assign(row, form) } else { - this.selectedRows.forEach(item => { + this.selectionRows.forEach(item => { Object.assign(item, form) }) } diff --git a/src/views/workCenter/standardInterpretationProcess/modules/InterpretationClauseTableModal.vue b/src/views/workCenter/standardInterpretationProcess/modules/InterpretationClauseTableModal.vue index 7716e27..6090ace 100644 --- a/src/views/workCenter/standardInterpretationProcess/modules/InterpretationClauseTableModal.vue +++ b/src/views/workCenter/standardInterpretationProcess/modules/InterpretationClauseTableModal.vue @@ -47,49 +47,49 @@ @@ -103,14 +103,14 @@ diff --git a/src/views/workCenter/standardInterpretationProcess/modules/InterpretationInterpreterFillInfo.vue b/src/views/workCenter/standardInterpretationProcess/modules/InterpretationInterpreterFillInfo.vue index 8e8c822..0c8503f 100644 --- a/src/views/workCenter/standardInterpretationProcess/modules/InterpretationInterpreterFillInfo.vue +++ b/src/views/workCenter/standardInterpretationProcess/modules/InterpretationInterpreterFillInfo.vue @@ -7,7 +7,7 @@ - + - + - + - + - + - + { this.$refs.interpretationClauseTable.setData(this.clauseDataSource) @@ -285,7 +287,7 @@ export default { handleNextStep () { this.form.validateFields((err, values) => { if (!err) { - this.isDistribute = values.isDistribute === '1' + this.isDistribute = values.isDistribute === IsDistribute.DISTRIBUTE.value this.isNextStep = true this.$nextTick(() => { this.$refs.interpretationClauseTable.setData(this.clauseDataSource)