From be1fce1afe340a72bd1e6856cbef01bf3c602bf0 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 07 四月 2026 16:00:33 +0800
Subject: [PATCH] fix: 不在销售台账处出库。在发货台账处导入excel,匹配客户进行出库。销售台账处的产品列表需要展示已发货/未发货数量。

---
 src/views/salesManagement/receiptPaymentLedger/index.vue |   56 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/src/views/salesManagement/receiptPaymentLedger/index.vue b/src/views/salesManagement/receiptPaymentLedger/index.vue
index 7029cfc..793e616 100644
--- a/src/views/salesManagement/receiptPaymentLedger/index.vue
+++ b/src/views/salesManagement/receiptPaymentLedger/index.vue
@@ -66,6 +66,12 @@
               </el-text>
             </template>
           </el-table-column>
+          <el-table-column label="鎿嶄綔" fixed="right" width="180" align="center">
+            <template #default="{ row }">
+              <el-button link type="primary" @click.stop="showMoneyInteractions(row)">閲戦挶寰�鏉�</el-button>
+              <el-button link type="success" @click.stop="showSalesInteractions(row)">閿�鍞線鏉�</el-button>
+            </template>
+          </el-table-column>
         </el-table>
         <pagination
           v-show="total > 0"
@@ -78,6 +84,7 @@
       </div>
       <div class="table_list">
         <el-table
+          v-if="recordMode === 'money'"
           :data="receiptRecord"
           border
           :row-key="(row) => row.id"
@@ -130,19 +137,33 @@
             </template>
           </el-table-column>
         </el-table>
+        <el-table
+          v-else
+          :data="salesRecord"
+          border
+          :row-key="(row) => row.id"
+          height="calc(100vh - 18.5em)"
+        >
+          <el-table-column align="center" label="搴忓彿" type="index" width="60" />
+          <el-table-column label="璐у悕" prop="goodsName" show-overflow-tooltip width="220" />
+          <el-table-column label="瑙勬牸" prop="specificationModel" show-overflow-tooltip width="220" />
+          <el-table-column label="宸插彂璐�" prop="shippedQuantity" show-overflow-tooltip width="140" />
+          <el-table-column label="鏈彂璐�" prop="unshippedQuantity" show-overflow-tooltip width="140" />
+        </el-table>
       </div>
     </div>
   </div>
 </template>
 
 <script setup>
-import {onMounted, ref} from "vue";
+import { onMounted, ref, reactive, toRefs, getCurrentInstance } from "vue";
 import { invoiceLedgerSalesAccount } from "../../../api/salesManagement/invoiceLedger.js";
-import { customerInteractions } from "../../../api/salesManagement/receiptPayment.js";
+import { customerInteractions, customerSalesInteractions } from "../../../api/salesManagement/receiptPayment.js";
 import Pagination from "../../../components/PIMTable/Pagination.vue";
 const { proxy } = getCurrentInstance();
 const tableData = ref([]);
 const receiptRecord = ref([]);
+const salesRecord = ref([]);
 const tableLoading = ref(false);
 const page = reactive({
   current: 1,
@@ -154,6 +175,7 @@
 });
 const total = ref(0);
 const recordTotal = ref(0);
+const recordMode = ref("money");
 const data = reactive({
   searchForm: {
     searchText: "",
@@ -163,6 +185,7 @@
 const customerId = ref("");
 const { searchForm } = toRefs(data);
 const originReceiptRecord = ref([]);
+const originSalesRecord = ref([]);
 // 鏌ヨ鍒楄〃
 /** 鎼滅储鎸夐挳鎿嶄綔 */
 const handleQuery = () => {
@@ -236,6 +259,29 @@
   });
 };
 
+const salesInteractionList = (id) => {
+  const param = {
+    customerId: id,
+  };
+  customerSalesInteractions(param).then((res) => {
+    // 鏀寔鍚庣鐩存帴杩斿洖鏁扮粍锛屾垨 data.records 褰㈠紡
+    originSalesRecord.value = res?.data?.records || res?.data || [];
+    salesRecord.value = originSalesRecord.value;
+  });
+};
+
+const showMoneyInteractions = (row) => {
+  customerId.value = row.id;
+  recordMode.value = "money";
+  receiptPaymentList(customerId.value);
+};
+
+const showSalesInteractions = (row) => {
+  customerId.value = row.id;
+  recordMode.value = "sales";
+  salesInteractionList(customerId.value);
+};
+
 // 姹囨璁板綍鍒楄〃鍒嗛〉
 const recordPaginationChange = (pagination) => {
   handlePagination(pagination);
@@ -243,7 +289,11 @@
 
 const rowClickMethod = (row) => {
   customerId.value = row.id;
-  receiptPaymentList(customerId.value);
+  if (recordMode.value === "money") {
+    receiptPaymentList(customerId.value);
+  } else {
+    salesInteractionList(customerId.value);
+  }
 };
 
 const handlePagination = ({ page, limit }) => {

--
Gitblit v1.9.3