From 59528284ca854fe0b0d3f03301aec85722d22487 Mon Sep 17 00:00:00 2001 From: lizhixian <18210040298@163.com> Date: Tue, 25 Feb 2025 17:17:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B5=81=E7=A8=8B=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=EF=BC=8C=E9=A2=84=E6=B5=8B=E4=B8=8B=E4=B8=AA=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E9=9C=80=E8=A6=81=E9=80=89=E6=8B=A9=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../detail/ProcessInstanceOperationButton.vue | 25 +++++++++++++++++++ .../detail/ProcessInstanceSimpleViewer.vue | 5 ++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue index bfb7e05e..5e1c5082 100644 --- a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue +++ b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue @@ -695,6 +695,30 @@ const openPopover = async (type: string) => { message.warning('表单校验不通过,请先完善表单!!') return } + // 获取修改的流程变量, 暂时只支持流程表单 + const variables = getUpdatedProcessInstanceVariables() + const param = { + processInstanceId: props.processInstance.id, + processVariablesStr: JSON.stringify(variables) + } + // 流程通过时,根据表单变量查询新的流程节点,判断下一个节点类型是否为自选审批人 + const res = await ProcessInstanceApi.getApprovalDetail(param) + //当前待审批节点id + const activityId = res.todoTask?.taskDefinitionKey + if (res.activityNodes && res.activityNodes.length > 0) { + // 找到当前节点的索引 + const currentNodeIndex = res.activityNodes.findIndex((node) => node.id === activityId) + const nextNode = res.activityNodes[currentNodeIndex + 1] + if ( + nextNode.candidateStrategy === CandidateStrategy.START_USER_SELECT && + !nextNode.tasks && + nextNode.candidateUsers?.length === 0 + ) { + // 自选审批人,则弹出选择审批人弹窗 + activityNodes.value = [nextNode] + dialogVisibleSelectApproveUser.value = true + } + } } if (type === 'return') { // 获取退回节点 @@ -788,6 +812,7 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) => } await TaskApi.approveTask(data) popOverVisible.value.approve = false + dialogVisibleSelectApproveUser.value = false message.success('审批通过成功') } else { // 审批不通过数据 diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue b/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue index c4a6a364..60209619 100644 --- a/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue +++ b/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue @@ -42,7 +42,7 @@ watch( const finishedSequenceFlowActivityIds: string[] = newModelView.finishedSequenceFlowActivityIds setSimpleModelNodeTaskStatus( newModelView.simpleModel, - newModelView.processInstance.status, + newModelView.processInstance?.status, rejectedTaskActivityIds, unfinishedTaskActivityIds, finishedActivityIds, @@ -171,5 +171,4 @@ const setSimpleModelNodeTaskStatus = ( } - +