云
2 天以前 ec8ff4f6259404460a0b4437e29a40986c2c4b9d
src/views/bpm/oa/leave/create.vue
@@ -18,6 +18,7 @@
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';
@@ -67,7 +68,7 @@
    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) {
@@ -79,7 +80,7 @@
  // 提交表单
  const data = (await formApi.getValues()) as LeaveCreateData;
  // 审批相关:设置指定审批人
  if (startUserSelectTasks.value?.length > 0) {
  if (!automaticApproval.value && startUserSelectTasks.value?.length > 0) {
    data.startUserSelectAssignees = startUserSelectAssignees.value;
  }
  // 格式化开始时间和结束时间的值
@@ -118,6 +119,7 @@
/** 审批相关:获取审批详情 */
async function getApprovalDetail() {
  if (automaticApproval.value) return;
  processTimeLineLoading.value = true;
  try {
    const data = await getApprovalDetailApi({
@@ -144,7 +146,7 @@
        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
@@ -212,6 +214,10 @@
/** 初始化 */
onMounted(async () => {
  if (automaticApproval.value) {
    if (query.id) await getDetail(Number(query.id));
    return;
  }
  const processDefinitionDetail: any = await getProcessDefinition(
    undefined,
    processDefineKey,