mirror of
https://gitee.com/myxzgzs/boyue-ui-admin-vue3
synced 2025-08-08 16:32:43 +08:00
【代码评审】BPM:下一个审批人
This commit is contained in:
parent
202d4b6795
commit
0e452aa1a7
@ -117,7 +117,6 @@ const activityNodes = ref<ProcessInstanceApi.ApprovalNodeInfo[]>([]) // 审批
|
||||
|
||||
/** 设置表单信息、获取流程图数据 **/
|
||||
const initProcessInfo = async (row: any, formVariables?: any) => {
|
||||
|
||||
// 重置指定审批人
|
||||
startUserSelectTasks.value = []
|
||||
startUserSelectAssignees.value = {}
|
||||
@ -144,7 +143,7 @@ const initProcessInfo = async (row: any, formVariables?: any) => {
|
||||
id: row.id,
|
||||
processVariablesStr: JSON.stringify(formVariables)
|
||||
})
|
||||
// }
|
||||
|
||||
// 加载流程图
|
||||
const processDefinitionDetail = await DefinitionApi.getProcessDefinition(row.id)
|
||||
if (processDefinitionDetail) {
|
||||
|
@ -729,11 +729,12 @@ const initNextAssigneesFormField = async () => {
|
||||
})
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((node: any) => {
|
||||
// 如果是发起人自选,并且没有审批人 或者 是审批人自选
|
||||
if (
|
||||
// 情况一:当前节点没有审批人,并且是发起人自选
|
||||
(isEmpty(node.tasks) &&
|
||||
isEmpty(node.candidateUsers) &&
|
||||
CandidateStrategy.START_USER_SELECT === node.candidateStrategy) ||
|
||||
// 情况二:当前节点是审批人自选
|
||||
CandidateStrategy.APPROVE_USER_SELECT === node.candidateStrategy
|
||||
) {
|
||||
nextAssigneesActivityNode.value.push(node)
|
||||
@ -748,11 +749,13 @@ const selectNextAssigneesConfirm = (id: string, userList: any[]) => {
|
||||
}
|
||||
/** 审批通过时,校验每个自选审批人的节点是否都已配置了审批人 */
|
||||
const validateNextAssignees = () => {
|
||||
// TODO @小北:可以考虑 Object.keys(nextAssigneesActivityNode.value).length === 0) return true;减少括号层级
|
||||
// 如果需要自选审批人,则校验自选审批人
|
||||
if (Object.keys(nextAssigneesActivityNode.value).length > 0) {
|
||||
// 校验每个节点是否都已配置审批人
|
||||
for (const item of nextAssigneesActivityNode.value) {
|
||||
if (isEmpty(approveReasonForm.nextAssignees[item.id])) {
|
||||
// TODO @小北:可以打印下节点名,嘿嘿。
|
||||
message.warning('下一个节点的审批人不能为空!')
|
||||
return false
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user