zhangwencui
11 小时以前 b5be6d85c9927a378abca172ea6bef2933657f8e
客户往来数据源修改
已修改3个文件
110 ■■■■■ 文件已修改
src/api/salesManagement/receiptPayment.js 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/sales/receiptPaymentLedger/detail.vue 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/sales/receiptPaymentLedger/index.vue 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/salesManagement/receiptPayment.js
@@ -82,3 +82,21 @@
        params: query
    })
}
// 客户往来列表(指标统计口径)
export function customewTransactions(query) {
    return request({
        url: '/metricStatistics/customewTransactions',
        method: 'get',
        params: query
    })
}
// 客户往来明细(指标统计口径)
export function customewTransactionsDetails(query) {
    return request({
        url: '/metricStatistics/customewTransactionsDetails',
        method: 'get',
        params: query
    })
}
src/pages/sales/receiptPaymentLedger/detail.vue
@@ -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>
    <!-- 回款记录明细列表 -->
@@ -36,27 +36,27 @@
                       size="16"
                       color="#ffffff"></up-icon>
            </view>
            <text class="item-index">{{ index + 1 }}</text>
            <text class="item-index">{{ item.salesContractNo || 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">{{ formatAmount(item.contractAmount) }}</text>
          </view>
          <view class="detail-row">
            <text class="detail-label">回款金额(元)</text>
            <text class="detail-value highlight">{{ formatAmount(item.receiptPaymentAmount) }}</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 danger">{{ formatAmount(item.unReceiptPaymentAmount) }}</text>
            <text class="detail-label">未出库金额(元)</text>
            <text class="detail-value danger">{{ formatAmount(item.unshippedAmount) }}</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">{{ item.salesContractNo || '-' }}</text>
          </view>
        </view>
      </view>
@@ -71,7 +71,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/receiptPayment.js";
  // 客户信息
  const customerId = ref("");
@@ -79,21 +79,21 @@
  // 表格数据
  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);
  });
  const receiptTotal = computed(() => {
  const shippedTotal = computed(() => {
    return tableData.value.reduce((sum, item) => {
      return sum + (parseFloat(item.receiptPaymentAmount) || 0);
      return sum + (parseFloat(item.shippedAmount) || 0);
    }, 0);
  });
  const unReceiptTotal = computed(() => {
  const unshippedTotal = computed(() => {
    return tableData.value.reduce((sum, item) => {
      return sum + (parseFloat(item.unReceiptPaymentAmount) || 0);
      return sum + (parseFloat(item.unshippedAmount) || 0);
    }, 0);
  });
@@ -125,13 +125,18 @@
    showLoadingToast("加载中...");
    const param = {
      customerId: customerId.value,
      current: -1,
      size: -1,
      current: 1,
      size: 100,
    };
    customerInteractions(param)
    customewTransactionsDetails(param)
      .then(res => {
        tableData.value = res.data;
        const data = res?.data;
        if (Array.isArray(data)) {
          tableData.value = data;
        } else {
          tableData.value = data?.records || res?.records || [];
        }
        closeToast();
      })
      .catch(() => {
src/pages/sales/receiptPaymentLedger/index.vue
@@ -9,7 +9,7 @@
        <view class="search-input">
          <up-input class="search-text"
                    placeholder="请输入客户名称"
                    v-model="searchForm.searchText"
                    v-model="searchForm.customerName"
                    @change="searchChange"
                    clearable />
        </view>
@@ -47,16 +47,16 @@
          <up-divider></up-divider>
          <view class="item-details">
            <view class="detail-row">
              <text class="detail-label">开票金额(元)</text>
              <text class="detail-value">{{ formattedNumber(item.invoiceTotal) }}</text>
              <text class="detail-label">合同金额(元)</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.receiptPaymentAmount) }}</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.unReceiptPaymentAmount) }}</text>
              <text class="detail-label">未出库金额(元)</text>
              <text class="detail-value highlight danger">{{ formattedNumber(item.unshippedAmount) }}</text>
            </view>
          </view>
        </view>
@@ -72,19 +72,18 @@
<script setup>
  import { onMounted, ref, reactive, toRefs } from "vue";
  import { onShow } from "@dcloudio/uni-app";
  import { invoiceLedgerSalesAccount } from "@/api/salesManagement/invoiceLedger";
  import { customewTransactions } from "@/api/salesManagement/receiptPayment.js";
  const tableData = ref([]);
  const page = reactive({
    current: -1,
    size: -1,
    current: 1,
    size: 100,
  });
  const data = reactive({
    searchForm: {
      searchText: "",
      invoiceDate: "",
      customerName: "",
    },
  });
@@ -96,7 +95,7 @@
  };
  // 搜索框变化时触发
  const searchChange = val => {
    searchForm.value.searchText = val;
    searchForm.value.customerName = val;
    getList();
  };
  // 查询列表
@@ -106,9 +105,9 @@
  const getList = () => {
    showLoadingToast("加载中...");
    invoiceLedgerSalesAccount({ ...searchForm.value, ...page })
    customewTransactions({ ...searchForm.value, ...page })
      .then(res => {
        tableData.value = res.data.records;
        tableData.value = res?.data?.records || res?.data || res?.records || [];
        closeToast();
      })
      .catch(() => {
@@ -139,7 +138,7 @@
  const rowClickMethod = row => {
    // 使用 uni.setStorageSync 存储客户信息
    uni.setStorageSync("customerId", row.id);
    uni.setStorageSync("customerId", row.customerId);
    // 跳转到回款记录明细页面
    uni.navigateTo({
      url: "/pages/sales/receiptPaymentLedger/detail",
@@ -164,4 +163,4 @@
    color: #ff4757; // 与公共样式中的 #ee0a24 不同
    font-weight: 500;
  }
</style>
</style>