From b5be6d85c9927a378abca172ea6bef2933657f8e Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期一, 29 六月 2026 14:35:08 +0800
Subject: [PATCH] 客户往来数据源修改
---
src/pages/sales/receiptPaymentLedger/detail.vue | 59 ++++++++++++++++-------------
src/pages/sales/receiptPaymentLedger/index.vue | 33 ++++++++--------
src/api/salesManagement/receiptPayment.js | 18 +++++++++
3 files changed, 66 insertions(+), 44 deletions(-)
diff --git a/src/api/salesManagement/receiptPayment.js b/src/api/salesManagement/receiptPayment.js
index 0f0529d..db4989c 100644
--- a/src/api/salesManagement/receiptPayment.js
+++ b/src/api/salesManagement/receiptPayment.js
@@ -82,3 +82,21 @@
params: query
})
}
+
+// 瀹㈡埛寰�鏉ュ垪琛紙鎸囨爣缁熻鍙e緞锛�
+export function customewTransactions(query) {
+ return request({
+ url: '/metricStatistics/customewTransactions',
+ method: 'get',
+ params: query
+ })
+}
+
+// 瀹㈡埛寰�鏉ユ槑缁嗭紙鎸囨爣缁熻鍙e緞锛�
+export function customewTransactionsDetails(query) {
+ return request({
+ url: '/metricStatistics/customewTransactionsDetails',
+ method: 'get',
+ params: query
+ })
+}
diff --git a/src/pages/sales/receiptPaymentLedger/detail.vue b/src/pages/sales/receiptPaymentLedger/detail.vue
index b494332..10aa9aa 100644
--- a/src/pages/sales/receiptPaymentLedger/detail.vue
+++ b/src/pages/sales/receiptPaymentLedger/detail.vue
@@ -11,16 +11,16 @@
<text class="summary-value">{{ tableData.length }}</text>
</view>
<view class="summary-item">
- <text class="summary-label">寮�绁ㄦ�婚噾棰�</text>
- <text class="summary-value">{{ formatAmount(invoiceTotal) }}</text>
+ <text class="summary-label">鍚堝悓鎬婚噾棰�</text>
+ <text class="summary-value">{{ formatAmount(contractTotal) }}</text>
</view>
<view class="summary-item">
- <text class="summary-label">鍥炴鎬婚噾棰�</text>
- <text class="summary-value highlight">{{ formatAmount(receiptTotal) }}</text>
+ <text class="summary-label">宸插嚭搴撴�婚噾棰�</text>
+ <text class="summary-value highlight">{{ formatAmount(shippedTotal) }}</text>
</view>
<view class="summary-item">
- <text class="summary-label">搴旀敹鎬婚噾棰�</text>
- <text class="summary-value danger">{{ formatAmount(unReceiptTotal) }}</text>
+ <text class="summary-label">鏈嚭搴撴�婚噾棰�</text>
+ <text class="summary-value danger">{{ formatAmount(unshippedTotal) }}</text>
</view>
</view>
<!-- 鍥炴璁板綍鏄庣粏鍒楄〃 -->
@@ -36,27 +36,27 @@
size="16"
color="#ffffff"></up-icon>
</view>
- <text class="item-index">{{ index + 1 }}</text>
+ <text class="item-index">{{ item.salesContractNo || index + 1 }}</text>
</view>
- <view class="item-date">{{ item.happenTime }}</view>
+ <view class="item-date">{{ item.executionDate || '-' }}</view>
</view>
<up-divider></up-divider>
<view class="item-details">
<view class="detail-row">
- <text class="detail-label">寮�绁ㄩ噾棰�(鍏�)</text>
- <text class="detail-value">{{ formatAmount(item.invoiceTotal) }}</text>
+ <text class="detail-label">鍚堝悓閲戦(鍏�)</text>
+ <text class="detail-value">{{ formatAmount(item.contractAmount) }}</text>
</view>
<view class="detail-row">
- <text class="detail-label">鍥炴閲戦(鍏�)</text>
- <text class="detail-value highlight">{{ formatAmount(item.receiptPaymentAmount) }}</text>
+ <text class="detail-label">宸插嚭搴撻噾棰�(鍏�)</text>
+ <text class="detail-value highlight">{{ formatAmount(item.shippedAmount) }}</text>
</view>
<view class="detail-row">
- <text class="detail-label">搴旀敹閲戦(鍏�)</text>
- <text class="detail-value danger">{{ formatAmount(item.unReceiptPaymentAmount) }}</text>
+ <text class="detail-label">鏈嚭搴撻噾棰�(鍏�)</text>
+ <text class="detail-value danger">{{ formatAmount(item.unshippedAmount) }}</text>
</view>
<view class="detail-row">
- <text class="detail-label">鍙戠敓鏃ユ湡</text>
- <text class="detail-value">{{ item.receiptPaymentDate }}</text>
+ <text class="detail-label">閿�鍞悎鍚屽彿</text>
+ <text class="detail-value">{{ item.salesContractNo || '-' }}</text>
</view>
</view>
</view>
@@ -71,7 +71,7 @@
<script setup>
import { ref, computed, onMounted } from "vue";
import { onShow } from "@dcloudio/uni-app";
- import { customerInteractions } from "@/api/salesManagement/receiptPayment.js";
+ import { customewTransactionsDetails } from "@/api/salesManagement/receiptPayment.js";
// 瀹㈡埛淇℃伅
const customerId = ref("");
@@ -79,21 +79,21 @@
// 琛ㄦ牸鏁版嵁
const tableData = ref([]);
- const invoiceTotal = computed(() => {
+ const contractTotal = computed(() => {
return tableData.value.reduce((sum, item) => {
- return sum + (parseFloat(item.invoiceTotal) || 0);
+ return sum + (parseFloat(item.contractAmount) || 0);
}, 0);
});
- const receiptTotal = computed(() => {
+ const shippedTotal = computed(() => {
return tableData.value.reduce((sum, item) => {
- return sum + (parseFloat(item.receiptPaymentAmount) || 0);
+ return sum + (parseFloat(item.shippedAmount) || 0);
}, 0);
});
- const unReceiptTotal = computed(() => {
+ const unshippedTotal = computed(() => {
return tableData.value.reduce((sum, item) => {
- return sum + (parseFloat(item.unReceiptPaymentAmount) || 0);
+ return sum + (parseFloat(item.unshippedAmount) || 0);
}, 0);
});
@@ -125,13 +125,18 @@
showLoadingToast("鍔犺浇涓�...");
const param = {
customerId: customerId.value,
- current: -1,
- size: -1,
+ current: 1,
+ size: 100,
};
- customerInteractions(param)
+ customewTransactionsDetails(param)
.then(res => {
- tableData.value = res.data;
+ const data = res?.data;
+ if (Array.isArray(data)) {
+ tableData.value = data;
+ } else {
+ tableData.value = data?.records || res?.records || [];
+ }
closeToast();
})
.catch(() => {
diff --git a/src/pages/sales/receiptPaymentLedger/index.vue b/src/pages/sales/receiptPaymentLedger/index.vue
index 7daa076..90a0c9c 100644
--- a/src/pages/sales/receiptPaymentLedger/index.vue
+++ b/src/pages/sales/receiptPaymentLedger/index.vue
@@ -9,7 +9,7 @@
<view class="search-input">
<up-input class="search-text"
placeholder="璇疯緭鍏ュ鎴峰悕绉�"
- v-model="searchForm.searchText"
+ v-model="searchForm.customerName"
@change="searchChange"
clearable />
</view>
@@ -47,16 +47,16 @@
<up-divider></up-divider>
<view class="item-details">
<view class="detail-row">
- <text class="detail-label">寮�绁ㄩ噾棰�(鍏�)</text>
- <text class="detail-value">{{ formattedNumber(item.invoiceTotal) }}</text>
+ <text class="detail-label">鍚堝悓閲戦(鍏�)</text>
+ <text class="detail-value">{{ formattedNumber(item.contractAmounts) }}</text>
</view>
<view class="detail-row">
- <text class="detail-label">鍥炴閲戦(鍏�)</text>
- <text class="detail-value">{{ formattedNumber(item.receiptPaymentAmount) }}</text>
+ <text class="detail-label">宸插嚭搴撻噾棰�(鍏�)</text>
+ <text class="detail-value">{{ formattedNumber(item.shippedAmount) }}</text>
</view>
<view class="detail-row">
- <text class="detail-label">搴旀敹閲戦(鍏�)</text>
- <text class="detail-value highlight danger">{{ formattedNumber(item.unReceiptPaymentAmount) }}</text>
+ <text class="detail-label">鏈嚭搴撻噾棰�(鍏�)</text>
+ <text class="detail-value highlight danger">{{ formattedNumber(item.unshippedAmount) }}</text>
</view>
</view>
</view>
@@ -72,19 +72,18 @@
<script setup>
import { onMounted, ref, reactive, toRefs } from "vue";
import { onShow } from "@dcloudio/uni-app";
- import { invoiceLedgerSalesAccount } from "@/api/salesManagement/invoiceLedger";
+ import { customewTransactions } from "@/api/salesManagement/receiptPayment.js";
const tableData = ref([]);
const page = reactive({
- current: -1,
- size: -1,
+ current: 1,
+ size: 100,
});
const data = reactive({
searchForm: {
- searchText: "",
- invoiceDate: "",
+ customerName: "",
},
});
@@ -96,7 +95,7 @@
};
// 鎼滅储妗嗗彉鍖栨椂瑙﹀彂
const searchChange = val => {
- searchForm.value.searchText = val;
+ searchForm.value.customerName = val;
getList();
};
// 鏌ヨ鍒楄〃
@@ -106,9 +105,9 @@
const getList = () => {
showLoadingToast("鍔犺浇涓�...");
- invoiceLedgerSalesAccount({ ...searchForm.value, ...page })
+ customewTransactions({ ...searchForm.value, ...page })
.then(res => {
- tableData.value = res.data.records;
+ tableData.value = res?.data?.records || res?.data || res?.records || [];
closeToast();
})
.catch(() => {
@@ -139,7 +138,7 @@
const rowClickMethod = row => {
// 浣跨敤 uni.setStorageSync 瀛樺偍瀹㈡埛淇℃伅
- uni.setStorageSync("customerId", row.id);
+ uni.setStorageSync("customerId", row.customerId);
// 璺宠浆鍒板洖娆捐褰曟槑缁嗛〉闈�
uni.navigateTo({
url: "/pages/sales/receiptPaymentLedger/detail",
@@ -164,4 +163,4 @@
color: #ff4757; // 涓庡叕鍏辨牱寮忎腑鐨� #ee0a24 涓嶅悓
font-weight: 500;
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.9.3