From 183d13a62353fc7594417068f5d2709c09cdb523 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 09 六月 2025 14:05:46 +0800
Subject: [PATCH] 回款登记加上子表格

---
 src/views/salesManagement/receiptPayment/index.vue |   50 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 49 insertions(+), 1 deletions(-)

diff --git a/src/views/salesManagement/receiptPayment/index.vue b/src/views/salesManagement/receiptPayment/index.vue
index 74f5147..c86117e 100644
--- a/src/views/salesManagement/receiptPayment/index.vue
+++ b/src/views/salesManagement/receiptPayment/index.vue
@@ -23,8 +23,31 @@
                 :row-key="row => row.id"
                 show-summary
                 :summary-method="summarizeMainTable"
+                :expand-row-keys="expandedRowKeys"
+                @expand-change="expandChange"
                 height="calc(100vh - 18.5em)">
         <el-table-column align="center" type="selection" width="55" />
+        <el-table-column type="expand">
+          <template #default="props">
+            <el-table :data="props.row.children" border
+                      show-summary
+                      :summary-method="summarizeChildrenTable">
+              <el-table-column align="center" label="搴忓彿" type="index" width="60" />
+              <el-table-column label="浜у搧澶х被" prop="productCategory" />
+              <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" />
+              <el-table-column label="鍗曚綅" prop="unit" width="70"/>
+              <el-table-column label="鏁伴噺" prop="quantity" width="70"/>
+              <el-table-column label="绋庣巼" prop="taxRate" width="70" />
+              <el-table-column label="鍚◣鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" />
+              <el-table-column label="鍚◣鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" />
+              <el-table-column label="涓嶅惈绋庢�讳环(鍏�)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" />
+              <el-table-column label="寮�绁ㄦ暟" prop="invoiceNum" />
+              <el-table-column label="寮�绁ㄩ噾棰�(鍏�)" prop="invoiceAmount" :formatter="formattedNumber" />
+              <el-table-column label="鏈紑绁ㄦ暟" prop="noInvoiceNum" />
+              <el-table-column label="鏈紑绁ㄩ噾棰�(鍏�)" prop="noInvoiceAmount" :formatter="formattedNumber"/>
+            </el-table>
+          </template>
+        </el-table-column>
         <el-table-column align="center" label="搴忓彿" type="index" width="60" />
         <el-table-column label="閿�鍞悎鍚屽彿" prop="salesContractNo" show-overflow-tooltip/>
         <el-table-column label="瀹㈡埛鍚堝悓鍙�" prop="customerContractNo" show-overflow-tooltip/>
@@ -123,7 +146,7 @@
 import {
   receiptPaymentSaveOrUpdate,
   bindInvoiceNoRegPage,
-  invoiceInfo
+  invoiceInfo, receiptPaymentHistoryListNoPage
 } from "../../../api/salesManagement/receiptPayment.js";
 import useUserStore from '@/store/modules/user'
 const userStore = useUserStore()
@@ -136,6 +159,7 @@
   size: 100,
 })
 const total = ref(0)
+const expandedRowKeys = ref([])
 
 // 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
 const dialogFormVisible = ref(false)
@@ -193,6 +217,26 @@
     tableLoading.value = false
   })
 }
+// 灞曞紑琛�
+const expandChange = (row, expandedRows) => {
+  if (expandedRows.length > 0) {
+    expandedRowKeys.value = []
+    try {
+      receiptPaymentHistoryListNoPage({invoiceLedgerId: row.id,
+        type: 1 }).then(res => {
+        const index = tableData.value.findIndex(item => item.id === row.id);
+        if (index > -1) {
+          tableData.value[index].children = res;
+        }
+        expandedRowKeys.value.push(row.id)
+      })
+    } catch (error) {
+      console.log(error)
+    }
+  } else {
+    expandedRowKeys.value = []
+  }
+}
 // 琛ㄦ牸閫夋嫨鏁版嵁
 const handleSelectionChange = (selection) => {
   selectedRows.value = selection
@@ -204,6 +248,10 @@
     futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
   });
 };
+// 瀛愯〃鍚堣鏂规硶
+const summarizeChildrenTable = (param) => {
+  return proxy.summarizeTable(param, ['taxInclusiveUnitPrice', 'taxInclusiveTotalPrice', 'taxExclusiveTotalPrice','invoiceNum','invoiceAmount','noInvoiceNum','noInvoiceAmount']);
+}
 // 鎵撳紑寮规
 const openForm = () => {
   form.value = {}

--
Gitblit v1.9.3