From 0e2d3f632e5286485321fc15a50b2531e53d6094 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 04 六月 2026 13:53:32 +0800
Subject: [PATCH] 马铃薯app 1.客户往来、供应商往来查询展示修改
---
src/pages/sales/receiptPaymentLedger/detail.vue | 192 +++++++++++++++++++----------------------------
1 files changed, 79 insertions(+), 113 deletions(-)
diff --git a/src/pages/sales/receiptPaymentLedger/detail.vue b/src/pages/sales/receiptPaymentLedger/detail.vue
index b494332..f435998 100644
--- a/src/pages/sales/receiptPaymentLedger/detail.vue
+++ b/src/pages/sales/receiptPaymentLedger/detail.vue
@@ -3,27 +3,7 @@
<!-- 浣跨敤閫氱敤椤甸潰澶撮儴缁勪欢 -->
<PageHeader title="瀹㈡埛寰�鏉ヨ鎯�"
@back="goBack" />
- <!-- 缁熻淇℃伅 -->
- <view class="summary-info"
- v-if="tableData.length > 0">
- <view class="summary-item">
- <text class="summary-label">鎬昏褰曟暟</text>
- <text class="summary-value">{{ tableData.length }}</text>
- </view>
- <view class="summary-item">
- <text class="summary-label">寮�绁ㄦ�婚噾棰�</text>
- <text class="summary-value">{{ formatAmount(invoiceTotal) }}</text>
- </view>
- <view class="summary-item">
- <text class="summary-label">鍥炴鎬婚噾棰�</text>
- <text class="summary-value highlight">{{ formatAmount(receiptTotal) }}</text>
- </view>
- <view class="summary-item">
- <text class="summary-label">搴旀敹鎬婚噾棰�</text>
- <text class="summary-value danger">{{ formatAmount(unReceiptTotal) }}</text>
- </view>
- </view>
- <!-- 鍥炴璁板綍鏄庣粏鍒楄〃 -->
+ <!-- 鍙戣揣鍙拌处鏄庣粏 -->
<view class="detail-list"
v-if="tableData.length > 0">
<view v-for="(item, index) in tableData"
@@ -36,66 +16,59 @@
size="16"
color="#ffffff"></up-icon>
</view>
- <text class="item-index">{{ index + 1 }}</text>
+ <text class="item-index">{{ item.salesContractNo }}</text>
</view>
- <view class="item-date">{{ item.happenTime }}</view>
+ <view class="item-status">
+ <text class="status-tag"
+ :class="getStatusClass(item.status)">{{ item.status || '--' }}</text>
+ </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">{{ item.customerName }}</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">{{ item.productName }}</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">{{ item.specificationModel }}</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.shippingDate }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">鍙戣揣鏁伴噺</text>
+ <text class="detail-value">{{ item.totalQuantity }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">鍑哄簱鍗曞彿</text>
+ <text class="detail-value">{{ item.outboundBatches }}</text>
</view>
</view>
</view>
</view>
<view v-else
class="no-data">
- <text>鏆傛棤鍥炴璁板綍</text>
+ <text>鏆傛棤鍙戣揣璁板綍</text>
</view>
</view>
</template>
<script setup>
- import { ref, computed, onMounted } from "vue";
+ import { ref, onMounted } from "vue";
import { onShow } from "@dcloudio/uni-app";
- import { customerInteractions } from "@/api/salesManagement/receiptPayment.js";
+ import { deliveryLedgerListPage } from "@/api/salesManagement/deliveryLedger.js";
// 瀹㈡埛淇℃伅
const customerId = ref("");
// 琛ㄦ牸鏁版嵁
const tableData = ref([]);
-
- const invoiceTotal = computed(() => {
- return tableData.value.reduce((sum, item) => {
- return sum + (parseFloat(item.invoiceTotal) || 0);
- }, 0);
- });
-
- const receiptTotal = computed(() => {
- return tableData.value.reduce((sum, item) => {
- return sum + (parseFloat(item.receiptPaymentAmount) || 0);
- }, 0);
- });
-
- const unReceiptTotal = computed(() => {
- return tableData.value.reduce((sum, item) => {
- return sum + (parseFloat(item.unReceiptPaymentAmount) || 0);
- }, 0);
- });
// 杩斿洖涓婁竴椤�
const goBack = () => {
@@ -105,7 +78,6 @@
// 鑾峰彇椤甸潰鍙傛暟
const getPageParams = () => {
- // 浠庢湰鍦板瓨鍌ㄨ幏鍙栧鎴稩D
const storedCustomerId = uni.getStorageSync("customerId");
if (storedCustomerId) {
customerId.value = storedCustomerId;
@@ -123,15 +95,21 @@
}
showLoadingToast("鍔犺浇涓�...");
- const param = {
+ deliveryLedgerListPage({
customerId: customerId.value,
- current: -1,
- size: -1,
- };
-
- customerInteractions(param)
+ current: 1,
+ size: 1000,
+ })
.then(res => {
- tableData.value = res.data;
+ let orders = [];
+ if (res.data) {
+ if (Array.isArray(res.data)) {
+ orders = res.data;
+ } else if (res.data.records && Array.isArray(res.data.records)) {
+ orders = res.data.records;
+ }
+ }
+ tableData.value = orders;
closeToast();
})
.catch(() => {
@@ -143,9 +121,15 @@
});
};
- // 鏍煎紡鍖栭噾棰�
- const formatAmount = amount => {
- return amount ? parseFloat(amount).toFixed(2) : "0.00";
+ // 鍙戣揣鐘舵�佹牱寮�
+ const getStatusClass = (status) => {
+ const statusMap = {
+ '宸插彂璐�': 'status-success',
+ '瀹℃牳閫氳繃': 'status-success',
+ '瀹℃牳涓�': 'status-warning',
+ '瀹℃牳涓嶉�氳繃': 'status-danger',
+ };
+ return statusMap[status] || 'status-info';
};
// 鏄剧ず鍔犺浇鎻愮ず
@@ -183,46 +167,6 @@
.u-divider {
margin: 0 !important;
- }
-
- .summary-info {
- background: #ffffff;
- margin: 20px 20px 0 20px;
- border-radius: 12px;
- padding: 16px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
- }
-
- .summary-item {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 8px;
-
- &:last-child {
- margin-bottom: 0;
- }
- }
-
- .summary-label {
- font-size: 14px;
- color: #666;
- }
-
- .summary-value {
- font-size: 14px;
- color: #333;
- font-weight: 500;
- }
-
- .summary-value.highlight {
- color: #2979ff;
- font-weight: 600;
- }
-
- .summary-value.danger {
- color: #ff4757;
- font-weight: 600;
}
.detail-list {
@@ -272,6 +216,37 @@
color: #666;
}
+ .item-status {
+ display: flex;
+ align-items: center;
+ }
+
+ .status-tag {
+ font-size: 12px;
+ padding: 2px 8px;
+ border-radius: 4px;
+ }
+
+ .status-success {
+ color: #67c23a;
+ background: rgba(103, 194, 58, 0.1);
+ }
+
+ .status-warning {
+ color: #e6a23c;
+ background: rgba(230, 162, 60, 0.1);
+ }
+
+ .status-danger {
+ color: #f56c6c;
+ background: rgba(245, 108, 108, 0.1);
+ }
+
+ .status-info {
+ color: #909399;
+ background: rgba(144, 147, 153, 0.1);
+ }
+
.item-details {
padding: 16px 0;
}
@@ -301,19 +276,10 @@
margin-left: 16px;
}
- .detail-value.highlight {
- color: #2979ff;
- font-weight: 500;
- }
-
- .detail-value.danger {
- color: #ff4757;
- font-weight: 500;
- }
-
.no-data {
padding: 40px 0;
text-align: center;
color: #999;
}
+
</style>
--
Gitblit v1.9.3