From 7eebd7981c1f5d2c569556d1e87f7818cef18cce Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期四, 21 八月 2025 13:15:15 +0800 Subject: [PATCH] 1.样式修改 --- src/pages/sales/receiptPaymentLedger/detail.vue | 290 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 290 insertions(+), 0 deletions(-) diff --git a/src/pages/sales/receiptPaymentLedger/detail.vue b/src/pages/sales/receiptPaymentLedger/detail.vue new file mode 100644 index 0000000..ba9cd96 --- /dev/null +++ b/src/pages/sales/receiptPaymentLedger/detail.vue @@ -0,0 +1,290 @@ +<template> + <view class="receipt-payment-detail"> + <!-- 浣跨敤閫氱敤椤甸潰澶撮儴缁勪欢 --> + <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" :key="index" class="detail-item"> + <view class="item-header"> + <view class="item-left"> + <view class="record-icon"> + <up-icon name="file-text" size="16" color="#ffffff"></up-icon> + </view> + <text class="item-index">{{ index + 1 }}</text> + </view> + <view class="item-date">{{ item.happenTime }}</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> + </view> + <view class="detail-row"> + <text class="detail-label">鍥炴閲戦(鍏�)</text> + <text class="detail-value highlight">{{ formatAmount(item.receiptAmount) }}</text> + </view> + <view class="detail-row"> + <text class="detail-label">搴旀敹閲戦(鍏�)</text> + <text class="detail-value danger">{{ formatAmount(item.unReceiptAmount) }}</text> + </view> + </view> + </view> + </view> + <view v-else class="no-data"> + <text>鏆傛棤鍥炴璁板綍</text> + </view> + </view> +</template> + +<script setup> +import { ref, computed, onMounted } from 'vue'; +import { onShow } from '@dcloudio/uni-app'; +import { customerInteractions } from "@/api/salesManagement/receiptPayment.js"; + +// 瀹㈡埛淇℃伅 +const customerId = ref(''); + +// 琛ㄦ牸鏁版嵁 +const tableData = ref([]); + +const invoiceTotal = computed(() => { + return tableData.value.reduce((sum, item) => { + return sum + (parseFloat(item.invoiceAmount) || 0); + }, 0); +}); + +const receiptTotal = computed(() => { + return tableData.value.reduce((sum, item) => { + return sum + (parseFloat(item.receiptAmount) || 0); + }, 0); +}); + +const unReceiptTotal = computed(() => { + return tableData.value.reduce((sum, item) => { + return sum + (parseFloat(item.unReceiptAmount) || 0); + }, 0); +}); + +// 杩斿洖涓婁竴椤� +const goBack = () => { + uni.navigateBack(); +}; + +// 鑾峰彇椤甸潰鍙傛暟 +const getPageParams = () => { + const pages = getCurrentPages(); + const currentPage = pages[pages.length - 1]; + const options = currentPage.options; + + if (options.customerId) { + customerId.value = options.customerId; + } +}; + +// 鏌ヨ鍒楄〃 +const getList = () => { + if (!customerId.value) { + uni.showToast({ + title: '瀹㈡埛淇℃伅缂哄け', + icon: 'error' + }); + return; + } + + const param = { + customerId: customerId.value, + }; + + customerInteractions(param).then((res) => { + tableData.value = res.data; + }).catch(() => { + uni.showToast({ + title: '鏌ヨ澶辫触', + icon: 'error' + }); + }); +}; + +// 鏍煎紡鍖栭噾棰� +const formatAmount = (amount) => { + return amount ? parseFloat(amount).toFixed(2) : '0.00'; +}; + +onShow(() => { + // 椤甸潰鏄剧ず鏃惰幏鍙栧弬鏁板苟鍒锋柊鍒楄〃 + getPageParams(); + getList(); +}); + +onMounted(() => { + // 椤甸潰鍔犺浇鏃惰幏鍙栧弬鏁板苟鍒锋柊鍒楄〃 + getPageParams(); + getList(); +}); +</script> + +<style scoped lang="scss"> +.receipt-payment-detail { + min-height: 100vh; + background: #f8f9fa; + position: relative; +} + +.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 { + padding: 20px; +} + +.detail-item { + background: #ffffff; + border-radius: 12px; + margin-bottom: 16px; + overflow: hidden; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); + padding: 0 16px; +} + +.item-header { + padding: 10px 0; + display: flex; + align-items: center; + justify-content: space-between; +} + +.item-left { + display: flex; + align-items: center; + gap: 8px; +} + +.record-icon { + width: 24px; + height: 24px; + background: #2979ff; + border-radius: 4px; + display: flex; + align-items: center; + justify-content: center; +} + +.item-index { + font-size: 14px; + color: #333; + font-weight: 500; +} + +.item-date { + font-size: 12px; + color: #666; +} + +.item-details { + padding: 16px 0; +} + +.detail-row { + display: flex; + align-items: flex-end; + justify-content: space-between; + margin-bottom: 8px; + + &:last-child { + margin-bottom: 0; + } +} + +.detail-label { + font-size: 12px; + color: #777777; + min-width: 60px; +} + +.detail-value { + font-size: 12px; + color: #000000; + text-align: right; + flex: 1; + 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