| src/api/procurementManagement/paymentLedger.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/procurementManagement/paymentLedger/detail.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/procurementManagement/paymentLedger/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/api/procurementManagement/paymentLedger.js
@@ -4,17 +4,17 @@ // 分页查询 export function paymentLedgerList(query) { return request({ url: "/purchase/paymentRegistration/supplierNameListPage", url: "/purchase/report/supplierTransactions", method: "get", params: query, }); } // 分页查询 export function paymentRecordList(supplierId) { export function paymentRecordList(params) { return request({ url: "/purchase/paymentRegistration/supplierNameListPageDetails", url: "/purchase/report/supplierTransactionsDetails", method: "get", params: supplierId, params, }); } 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(() => { src/pages/procurementManagement/paymentLedger/index.vue
@@ -1,64 +1,68 @@ <template> <view class="sales-account"> <!-- 使用通用页面头部组件 --> <PageHeader title="供应商往来" @back="goBack" /> <PageHeader title="供应商往来" @back="goBack" /> <!-- 搜索区域 --> <view class="search-section"> <view class="search-bar"> <view class="search-input"> <up-input class="search-text" <up-input class="search-text" placeholder="请输入供应商名称" v-model="searchForm.supplierName" @change="handleQuery" clearable /> clearable /> </view> <view class="search-button" @click="handleQuery"> <up-icon name="search" size="24" color="#999"></up-icon> <view class="search-button" @click="handleQuery"> <up-icon name="search" size="24" color="#999"></up-icon> </view> </view> </view> <!-- 供应商列表 --> <view class="customer-list-container"> <view class="customer-list" v-if="tableData.length > 0"> <view v-for="(item, index) in tableData" <view class="customer-list" v-if="tableData.length > 0"> <view v-for="(item, index) in tableData" :key="item.id" class="customer-item" @click="rowClickMethod(item)" > @click="rowClickMethod(item)"> <view class="item-header"> <view class="item-left"> <view class="customer-icon"> <up-icon name="file-text" size="16" color="#ffffff"></up-icon> <up-icon name="file-text" size="16" color="#ffffff"></up-icon> </view> <text class="customer-name">{{ item.supplierName }}</text> </view> <view class="item-right"> <up-icon name="arrow-right" size="16" color="#999"></up-icon> <up-icon name="arrow-right" size="16" color="#999"></up-icon> </view> </view> <up-divider></up-divider> <view class="item-details"> <view class="detail-row"> <text class="detail-label">合同金额(元)</text> <text class="detail-value">{{ formattedNumber(item.invoiceAmount) }}</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.paymentAmount) }}</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.payableAmount) }}</text> <text class="detail-label">未入库金额(元)</text> <text class="detail-value highlight danger">{{ formattedNumber(item.unshippedAmount) }}</text> </view> </view> </view> </view> <view v-else class="no-data"> <view v-else class="no-data"> <text>暂无供应商数据</text> </view> </view> @@ -67,9 +71,8 @@ <script setup> import { onMounted, ref, reactive, toRefs } from "vue"; import { onShow } from '@dcloudio/uni-app'; import { onShow } from "@dcloudio/uni-app"; import {paymentLedgerList} from "@/api/procurementManagement/paymentLedger"; const tableData = ref([]); @@ -77,8 +80,6 @@ current: -1, size: -1, }); const data = reactive({ searchForm: { @@ -100,28 +101,38 @@ }; const getList = () => { showLoadingToast('加载中...') paymentLedgerList({ ...searchForm.value, ...page }).then((res) => { tableData.value = res.data.records; closeToast() }).catch(() => { closeToast() showLoadingToast("加载中..."); paymentLedgerList({ ...searchForm.value, ...page }) .then(res => { const result = res?.data; if (Array.isArray(result)) { tableData.value = result; } else { tableData.value = result?.records || []; } closeToast(); }) .catch(() => { closeToast(); uni.showToast({ title: '查询失败', icon: 'error' title: "查询失败", icon: "error", }); }); }; const formattedNumber = (value) => { return parseFloat(value || 0).toFixed(2); const formattedNumber = value => { if (value === null || value === undefined || value === "") return "0.00"; const num = Number(value); if (Number.isNaN(num)) return "0.00"; return num.toFixed(2); }; // 显示加载提示 const showLoadingToast = (message) => { const showLoadingToast = message => { uni.showLoading({ title: message, mask: true mask: true, }); }; @@ -130,12 +141,13 @@ uni.hideLoading(); }; const rowClickMethod = (row) => { const rowClickMethod = row => { // 使用 uni.setStorageSync 存储供应商信息 uni.setStorageSync('supplierId', row.supplierId); uni.setStorageSync("supplierId", row.supplierId); uni.setStorageSync("supplierName", row.supplierName); // 跳转到回款记录明细页面 uni.navigateTo({ url: '/pages/procurementManagement/paymentLedger/detail' url: "/pages/procurementManagement/paymentLedger/detail", }); }; @@ -145,7 +157,7 @@ </script> <style scoped lang="scss"> @import '@/styles/procurement-common.scss'; @import "@/styles/procurement-common.scss"; // 供应商往来特有样式 .detail-value.danger {