zhangwencui
2026-09-17 f670b79094c95d791fc43c8fc8b5858ebf8426dc
src/pages/sales/receiptPaymentLedger/detail.vue
@@ -11,12 +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>
      </view>
      <view class="summary-item">
        <text class="summary-label">退货总金额</text>
        <text class="summary-value">{{ formatAmount(returnTotal) }}</text>
      </view>
      <view class="summary-item">
        <text class="summary-label">应收总金额</text>
@@ -38,25 +42,29 @@
            </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.invoiceTotal) }}</text>
            <text class="detail-label">销售合同号</text>
            <text class="detail-value">{{ item.salesContractNo || '-' }}</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.receiptPaymentAmount) }}</text>
          </view>
          <view class="detail-row">
            <text class="detail-label">应收金额(元)</text>
            <text class="detail-value danger">{{ formatAmount(item.unReceiptPaymentAmount) }}</text>
            <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">{{ item.receiptPaymentDate }}</text>
            <text class="detail-label">应收金额(元)</text>
            <text class="detail-value danger">{{ formatAmount(item.receiptableAmount) }}</text>
          </view>
        </view>
      </view>
@@ -71,7 +79,7 @@
<script setup>
  import { ref, computed, onMounted } from "vue";
  import { onShow } from "@dcloudio/uni-app";
  import { customerInteractions } from "@/api/salesManagement/receiptPayment.js";
  import { customewTransactionsDetails } from "@/api/salesManagement/indicatorStats";
  // 客户信息
  const customerId = ref("");
@@ -79,9 +87,9 @@
  // 表格数据
  const tableData = ref([]);
  const invoiceTotal = computed(() => {
  const contractTotal = computed(() => {
    return tableData.value.reduce((sum, item) => {
      return sum + (parseFloat(item.invoiceTotal) || 0);
      return sum + (parseFloat(item.contractAmount) || 0);
    }, 0);
  });
@@ -91,9 +99,15 @@
    }, 0);
  });
  const returnTotal = computed(() => {
    return tableData.value.reduce((sum, item) => {
      return sum + (parseFloat(item.returnAmount) || 0);
    }, 0);
  });
  const unReceiptTotal = computed(() => {
    return tableData.value.reduce((sum, item) => {
      return sum + (parseFloat(item.unReceiptPaymentAmount) || 0);
      return sum + (parseFloat(item.receiptableAmount) || 0);
    }, 0);
  });
@@ -129,9 +143,11 @@
      size: -1,
    };
    customerInteractions(param)
    customewTransactionsDetails(param)
      .then(res => {
        tableData.value = res.data;
        // 明细接口可能返回数组或分页对象(与 Web 处理一致)
        const data = res?.data;
        tableData.value = Array.isArray(data) ? data : data?.records || [];
        closeToast();
      })
      .catch(() => {