zhangwencui
13 小时以前 5b76649a97e92e3f02cdbb71e871443524fd0348
src/pages/procurementManagement/paymentLedger/detail.vue
@@ -1,10 +1,11 @@
<template>
   <view class="receipt-payment-detail">
      <!-- 使用通用页面头部组件 -->
      <PageHeader title="供应商往来详情" @back="goBack" />
    <PageHeader title="供应商往来详情"
                @back="goBack" />
      <!-- 统计信息 -->
      <view class="summary-info" v-if="tableData.length > 0">
    <view class="summary-info"
          v-if="tableData.length > 0">
         <view class="summary-item">
            <text class="summary-label">总记录数</text>
            <text class="summary-value">{{ tableData.length }}</text>
@@ -22,14 +23,18 @@
            <text class="summary-value danger">{{ formatAmount(unReceiptTotal) }}</text>
         </view>
      </view>
      <!-- 回款记录明细列表 -->
      <view class="detail-list" v-if="tableData.length > 0">
         <view v-for="(item, index) in tableData" :key="index" class="detail-item">
    <view class="detail-list"
          v-if="tableData.length > 0">
      <view v-for="(item, index) in tableData"
            :key="index"
            class="detail-item">
            <view class="item-header">
               <view class="item-left">
                  <view class="record-icon">
                     <up-icon name="file-text" size="16" color="#ffffff"></up-icon>
              <up-icon name="file-text"
                       size="16"
                       color="#ffffff"></up-icon>
                  </view>
                  <text class="item-index">{{ index + 1 }}</text>
               </view>
@@ -52,19 +57,23 @@
            </view>
         </view>
      </view>
      <view v-else class="no-data">
    <view v-else
          class="no-data">
         <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 { ref, computed, onMounted } from "vue";
  import { onShow } from "@dcloudio/uni-app";
  import {
    paymentLedgerList,
    paymentRecordList,
  } from "@/api/procurementManagement/paymentLedger";
// 客户信息
const supplierId = ref('');
  const supplierId = ref("");
// 表格数据
const tableData = ref([]);
@@ -89,14 +98,14 @@
// 返回上一页
const goBack = () => {
   uni.removeStorageSync('supplierId')
    uni.removeStorageSync("supplierId");
   uni.navigateBack();
};
// 获取页面参数
const getPageParams = () => {
   // 从本地存储获取供应商ID
   const storedSupplierId = uni.getStorageSync('supplierId');
    const storedSupplierId = uni.getStorageSync("supplierId");
   if (storedSupplierId) {
      supplierId.value = storedSupplierId;
   }
@@ -106,34 +115,36 @@
const getList = () => {
   if (!supplierId.value) {
      uni.showToast({
         title: '客户信息缺失',
         icon: 'error'
        title: "客户信息缺失",
        icon: "error",
      });
      return;
   }
   showLoadingToast('加载中...')
   paymentRecordList(supplierId.value).then((res) => {
    showLoadingToast("加载中...");
    paymentRecordList(supplierId.value)
      .then(res => {
      tableData.value = res.data;
      closeToast()
   }).catch(() => {
      closeToast()
        closeToast();
      })
      .catch(() => {
        closeToast();
      uni.showToast({
         title: '查询失败',
         icon: 'error'
          title: "查询失败",
          icon: "error",
      });
   });
};
// 格式化金额
const formatAmount = (amount) => {
   return amount ? parseFloat(amount).toFixed(2) : '0.00';
  const formatAmount = amount => {
    return amount ? parseFloat(amount).toFixed(2) : "0.00";
};
// 显示加载提示
const showLoadingToast = (message) => {
  const showLoadingToast = message => {
   uni.showLoading({
      title: message,
      mask: true
      mask: true,
   });
};