| | |
| | | import { getApprovalDetail as getApprovalDetailApi } from '#/api/bpm/processInstance'; |
| | | import { $t } from '#/locales'; |
| | | import { router } from '#/router'; |
| | | import { automaticApproval } from '#/store/audit-policy'; |
| | | import ProcessInstanceTimeline from '#/views/bpm/processInstance/detail/modules/time-line.vue'; |
| | | |
| | | import { useFormSchema } from './data'; |
| | |
| | | return; |
| | | } |
| | | // 1.2 审批相关:校验指定审批人 |
| | | if (startUserSelectTasks.value?.length > 0) { |
| | | if (!automaticApproval.value && startUserSelectTasks.value?.length > 0) { |
| | | for (const userTask of startUserSelectTasks.value) { |
| | | const assignees = startUserSelectAssignees.value[userTask.id]; |
| | | if (Array.isArray(assignees) && assignees.length === 0) { |
| | |
| | | // 提交表单 |
| | | const data = (await formApi.getValues()) as LeaveCreateData; |
| | | // 审批相关:设置指定审批人 |
| | | if (startUserSelectTasks.value?.length > 0) { |
| | | if (!automaticApproval.value && startUserSelectTasks.value?.length > 0) { |
| | | data.startUserSelectAssignees = startUserSelectAssignees.value; |
| | | } |
| | | // 格式化开始时间和结束时间的值 |
| | |
| | | |
| | | /** 审批相关:获取审批详情 */ |
| | | async function getApprovalDetail() { |
| | | if (automaticApproval.value) return; |
| | | processTimeLineLoading.value = true; |
| | | try { |
| | | const data = await getApprovalDetailApi({ |
| | |
| | | BpmCandidateStrategyEnum.START_USER_SELECT === node.candidateStrategy, |
| | | ); |
| | | // 恢复之前的选择审批人 |
| | | if (startUserSelectTasks.value?.length > 0) { |
| | | if (!automaticApproval.value && startUserSelectTasks.value?.length > 0) { |
| | | for (const node of startUserSelectTasks.value) { |
| | | const tempAssignees = tempStartUserSelectAssignees.value[node.id]; |
| | | startUserSelectAssignees.value[node.id] = tempAssignees?.length |
| | |
| | | |
| | | /** 初始化 */ |
| | | onMounted(async () => { |
| | | if (automaticApproval.value) { |
| | | if (query.id) await getDetail(Number(query.id)); |
| | | return; |
| | | } |
| | | const processDefinitionDetail: any = await getProcessDefinition( |
| | | undefined, |
| | | processDefineKey, |