liding
22 小时以前 d6e9c96bebac09e62578b6c902bc23441b44017c
fix:协同审批删除取消
已修改1个文件
61 ■■■■ 文件已修改
src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js 61 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js
@@ -60,7 +60,8 @@
  const submitTemplatesLoading = ref(false);
  const submitTemplateCards = computed(() => {
    if (selectedBusinessType.value == null || selectedBusinessType.value === "") return [];
    if (selectedBusinessType.value == null || selectedBusinessType.value === "")
      return [];
    return allSubmitTemplates.value.filter((card) =>
      matchBusinessTypeValue(card.businessType, selectedBusinessType.value)
    );
@@ -101,23 +102,36 @@
  const isSubmitEdit = computed(() => submitDialog.mode === "edit");
  const submitDialogTitle = computed(() => {
    if (submitDialog.mode === "edit") {
      return `修改${activeTemplate.value?.label || submitForm.templateName || "审批"}`;
      return `修改${
        activeTemplate.value?.label || submitForm.templateName || "审批"
      }`;
    }
    if (submitDialog.step === 1) return "选择模板类型";
    if (submitDialog.step === 2) return `选择审批模板${businessTypeLabel(selectedBusinessType.value) ? `(${businessTypeLabel(selectedBusinessType.value)})` : ""}`;
    if (submitDialog.step === 2)
      return `选择审批模板${
        businessTypeLabel(selectedBusinessType.value)
          ? `(${businessTypeLabel(selectedBusinessType.value)})`
          : ""
      }`;
    return `提交${activeTemplate.value?.label || "审批"}`;
  });
  const selectedBusinessTypeLabel = computed(() => businessTypeLabel(selectedBusinessType.value));
  const selectedBusinessTypeLabel = computed(() =>
    businessTypeLabel(selectedBusinessType.value)
  );
  function businessTypeLabel(type) {
    if (type == null || type === "") return "";
    const hit = submitBusinessTypeOptions.value.find((x) => matchBusinessTypeValue(x.value, type));
    const hit = submitBusinessTypeOptions.value.find((x) =>
      matchBusinessTypeValue(x.value, type)
    );
    return hit?.label || "";
  }
  function countTemplatesByBusinessType(type) {
    return allSubmitTemplates.value.filter((card) => matchBusinessTypeValue(card.businessType, type)).length;
    return allSubmitTemplates.value.filter((card) =>
      matchBusinessTypeValue(card.businessType, type)
    ).length;
  }
  const activeTemplate = computed(() => submitForm.templateSnapshot || null);
@@ -130,7 +144,9 @@
  });
  const submitFormRules = computed(() => ({
    templateKey: [{ required: true, message: "请选择审批类型", trigger: "change" }],
    templateKey: [
      { required: true, message: "请选择审批类型", trigger: "change" },
    ],
    ...buildFormPayloadRules(submitFormFields.value),
  }));
@@ -186,11 +202,11 @@
          disabled: (row) => row.approvalStatus !== "pending" || !row.isApprove,
          clickFun: (row) => openApprove(row),
        },
        {
          name: "删除",
          type: "danger",
          clickFun: (row) => removeInstance(row),
        },
        // {
        //   name: "删除",
        //   type: "danger",
        //   clickFun: (row) => removeInstance(row),
        // },
      ],
    },
  ]);
@@ -336,7 +352,9 @@
      try {
        await navigateToReimburseManageForEdit(proxy?.$router, moduleKey, rid);
      } catch {
        ElMessage.warning("未找到差旅/费用报销菜单路由,请从左侧菜单进入后再编辑");
        ElMessage.warning(
          "未找到差旅/费用报销菜单路由,请从左侧菜单进入后再编辑"
        );
      }
      return;
    }
@@ -361,7 +379,9 @@
        templateKey: String(card.id),
        ...applied,
        businessType:
          applied.businessType ?? card.businessType ?? selectedBusinessType.value,
          applied.businessType ??
          card.businessType ??
          selectedBusinessType.value,
      });
      submitDialog.step = 3;
    } catch {
@@ -402,7 +422,9 @@
      return false;
    }
    if (!activeTemplate.value) return false;
    const bindingCheck = validateTemplateBinding({ flowNodes: submitForm.flowNodes });
    const bindingCheck = validateTemplateBinding({
      flowNodes: submitForm.flowNodes,
    });
    if (!bindingCheck.ok) {
      ElMessage.warning(bindingCheck.message);
      return false;
@@ -441,7 +463,9 @@
      return false;
    }
    if (!activeTemplate.value) return false;
    const bindingCheck = validateTemplateBinding({ flowNodes: submitForm.flowNodes });
    const bindingCheck = validateTemplateBinding({
      flowNodes: submitForm.flowNodes,
    });
    if (!bindingCheck.ok) {
      ElMessage.warning(bindingCheck.message);
      return false;
@@ -463,7 +487,10 @@
      );
      submitDialog.visible = false;
      await fetchApprovalList();
      if (detailDialog.visible && detailRow.value?.id === submitForm.instanceId) {
      if (
        detailDialog.visible &&
        detailRow.value?.id === submitForm.instanceId
      ) {
        const hit = tableData.value.find((r) => r.id === submitForm.instanceId);
        if (hit) detailRow.value = { ...hit };
        else detailDialog.visible = false;