From 4e591bd0b0042c4bc28f7a999ceea064f8ed5d43 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 02 六月 2026 17:28:06 +0800
Subject: [PATCH] 富边商务电子 1.发货审批点击详情的时候产品列表没有展示问题

---
 src/views/procurementManagement/procurementInvoiceLedger/index.vue |   78 +++++++++++++++++++++++---------------
 1 files changed, 47 insertions(+), 31 deletions(-)

diff --git a/src/views/procurementManagement/procurementInvoiceLedger/index.vue b/src/views/procurementManagement/procurementInvoiceLedger/index.vue
index b90ef0d..9d450e0 100644
--- a/src/views/procurementManagement/procurementInvoiceLedger/index.vue
+++ b/src/views/procurementManagement/procurementInvoiceLedger/index.vue
@@ -1,7 +1,7 @@
 <template>
   <div class="app-container">
     <el-form :model="filters" :inline="true">
-      <el-form-item label="閲囪喘鍚堝悓鍙�">
+      <el-form-item label="閲囪喘鍗曞彿">
         <el-input
           v-model="filters.purchaseContractNumber"
           style="width: 240px"
@@ -62,16 +62,16 @@
           <el-button
             type="primary"
             link
-            @click="downLoadFile(row)"
+            @click="openEdit(row)"
           >
-            闄勪欢
+            缂栬緫
           </el-button>
           <el-button
             type="primary"
             link
-            @click="openEdit(row)"
+            @click="downLoadFile(row)"
           >
-            缂栬緫
+            闄勪欢
           </el-button>
           <el-button
             type="primary"
@@ -83,8 +83,8 @@
         </template>
       </PIMTable>
     </div>
-    <FileListDialog 
-      ref="fileListRef" 
+    <FileListDialog
+      ref="fileListRef"
       v-model="fileListDialogVisible"
       title="闄勪欢鍒楄〃"
       :showUploadButton="true"
@@ -140,18 +140,18 @@
 } = usePaginationApi(
   productRecordPage,
   {
-    purchaseContractNumber: undefined, // 閲囪喘鍚堝悓鍙�
+    purchaseContractNumber: undefined, // 閲囪喘鍗曞彿
     supplierName: undefined, // 渚涘簲鍟�
     createdAt: [], // 鏉ョエ鏃ユ湡
   },
   [
     {
-      label: "閲囪喘鍚堝悓鍙�",
+      label: "閲囪喘鍗曞彿",
       prop: "purchaseContractNumber",
       width: 150,
     },
     {
-      label: "閿�鍞悎鍚屽彿",
+      label: "閿�鍞崟鍙�",
       prop: "salesContractNo",
       width: 150,
     },
@@ -164,6 +164,11 @@
       label: "渚涘簲鍟嗗悕绉�",
       prop: "supplierName",
       width: 240,
+    },
+    {
+      label: "浜у搧澶х被",
+      prop: "productCategory",
+      width: 150,
     },
     {
       label: "瑙勬牸鍨嬪彿",
@@ -232,21 +237,32 @@
   }
 );
 
