From b66bd3213636032189026d14bdc9f264a3a57742 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期一, 29 六月 2026 16:27:12 +0800
Subject: [PATCH] 供应商往来页面更换接口
---
src/pages/procurementManagement/paymentLedger/detail.vue | 67 +++++++++++++++++++++------------
1 files changed, 42 insertions(+), 25 deletions(-)
diff --git a/src/pages/procurementManagement/paymentLedger/detail.vue b/src/pages/procurementManagement/paymentLedger/detail.vue
index 26f5cf5..efbd13c 100644
--- a/src/pages/procurementManagement/paymentLedger/detail.vue
+++ b/src/pages/procurementManagement/paymentLedger/detail.vue
@@ -1,7 +1,7 @@
<template>
<view class="receipt-payment-detail">
<!-- 浣跨敤閫氱敤椤甸潰澶撮儴缁勪欢 -->
- <PageHeader title="渚涘簲鍟嗗線鏉ヨ鎯�"
+ <PageHeader :title="pageTitle"
@back="goBack" />
<!-- 缁熻淇℃伅 -->
<view class="summary-info"
@@ -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>
<!-- 鍥炴璁板綍鏄庣粏鍒楄〃 -->
@@ -38,25 +38,25 @@
</view>
<text class="item-index">{{ 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.invoiceAmount) }}</text>
+ <text class="detail-label">閲囪喘鍚堝悓鍙�</text>
+ <text class="detail-value">{{ item.purchaseContractNumber || '--' }}</text>
</view>
<view class="detail-row">
- <text class="detail-label">浠樻閲戦(鍏�)</text>
- <text class="detail-value highlight">{{ formatAmount(item.currentPaymentAmount) }}</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 danger">{{ formatAmount(item.payableAmount) }}</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">{{ item.paymentDate }}</text>
+ <text class="detail-label">鏈叆搴撻噾棰�(鍏�)</text>
+ <text class="detail-value danger">{{ formatAmount(item.unshippedAmount) }}</text>
</view>
</view>
</view>
@@ -72,37 +72,41 @@
import { ref, computed, onMounted } from "vue";
import { onShow } from "@dcloudio/uni-app";
import {
- paymentLedgerList,
paymentRecordList,
} from "@/api/procurementManagement/paymentLedger";
// 瀹㈡埛淇℃伅
const supplierId = ref("");
+ const supplierName = ref("");
+ const pageTitle = computed(() => {
+ return supplierName.value ? `渚涘簲鍟嗗線鏉ヨ鎯咃紙${supplierName.value}锛塦 : "渚涘簲鍟嗗線鏉ヨ鎯�";
+ });
// 琛ㄦ牸鏁版嵁
const tableData = ref([]);
- const invoiceTotal = computed(() => {
+ const contractTotal = computed(() => {
return tableData.value.reduce((sum, item) => {
- return sum + (parseFloat(item.invoiceAmount) || 0);
+ return sum + (parseFloat(item.contractAmount) || 0);
}, 0);
});
- const receiptTotal = computed(() => {
+ const shippedTotal = computed(() => {
return tableData.value.reduce((sum, item) => {
- return sum + (parseFloat(item.receiptAmount) || 0);
+ return sum + (parseFloat(item.shippedAmount) || 0);
}, 0);
});
- const unReceiptTotal = computed(() => {
+ const unshippedTotal = computed(() => {
return tableData.value.reduce((sum, item) => {
- return sum + (parseFloat(item.unReceiptAmount) || 0);
+ return sum + (parseFloat(item.unshippedAmount) || 0);
}, 0);
});
// 杩斿洖涓婁竴椤�
const goBack = () => {
uni.removeStorageSync("supplierId");
+ uni.removeStorageSync("supplierName");
uni.navigateBack();
};
@@ -112,6 +116,10 @@
const storedSupplierId = uni.getStorageSync("supplierId");
if (storedSupplierId) {
supplierId.value = storedSupplierId;
+ }
+ const storedSupplierName = uni.getStorageSync("supplierName");
+ if (storedSupplierName) {
+ supplierName.value = storedSupplierName;
}
};
@@ -125,9 +133,18 @@
return;
}
showLoadingToast("鍔犺浇涓�...");
- paymentRecordList({ supplierId: supplierId.value })
+ paymentRecordList({
+ supplierId: supplierId.value,
+ current: -1,
+ size: -1,
+ })
.then(res => {
- tableData.value = res.data;
+ const result = res?.data;
+ if (Array.isArray(result)) {
+ tableData.value = result;
+ } else {
+ tableData.value = result?.records || [];
+ }
closeToast();
})
.catch(() => {
--
Gitblit v1.9.3