From 1d8a79d7a7e4902984b110f0cee5083b6f88557a Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 21 九月 2026 10:55:13 +0800
Subject: [PATCH] 新疆-融邦 1.销售订单根据类别修改展示字段 2.销售台账新增时选择完客户提示一下当前客户的信托基金额度

---
 src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js |   72 ++++++++++++++++++++++++++++++-----
 1 files changed, 61 insertions(+), 11 deletions(-)

diff --git a/src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js b/src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js
index 3f0e99c..b413fd8 100644
--- a/src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js
+++ b/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 } from "@/api/salesManagement/salesLedger.js";
 import useUserStore from "@/store/modules/user";
 import { Search } from "@element-plus/icons-vue";
 import { ElMessage, ElMessageBox } from "element-plus";
@@ -120,6 +121,18 @@
     return hit?.label || "";
   }
 
+  // 鍒楄〃銆屼笟鍔″崟鍙枫�嶏細鎸変笟鍔$被鍨嬪彇瀵瑰簲鐨勫崟鍙凤紙19=閿�鍞彴璐﹀鎵癸級
+  function businessNoOf(row) {
+    return (
+      row?.salesContractNo ||
+      row?.quotationNo ||
+      row?.purchaseContractNumber ||
+      row?.shippingNo ||
+      row?.bizId ||
+      ""
+    );
+  }
+
   function countTemplatesByBusinessType(type) {
     return allSubmitTemplates.value.filter((card) => matchBusinessTypeValue(card.businessType, type)).length;
   }
@@ -140,8 +153,15 @@
 
   const tableColumn = ref([
     // { label: "鐢宠浜虹紪鍙�", prop: "applicantNo", width: 110 },
-    { label: "鐢宠浜哄悕绉�", prop: "applicantName", minWidth: 100 },
+    { label: "鍙戣捣浜�", prop: "applicantName", minWidth: 100 },
     { label: "妯℃澘绫诲瀷", prop: "businessName", minWidth: 120 },
+    {
+      label: "涓氬姟鍗曞彿",
+      prop: "businessNo",
+      minWidth: 170,
+      dataType: "slot",
+      slot: "bizNo",
+    },
     {
       label: "瀹℃壒绫诲瀷",
       prop: "approvalType",
@@ -154,7 +174,9 @@
       prop: "unread",
       width: 90,
       align: "center",
+      dataType: "tag",
       formatData: (v) => (v ? "鏄�" : "鍚�"),
+      formatType: (v) => (v ? "success" : "danger"),
     },
     {
       label: "瀹℃壒鐘舵��",
@@ -190,11 +212,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),
+        // },
       ],
     },
   ]);
@@ -308,7 +330,10 @@
     else if (row.businessType === 5) {
       const purchaseContractNumber = row?.purchaseContractNumber;
       if (purchaseContractNumber) {
-        const res = await getPurchaseByCode({ purchaseContractNumber });
+        const res = await getPurchaseByCode({
+          purchaseContractNumber,
+          approvalInstanceId: row?.id,
+        });
         detailData.value = res || {};
       }
     }
@@ -321,13 +346,29 @@
         detailData.value = res?.data || res || {};
       }
     }
-    
+
+    // 閿�鍞彴璐﹀鎵癸細鐢ㄥ鎵逛簨鐢卞瓧娈垫壙杞界殑"閿�鍞悎鍚屽彿"鍘绘煡鍙拌处鍒楄〃
+    else if (row.businessType === 19) {
+      detailData.value = await fetchSalesLedgerByContractNo(row?.salesContractNo);
+    }
+
     // 鍏朵粬瀹℃壒绫诲瀷
     else {
       detailData.value = {};
     }
-    
+
     detailDialog.visible = true;
+  }
+
+  async function fetchSalesLedgerByContractNo(salesContractNo) {
+    if (!salesContractNo) return {};
+    // /sales/ledger/listPage 鐩存帴杩斿洖 IPage锛堥《灞� records锛夛紝娌℃湁 code/msg 澶栧眰
+    const res = await ledgerListPage({
+      salesContractNo,
+      pageNum: 1,
+      pageSize: 1,
+    });
+    return res?.records?.[0] || {};
   }
 
   async function openApprove(row) {
@@ -353,7 +394,10 @@
     else if (row.businessType === 5) {
       const purchaseContractNumber = row?.purchaseContractNumber;
       if (purchaseContractNumber) {
-        const res = await getPurchaseByCode({ purchaseContractNumber });
+        const res = await getPurchaseByCode({
+          purchaseContractNumber,
+          approvalInstanceId: row?.id,
+        });
         detailData.value = res || {};
       }
     }
@@ -365,6 +409,11 @@
         const res = await getDeliveryDetailByShippingNo({ shippingNo });
         detailData.value = res?.data || res || {};
       }
+    }
+
+    // 閿�鍞彴璐﹀鎵癸細鐢ㄥ鎵逛簨鐢卞瓧娈垫壙杞界殑"閿�鍞悎鍚屽彿"鍘绘煡鍙拌处鍒楄〃
+    else if (row.businessType === 19) {
+      detailData.value = await fetchSalesLedgerByContractNo(row?.salesContractNo);
     }
 
     // 鍏朵粬瀹℃壒绫诲瀷
@@ -678,6 +727,7 @@
     selectedBusinessType,
     selectedBusinessTypeLabel,
     businessTypeLabel,
+    businessNoOf,
     countTemplatesByBusinessType,
     submitTemplatesLoading,
     handleQuery,
@@ -697,4 +747,4 @@
     openApprove,
     fetchApprovalList,
   };
-}
\ No newline at end of file
+}

--
Gitblit v1.9.3