mirror of
https://gitee.com/myxzgzs/boyue-ui-admin-vue3
synced 2025-08-08 16:32:43 +08:00
feat: 流程审批,预测下个节点是否需要选择审批人
This commit is contained in:
parent
b346545cbf
commit
59528284ca
@ -695,6 +695,30 @@ const openPopover = async (type: string) => {
|
|||||||
message.warning('表单校验不通过,请先完善表单!!')
|
message.warning('表单校验不通过,请先完善表单!!')
|
||||||
return
|
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') {
|
if (type === 'return') {
|
||||||
// 获取退回节点
|
// 获取退回节点
|
||||||
@ -788,6 +812,7 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) =>
|
|||||||
}
|
}
|
||||||
await TaskApi.approveTask(data)
|
await TaskApi.approveTask(data)
|
||||||
popOverVisible.value.approve = false
|
popOverVisible.value.approve = false
|
||||||
|
dialogVisibleSelectApproveUser.value = false
|
||||||
message.success('审批通过成功')
|
message.success('审批通过成功')
|
||||||
} else {
|
} else {
|
||||||
// 审批不通过数据
|
// 审批不通过数据
|
||||||
|
@ -42,7 +42,7 @@ watch(
|
|||||||
const finishedSequenceFlowActivityIds: string[] = newModelView.finishedSequenceFlowActivityIds
|
const finishedSequenceFlowActivityIds: string[] = newModelView.finishedSequenceFlowActivityIds
|
||||||
setSimpleModelNodeTaskStatus(
|
setSimpleModelNodeTaskStatus(
|
||||||
newModelView.simpleModel,
|
newModelView.simpleModel,
|
||||||
newModelView.processInstance.status,
|
newModelView.processInstance?.status,
|
||||||
rejectedTaskActivityIds,
|
rejectedTaskActivityIds,
|
||||||
unfinishedTaskActivityIds,
|
unfinishedTaskActivityIds,
|
||||||
finishedActivityIds,
|
finishedActivityIds,
|
||||||
@ -171,5 +171,4 @@ const setSimpleModelNodeTaskStatus = (
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped></style>
|
||||||
</style>
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user