From c391bf92060a370c1f22e5e3b7d17c2ebfd048c7 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期三, 08 四月 2026 14:25:36 +0800
Subject: [PATCH] fix: 销售台账新增修改
---
src/views/salesManagement/receiptPaymentLedger/index.vue | 79 +++++++++++++++++++++++++++++++++------
1 files changed, 67 insertions(+), 12 deletions(-)
diff --git a/src/views/salesManagement/receiptPaymentLedger/index.vue b/src/views/salesManagement/receiptPaymentLedger/index.vue
index 31bee75..158b715 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,27 +137,35 @@
</template>
</el-table-column>
</el-table>
- <pagination
- v-show="recordTotal > 0"
- :total="recordTotal"
- layout="total, sizes, prev, pager, next, jumper"
- :page="recordPage.current"
- :limit="recordPage.size"
- @pagination="recordPaginationChange"
- />
+ <el-table
+ v-else
+ :data="salesRecord"
+ border
+ :row-key="(row) => row.id"
+ show-summary
+ :summary-method="summarizeSalesTable"
+ 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,
@@ -162,6 +177,7 @@
});
const total = ref(0);
const recordTotal = ref(0);
+const recordMode = ref("money");
const data = reactive({
searchForm: {
searchText: "",
@@ -171,6 +187,7 @@
const customerId = ref("");
const { searchForm } = toRefs(data);
const originReceiptRecord = ref([]);
+const originSalesRecord = ref([]);
// 鏌ヨ鍒楄〃
/** 鎼滅储鎸夐挳鎿嶄綔 */
const handleQuery = () => {
@@ -178,7 +195,6 @@
getList();
};
const paginationChange = (obj) => {
- console.log("paginationChange", current, limit);
page.current = obj.page;
page.size = obj.limit;
getList();
@@ -233,6 +249,18 @@
return summarizeTable;
};
+// 閿�鍞線鏉ヨ〃鍚堣锛堝凡鍙戣揣/鏈彂璐э級
+const summarizeSalesTable = (param) => {
+ return proxy.summarizeTable(
+ param,
+ ["shippedQuantity", "unshippedQuantity"],
+ {
+ shippedQuantity: { noDecimal: false },
+ unshippedQuantity: { noDecimal: false },
+ }
+ );
+};
+
const receiptPaymentList = (id) => {
const param = {
customerId: id,
@@ -245,6 +273,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);
@@ -252,7 +303,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