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/receiptPaymentHistory/index.vue | 371 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 371 insertions(+), 0 deletions(-) diff --git a/src/pages/sales/receiptPaymentHistory/index.vue b/src/pages/sales/receiptPaymentHistory/index.vue new file mode 100644 index 0000000..de4620d --- /dev/null +++ b/src/pages/sales/receiptPaymentHistory/index.vue @@ -0,0 +1,371 @@ +<template> + <view class="receipt-payment-history"> + <!-- 浣跨敤閫氱敤椤甸潰澶撮儴缁勪欢 --> + <PageHeader title="鍥炴鍘嗗彶" @back="goBack" /> + + <!-- 鎼滅储鍖哄煙 --> + <view class="search-section"> + <view class="search-bar"> + <view class="search-input"> + <input + class="search-text" + placeholder="璇疯緭鍏ュ鎴峰悕绉�/瀹㈡埛鍚堝悓鍙�" + v-model="searchForm.searchText" + @input="getList" + /> + </view> + <view class="search-button" @click="getList"> + <up-icon name="search" size="24" color="#999"></up-icon> + </view> + </view> + </view> + <!-- 缁熻淇℃伅 --> + <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 highlight">{{ formatAmount(totalAmount) }}</text> + </view> + </view> + <!-- 鍥炴鍘嗗彶鍒楄〃 --> + <view class="history-list" v-if="tableData.length > 0"> + <view v-for="(item, index) in tableData" :key="index"> + <view class="history-item"> + <view class="item-header"> + <view class="item-left"> + <view class="document-icon"> + <up-icon name="file-text" size="16" color="#ffffff"></up-icon> + </view> + <text class="item-id">{{ item.salesContractNo }}</text> + </view> + <view class="item-tag" :class="getTagClass(item.receiptPaymentType)"> + <text class="tag-text">{{ formatReceiptType(item.receiptPaymentType) }}</text> + </view> + </view> + <up-divider></up-divider> + <view class="item-details"> + <view class="detail-row"> + <text class="detail-label">瀹㈡埛鍚堝悓鍙�</text> + <text class="detail-value">{{ item.customerContractNo }}</text> + </view> + <view class="detail-row"> + <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">{{ item.projectName }}</text> + </view> + <view class="detail-row"> + <text class="detail-label">鍥炴鏃ユ湡</text> + <text class="detail-value">{{ item.receiptPaymentDate }}</text> + </view> + <view class="detail-row"> + <text class="detail-label">鍥炴閲戦(鍏�)</text> + <text class="detail-value highlight">{{ formatAmount(item.receiptPaymentAmount) }}</text> + </view> + <up-divider></up-divider> + <view class="detail-info"> + <view class="detail-row"> + <text class="detail-label">鐧昏浜�</text> + <text class="detail-value">{{ item.registrant }}</text> + </view> + <view class="detail-row"> + <text class="detail-label">鐧昏鏃ユ湡</text> + <text class="detail-value">{{ item.createTime }}</text> + </view> + </view> + </view> + </view> + </view> + </view> + <view v-else class="no-data"> + <text>鏆傛棤鍥炴鍘嗗彶鏁版嵁</text> + </view> + </view> +</template> + +<script setup> +import { ref, computed } from 'vue'; +import { onShow } from '@dcloudio/uni-app'; +import { receiptPaymentHistoryListPage } from "@/api/salesManagement/receiptPayment.js"; + +// 鎼滅储琛ㄥ崟 +const searchForm = ref({ + searchText: '', +}); + +// 琛ㄦ牸鏁版嵁 +const tableData = ref([]); + +// 鍒嗛〉鍙傛暟 +const page = ref({ + current: -1, + size: -1, +}); + +const totalAmount = computed(() => { + return tableData.value.reduce((sum, item) => { + return sum + (parseFloat(item.receiptPaymentAmount) || 0); + }, 0); +}); + +// 杩斿洖涓婁竴椤� +const goBack = () => { + uni.navigateBack(); +}; + +// 鏌ヨ鍒楄〃 +const getList = () => { + const params = { + ...searchForm.value, + ...page.value + }; + receiptPaymentHistoryListPage(params).then((res) => { + tableData.value = res.records; + }).catch(() => { + uni.showToast({ + title: '鏌ヨ澶辫触', + icon: 'error' + }); + }); +}; + +// 鏍煎紡鍖栧洖娆炬柟寮� +const formatReceiptType = (type) => { + if (type == 0) { + return "鐢垫眹"; + } else if (type == 1) { + return "鎵垮厬"; + } else { + return "鏈煡"; + } +}; + +// 鑾峰彇鏍囩鏍峰紡绫� +const getTagClass = (type) => { + if (type == 0) { + return "tag-electric"; + } else if (type == 1) { + return "tag-acceptance"; + } else { + return "tag-unknown"; + } +}; + +// 鏍煎紡鍖栭噾棰� +const formatAmount = (amount) => { + return amount ? parseFloat(amount).toFixed(2) : '0.00'; +}; +onShow(() => { + // 椤甸潰鏄剧ず鏃跺埛鏂板垪琛� + getList(); +}); +</script> + +<style scoped lang="scss"> +.u-divider { + margin: 0 !important; +} + +.receipt-payment-history { + min-height: 100vh; + background: #f8f9fa; + position: relative; +} + + + +.search-section { + padding: 10px 20px; + background: #ffffff; +} + +.search-bar { + display: flex; + align-items: center; + gap: 12px; +} + +.search-input { + flex: 1; + background: #f5f5f5; + border-radius: 24px; + padding: 10px 16px; + display: flex; + align-items: center; + gap: 8px; +} + +.search-text { + flex: 1; + font-size: 14px; + color: #333; + background: transparent; + border: none; + outline: none; +} + +.search-text::placeholder { + color: #999; +} + +.search-button { + width: 40px; + height: 40px; + border-radius: 8px; + display: flex; + align-items: center; + justify-content: center; +} + +.history-list { + padding: 20px; +} + +.history-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: 16px 0; + display: flex; + align-items: center; + justify-content: space-between; +} + +.item-left { + display: flex; + align-items: center; + gap: 8px; +} + +.document-icon { + width: 24px; + height: 24px; + background: #2979ff; + border-radius: 4px; + display: flex; + align-items: center; + justify-content: center; +} + +.item-id { + font-size: 14px; + color: #333; + font-weight: 500; +} + +.item-tag { + border-radius: 4px; + padding: 2px 8px; +} + +.tag-electric { + background: #4caf50; +} + +.tag-acceptance { + background: #ff9800; +} + +.tag-unknown { + background: #9e9e9e; +} + +.tag-text { + font-size: 14px; + color: #ffffff; + font-weight: 500; +} + +.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-info { + margin-top: 10px; + display: flex; + align-items: flex-start; + justify-content: space-between; +} + +.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; +} + +.no-data { + padding: 40px 0; + text-align: center; + color: #999; +} + +.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; +} +</style> \ No newline at end of file -- Gitblit v1.9.3