zhangwencui
2 天以前 b66bd3213636032189026d14bdc9f264a3a57742
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(() => {