-// 涓昏〃鍚堣鏂规硶
 const summarizeMainTable = (param) => {
-  return proxy.summarizeTable(
+  const sums = proxy.summarizeTable(
     param,
-    [
-      "taxInclusiveTotalPrice",
-      "ticketsAmount",
-      "unTicketsPrice",
-      "invoiceAmount",
-    ],
+    ["ticketsAmount", "unTicketsPrice", "invoiceAmount"],
     {
-      ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
-      futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+      ticketsNum: { noDecimal: true },
+      futureTickets: { noDecimal: true },
     }
   );
+
+  const keySet = new Set();
+  let taxInclusiveSum = 0;
+  (param.data || []).forEach((row) => {
+    const key = `${row.purchaseContractNumber ?? ""}\n${row.salesContractNo ?? ""}\n${row.productCategory ?? ""}\n${row.specificationModel ?? ""}`;
+    if (keySet.has(key)) return;
+    keySet.add(key);
+    const val = Number(row.taxInclusiveTotalPrice);
+    if (!isNaN(val)) taxInclusiveSum += val;
+  });
+  const taxInclusiveIndex = (param.columns || []).findIndex(
+    (c) => c.property === "taxInclusiveTotalPrice"
+  );
+  if (taxInclusiveIndex !== -1) {
+    sums[taxInclusiveIndex] = taxInclusiveSum.toFixed(2);
+  }
+  return sums;
 };
 
 const handleSelectionChange = (val) => {
@@ -287,7 +303,7 @@
     proxy.$modal.msgWarning("缂哄皯鐧昏ID锛屾棤娉曚繚瀛橀檮浠�");
     return;
   }
-  
+
   return new Promise((resolve) => {
     // 鍒涘缓涓�涓殣钘忕殑鏂囦欢杈撳叆鍏冪礌
     const input = document.createElement('input');
@@ -299,14 +315,14 @@
         resolve(null);
         return;
       }
-      
+
       try {
         // 浣跨敤 FormData 涓婁紶鏂囦欢
         const formData = new FormData();
         formData.append('file', file);
         formData.append('type', '4'); // type 鍙傛暟锛岀敤鎴锋湭鎸囧畾鍏蜂綋鍊硷紝鍏堜紶绌哄瓧绗︿覆
         formData.append('id', currentRowId.value); // 褰撳墠琛岀殑 id
-        
+
         const uploadRes = await request({
           url: '/file/uploadByCommon',
           method: 'post',
@@ -316,10 +332,10 @@
             Authorization: `Bearer ${getToken()}`
           }
         });
-        
+
         if (uploadRes.code === 200) {
           proxy.$modal.msgSuccess("闄勪欢涓婁紶鎴愬姛");
-          
+
           // 鍒锋柊鍒楄〃鑾峰彇鏈�鏂版暟鎹�
           await new Promise((resolveRefresh) => {
             // 璋冪敤 API 鑾峰彇鏈�鏂板垪琛ㄦ暟鎹�
@@ -332,7 +348,7 @@
                 // 鏇存柊鏁版嵁鍒楄〃
                 dataList.value = data.records;
                 pagination.total = data.total;
-                
+
                 // 浠庡閮ㄦ暟鎹幏鍙� commonFiles
                 const currentRow = dataList.value.find(row => row.id === currentRowId.value);
                 if (currentRow && fileListRef.value) {
@@ -347,7 +363,7 @@
               resolveRefresh();
             });
           });
-          
+
           resolve({
             name: uploadRes.data?.originalName || file.name,
             url: uploadRes.data?.tempPath || uploadRes.data?.url,
@@ -365,7 +381,7 @@
         document.body.removeChild(input);
       }
     };
-    
+
     document.body.appendChild(input);
     input.click();
   });
@@ -376,7 +392,7 @@
   try {
     await delCommonFile([file.id]);
     proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-    
+
     // 鍒锋柊鍒楄〃鑾峰彇鏈�鏂版暟鎹�
     await new Promise((resolveRefresh) => {
       // 璋冪敤 API 鑾峰彇鏈�鏂板垪琛ㄦ暟鎹�
@@ -389,7 +405,7 @@
           // 鏇存柊鏁版嵁鍒楄〃
           dataList.value = data.records;
           pagination.total = data.total;
-          
+
           // 浠庡閮ㄦ暟鎹幏鍙� commonFiles
           const currentRow = dataList.value.find(row => row.id === currentRowId.value);
           if (currentRow && fileListRef.value) {
@@ -404,7 +420,7 @@
         resolveRefresh();
       });
     });
-    
+
     return true;
   } catch (error) {
     proxy.$modal.msgError("鍒犻櫎澶辫触");

--
Gitblit v1.9.3