src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js
@@ -37,6 +37,7 @@
import {
  APPROVAL_STATUS_SEARCH_OPTIONS,
  APPROVAL_TYPE_OPTIONS,
  approvalRecordResultLabel,
  approvalStatusLabel,
  approvalStatusTagType,
  approvalTypeLabel,
@@ -48,6 +49,7 @@
  mapInstanceFromApi,
  mapSubmitTemplateCard,
  matchBusinessTypeValue,
  normalizeApprovalStatusKey,
  unwrapInstancePage,
} from "./approveListConstants.js";
@@ -138,9 +140,19 @@
    ...buildFormPayloadRules(submitFormFields.value),
  }));
  /** 仅「发起人本人」在「已驳回」状态下可修改 */
  function canEditInstanceRow(row) {
    if (!row) return false;
    const key = normalizeApprovalStatusKey(row.approvalStatus ?? row.statusRaw ?? row.status);
    if (key !== "rejected") return false;
    const applicantId = row.applicantId ?? row.applicantNo;
    if (applicantId == null || applicantId === "") return false;
    return String(applicantId) === String(userStore.id);
  }
  const tableColumn = ref([
    // { label: "申请人编号", prop: "applicantNo", width: 110 },
    { label: "申请人名称", prop: "applicantName", minWidth: 100 },
    { label: "发起人", prop: "applicantName", minWidth: 100 },
    { label: "模板类型", prop: "businessName", minWidth: 120 },
    {
      label: "审批类型",
@@ -154,7 +166,9 @@
      prop: "unread",
      width: 90,
      align: "center",
      dataType: "tag",
      formatData: (v) => (v ? "是" : "否"),
      formatType: (v) => (v ? "success" : "danger"),
    },
    {
      label: "审批状态",
@@ -181,7 +195,7 @@
        {
          name: "修改",
          type: "text",
          disabled: (row) => row.approvalStatus !== "pending",
          disabled: (row) => !canEditInstanceRow(row),
          clickFun: (row) => openEditDialog(row),
        },
        {
@@ -190,11 +204,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),
        // },
      ],
    },
  ]);
@@ -393,8 +407,8 @@
  }
  async function openEditDialog(row) {
    if (row?.approvalStatus !== "pending") {
      ElMessage.warning("仅审核中的审批可修改");
    if (!canEditInstanceRow(row)) {
      ElMessage.warning("仅本人发起、且已被驳回的审批可修改");
      return;
    }
    const moduleKey = inferReimburseModuleKeyFromInstance(row);
@@ -635,9 +649,7 @@
  }
  function approvalActionLabel(result) {
    if (result === "approved") return "通过";
    if (result === "rejected") return "驳回";
    return "待处理";
    return approvalRecordResultLabel(result);
  }
  return {
@@ -686,6 +698,7 @@
    resetSubmitDialogState,
    openSubmitDialog,
    openEditDialog,
    canEditInstanceRow,
    onBusinessTypePick,
    onTemplatePick,
    backToBusinessTypePick,