From 025e46e11cb2962fd7692adfa401333758cc779b Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期二, 02 九月 2025 14:00:34 +0800 Subject: [PATCH] 修改组件 --- src/pages/sales/receiptPayment/index.vue | 69 ++++++++++++++++------------------ 1 files changed, 32 insertions(+), 37 deletions(-) diff --git a/src/pages/sales/receiptPayment/index.vue b/src/pages/sales/receiptPayment/index.vue index ba54e48..ee5a4e7 100644 --- a/src/pages/sales/receiptPayment/index.vue +++ b/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; -- Gitblit v1.9.3