gaoluyang
3 天以前 7de165ce3fc2318681ed66494fb6da9fd700417b
src/pages/procurementManagement/paymentLedger/detail.vue
@@ -1,7 +1,7 @@
<template>
   <view class="receipt-payment-detail">
      <!-- 使用通用页面头部组件 -->
      <PageHeader title="客户往来详情" @back="goBack" />
      <PageHeader title="供应商往来详情" @back="goBack" />
      
      <!-- 统计信息 -->
      <view class="summary-info" v-if="tableData.length > 0">
@@ -61,7 +61,7 @@
<script setup>
import { ref, computed, onMounted } from 'vue';
import { onShow } from '@dcloudio/uni-app';
import {paymentLedgerList} from "@/api/procurementManagement/paymentLedger";
import {paymentLedgerList, paymentRecordList} from "@/api/procurementManagement/paymentLedger";
// 客户信息
const supplierId = ref('');
@@ -89,17 +89,16 @@
// 返回上一页
const goBack = () => {
   uni.removeStorageSync('supplierId')
   uni.navigateBack();
};
// 获取页面参数
const getPageParams = () => {
   const pages = getCurrentPages();
   const currentPage = pages[pages.length - 1];
   const options = currentPage.options;
   if (options.supplierId) {
      supplierId.value = options.supplierId;
   // 从本地存储获取供应商ID
   const storedSupplierId = uni.getStorageSync('supplierId');
   if (storedSupplierId) {
      supplierId.value = storedSupplierId;
   }
};
@@ -112,12 +111,12 @@
      });
      return;
   }
   const param = {
      supplierId: supplierId.value,
   };
   paymentLedgerList(param).then((res) => {
   showLoadingToast('加载中...')
   paymentRecordList(supplierId.value).then((res) => {
      tableData.value = res.data;
      closeToast()
   }).catch(() => {
      closeToast()
      uni.showToast({
         title: '查询失败',
         icon: 'error'
@@ -130,6 +129,19 @@
   return amount ? parseFloat(amount).toFixed(2) : '0.00';
};
// 显示加载提示
const showLoadingToast = (message) => {
   uni.showLoading({
      title: message,
      mask: true
   });
};
// 关闭提示
const closeToast = () => {
   uni.hideLoading();
};
onMounted(() => {
   // 页面加载时获取参数并刷新列表
   getPageParams();