zhangwencui
7 小时以前 a9eb04aa315d6bd08625fd983d8c4356688a9bad
src/pages/sales/receiptPaymentLedger/index.vue
@@ -1,44 +1,47 @@
<template>
   <view class="sales-account">
      <!-- 使用通用页面头部组件 -->
      <PageHeader title="客户往来" @back="goBack" />
    <PageHeader title="客户往来"
                @back="goBack" />
      <!-- 搜索区域 -->
      <view class="search-section">
         <view class="search-bar">
            <view class="search-input">
               <up-input
                  class="search-text"
          <up-input class="search-text"
                  placeholder="请输入客户名称"
                  v-model="searchForm.customerName"
                  @change="handleQuery"
                  clearable
               />
                    v-model="searchForm.searchText"
                    @change="searchChange"
                    clearable />
            </view>
            <view class="search-button" @click="handleQuery">
               <up-icon name="search" size="24" color="#999"></up-icon>
        <view class="search-button"
              @click="handleQuery">
          <up-icon name="search"
                   size="24"
                   color="#999"></up-icon>
            </view>
         </view>
      </view>
      <!-- 客户列表 -->
      <view class="customer-list-container">
         <view class="customer-list" v-if="tableData.length > 0">
            <view
               v-for="(item, index) in tableData"
      <view class="customer-list"
            v-if="tableData.length > 0">
        <view v-for="(item, index) in tableData"
               :key="item.id"
               class="customer-item"
               @click="rowClickMethod(item)"
            >
              @click="rowClickMethod(item)">
               <view class="item-header">
                  <view class="item-left">
                     <view class="customer-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="customer-name">{{ item.customerName }}</text>
                  </view>
                  <view class="item-right">
                     <up-icon name="arrow-right" size="16" color="#999"></up-icon>
              <up-icon name="arrow-right"
                       size="16"
                       color="#999"></up-icon>
                  </view>
               </view>
               <up-divider></up-divider>
@@ -58,7 +61,8 @@
               </view>
            </view>
         </view>
         <view v-else class="no-data">
      <view v-else
            class="no-data">
            <text>暂无客户数据</text>
         </view>
      </view>
@@ -67,9 +71,8 @@
<script setup>
import { onMounted, ref, reactive, toRefs } from "vue";
import { onShow } from '@dcloudio/uni-app';
  import { onShow } from "@dcloudio/uni-app";
import { invoiceLedgerSalesAccount } from "@/api/salesManagement/invoiceLedger";
const tableData = ref([]);
@@ -78,11 +81,9 @@
   size: -1,
});
const data = reactive({
   searchForm: {
      customerName: "",
      searchText: "",
      invoiceDate: "",
   },
});
@@ -93,35 +94,41 @@
const goBack = () => {
   uni.navigateBack();
};
  // 搜索框变化时触发
  const searchChange = val => {
    searchForm.value.searchText = val;
    getList();
  };
// 查询列表
const handleQuery = () => {
   getList();
};
const getList = () => {
   showLoadingToast('加载中...')
   invoiceLedgerSalesAccount({ ...searchForm.value, ...page }).then((res) => {
    showLoadingToast("加载中...");
    invoiceLedgerSalesAccount({ ...searchForm.value, ...page })
      .then(res => {
      tableData.value = res.data.records;
      closeToast()
   }).catch(() => {
      closeToast()
        closeToast();
      })
      .catch(() => {
        closeToast();
      uni.showToast({
         title: '查询失败',
         icon: 'error'
          title: "查询失败",
          icon: "error",
      });
   });
};
const formattedNumber = (value) => {
  const formattedNumber = value => {
   return parseFloat(value || 0).toFixed(2);
};
// 显示加载提示
const showLoadingToast = (message) => {
  const showLoadingToast = message => {
   uni.showLoading({
      title: message,
      mask: true
      mask: true,
   });
};
@@ -130,12 +137,12 @@
   uni.hideLoading();
};
const rowClickMethod = (row) => {
  const rowClickMethod = row => {
   // 使用 uni.setStorageSync 存储客户信息
   uni.setStorageSync('customerId', row.id);
    uni.setStorageSync("customerId", row.id);
   // 跳转到回款记录明细页面
   uni.navigateTo({
      url: '/pages/sales/receiptPaymentLedger/detail'
      url: "/pages/sales/receiptPaymentLedger/detail",
   });
};
@@ -150,7 +157,7 @@
</script>
<style scoped lang="scss">
@import '@/styles/sales-common.scss';
  @import "@/styles/sales-common.scss";
// 客户往来特有样式
.detail-value.danger {