feat: 流程审批,预测下个节点是否需要选择审批人

This commit is contained in:
lizhixian 2025-02-25 17:17:00 +08:00
parent b346545cbf
commit 59528284ca
2 changed files with 27 additions and 3 deletions

View File

@ -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 {
//

View File

@ -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 = (
}
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>