gaoluyang
4 天以前 025e46e11cb2962fd7692adfa401333758cc779b
src/pages/sales/receiptPayment/index.vue
@@ -1,5 +1,5 @@
<template>
   <view class="receipt-payment">
   <view class="sales-account">
      <!-- 使用通用页面头部组件 -->
      <PageHeader title="回款登记" @back="goBack" />
@@ -22,7 +22,7 @@
         <!-- 筛选开关 -->
         <view class="switch-row">
            <text class="switch-label">不显示待回款为0</text>
            <van-switch v-model="searchForm.status" @change="getList" size="18"/>
            <up-switch v-model="searchForm.status" @change="getList" size="18"/>
         </view>
      </view>
@@ -82,7 +82,7 @@
               
               <!-- 操作按钮 -->
               <view class="action-buttons">
                  <van-button
                  <up-button
                     type="primary"
                     size="small"
                     class="action-btn"
@@ -90,7 +90,7 @@
                     @click="openForm(item)"
                  >
                     新增回款
                  </van-button>
                  </up-button>
               </view>
            </view>
         </view>
@@ -100,15 +100,6 @@
      <view class="no-data" v-else>
         <text>暂无回款数据</text>
      </view>
      <!-- 回款方式选择器 -->
      <van-popup v-model:show="showPaymentType" position="bottom">
         <van-picker
            :columns="receipt_payment_type"
            @confirm="onPaymentTypeConfirm"
            @cancel="showPaymentType = false"
         />
      </van-popup>
   </view>
</template>
@@ -118,16 +109,33 @@
   bindInvoiceNoRegPage,
} from '@/api/salesManagement/receiptPayment'
import useUserStore from '@/store/modules/user'
import { showToast } from 'vant'
import {onShow} from "@dcloudio/uni-app";
const userStore = useUserStore()
// 显示提示信息
const showToast = (message) => {
   uni.showToast({
      title: message,
      icon: 'none'
   })
}
// 显示加载提示
const showLoadingToast = (message) => {
   uni.showLoading({
      title: message,
      mask: true
   });
};
// 关闭加载提示
const closeToast = () => {
   uni.hideLoading();
};
import {onShow} from "@dcloudio/uni-app";
// 响应式数据
const tableData = ref([])
const tableLoading = ref(false)
const showPaymentType = ref(false)
const currentEditRow = ref(null)
// 查询参数设置为-1获取全部数据
const page = ref({
@@ -144,14 +152,6 @@
   projectName: ''
})
// 回款方式选项
const receipt_payment_type = ref([
   { text: '现金', value: '1' },
   { text: '银行转账', value: '2' },
   { text: '支票', value: '3' },
   { text: '其他', value: '4' }
])
// 格式化数字
const formatNumber = (value) => {
   return parseFloat(value || 0).toFixed(2)
@@ -164,14 +164,16 @@
// 获取列表数据
const getList = () => {
   tableLoading.value = true
   showLoadingToast('加载中...')
   bindInvoiceNoRegPage({ ...searchForm.value, ...page.value })
      .then((res) => {
         tableLoading.value = false
         tableData.value = res.data.records || []
      })
      .catch(() => {
         tableLoading.value = false
         showToast('获取数据失败')
      })
      .finally(() => {
         closeToast()
      })
}
@@ -185,13 +187,6 @@
   uni.navigateTo({ url: '/pages/sales/receiptPayment/add' })
}
// 确认回款方式选择
const onPaymentTypeConfirm = (value) => {
   if (currentEditRow.value) {
      currentEditRow.value.receiptPaymentType = value.value
   }
   showPaymentType.value = false
}
onShow(() => {
   getList()
})
@@ -202,7 +197,7 @@
   margin: 0 !important;
}
.receipt-payment {
.sales-account {
   min-height: 100vh;
   background: #f8f9fa;
   position: relative;