gaoluyang
10 天以前 e65bfa1d46d255f307eaa057665f01c8bde0e122
src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js
@@ -13,6 +13,7 @@
import { getQuotationList } from "@/api/salesManagement/salesQuotation.js";
import { getPurchaseByCode } from "@/api/procurementManagement/procurementLedger.js";
import { getDeliveryDetailByShippingNo } from "@/api/salesManagement/deliveryLedger.js";
import { ledgerListPage, getSalesLedgerWithProducts } from "@/api/salesManagement/salesLedger.js";
import useUserStore from "@/store/modules/user";
import { Search } from "@element-plus/icons-vue";
import { ElMessage, ElMessageBox } from "element-plus";
@@ -140,7 +141,7 @@
  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 +155,9 @@
      prop: "unread",
      width: 90,
      align: "center",
      dataType: "tag",
      formatData: (v) => (v ? "是" : "否"),
      formatType: (v) => (v ? "success" : "danger"),
    },
    {
      label: "审批状态",
@@ -224,7 +227,7 @@
        fetchBusinessTypeOptions(),
        listApprovalTemplate(TEMPLATE_TYPE_CUSTOM),
      ]);
      submitBusinessTypeOptions.value = typeOptions.filter((x) => ![5, 6, 7].includes(x.value));
      submitBusinessTypeOptions.value = typeOptions.filter((x) => ![5, 6, 7, 19].includes(x.value));
      allSubmitTemplates.value = unwrapTemplateList(customRes)
        .filter((row) => mapEnabledFromApi(row.enabled))
        .map(mapSubmitTemplateCard);
@@ -322,6 +325,22 @@
      }
    }
    
    // 销售审批:用 quotationNo(销售合同号)去查销售台账详情
    else if (row.businessType === 19) {
      const salesContractNo = row?.quotationNo;
      if (salesContractNo) {
        const listRes = await ledgerListPage({ salesContractNo });
        const records = listRes?.records || listRes?.data || [];
        const ledger = Array.isArray(records) ? records[0] : null;
        if (ledger?.id) {
          const detail = await getSalesLedgerWithProducts({ id: ledger.id, type: 1 });
          detailData.value = detail || ledger;
        } else {
          detailData.value = ledger || {};
        }
      }
    }
    // 其他审批类型
    else {
      detailData.value = {};
@@ -367,6 +386,22 @@
      }
    }
    // 销售审批:用 quotationNo(销售合同号)去查销售台账详情
    else if (row.businessType === 19) {
      const salesContractNo = row?.quotationNo;
      if (salesContractNo) {
        const listRes = await ledgerListPage({ salesContractNo });
        const records = listRes?.records || listRes?.data || [];
        const ledger = Array.isArray(records) ? records[0] : null;
        if (ledger?.id) {
          const detail = await getSalesLedgerWithProducts({ id: ledger.id, type: 1 });
          detailData.value = detail || ledger;
        } else {
          detailData.value = ledger || {};
        }
      }
    }
    // 其他审批类型
    else {
      detailData.value = {};