| | |
| | | <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(paymentTotal) }}</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">{{ formatAmount(returnTotal) }}</text> |
| | | </view> |
| | | <view class="summary-item"> |
| | | <text class="summary-label">应付总金额</text> |
| | | <text class="summary-value danger">{{ formatAmount(payableTotal) }}</text> |
| | | </view> |
| | | </view> |
| | | <!-- 回款记录明细列表 --> |
| | |
| | | </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">{{ formatAmount(item.contractAmount) }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">付款金额(元)</text> |
| | | <text class="detail-value highlight">{{ formatAmount(item.currentPaymentAmount) }}</text> |
| | | <text class="detail-value highlight">{{ formatAmount(item.paymentAmount) }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">退货金额(元)</text> |
| | | <text class="detail-value">{{ formatAmount(item.returnAmount) }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">应付金额(元)</text> |
| | | <text class="detail-value danger">{{ formatAmount(item.payableAmount) }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">发生日期</text> |
| | | <text class="detail-value">{{ item.paymentDate }}</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 { onShow } from "@dcloudio/uni-app"; |
| | | import { |
| | | paymentLedgerList, |
| | | paymentRecordList, |
| | | } from "@/api/procurementManagement/paymentLedger"; |
| | | import { paymentRecordList } from "@/api/procurementManagement/paymentLedger"; |
| | | |
| | | // 客户信息 |
| | | // 供应商信息 |
| | | const supplierId = ref(""); |
| | | |
| | | // 表格数据 |
| | | 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 paymentTotal = computed(() => { |
| | | return tableData.value.reduce((sum, item) => { |
| | | return sum + (parseFloat(item.receiptAmount) || 0); |
| | | return sum + (parseFloat(item.paymentAmount) || 0); |
| | | }, 0); |
| | | }); |
| | | |
| | | const unReceiptTotal = computed(() => { |
| | | const returnTotal = computed(() => { |
| | | return tableData.value.reduce((sum, item) => { |
| | | return sum + (parseFloat(item.unReceiptAmount) || 0); |
| | | return sum + (parseFloat(item.returnAmount) || 0); |
| | | }, 0); |
| | | }); |
| | | |
| | | const payableTotal = computed(() => { |
| | | return tableData.value.reduce((sum, item) => { |
| | | return sum + (parseFloat(item.payableAmount) || 0); |
| | | }, 0); |
| | | }); |
| | | |
| | |
| | | const getList = () => { |
| | | if (!supplierId.value) { |
| | | uni.showToast({ |
| | | title: "客户信息缺失", |
| | | title: "供应商信息缺失", |
| | | icon: "error", |
| | | }); |
| | | return; |
| | | } |
| | | showLoadingToast("加载中..."); |
| | | paymentRecordList({ supplierId: supplierId.value }) |
| | | paymentRecordList({ |
| | | supplierId: supplierId.value, |
| | | current: -1, |
| | | size: -1, |
| | | }) |
| | | .then(res => { |
| | | tableData.value = res.data; |
| | | // 明细接口可能返回数组或分页对象(与 Web 处理一致) |
| | | const data = res?.data; |
| | | tableData.value = Array.isArray(data) ? data : data?.records || []; |
| | | closeToast(); |
| | | }) |
| | | .catch(() => { |