From ee42bf1badae06026efa79dc17d2a541297ab49b Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期三, 03 九月 2025 17:43:31 +0800 Subject: [PATCH] 采购管理整体样式优化,搜索条件修改 --- src/pages/equipmentManagement/ledger/index.vue | 44 ++++++++++++++++++++++++++++++++++---------- 1 files changed, 34 insertions(+), 10 deletions(-) diff --git a/src/pages/equipmentManagement/ledger/index.vue b/src/pages/equipmentManagement/ledger/index.vue index 0114c15..712de1e 100644 --- a/src/pages/equipmentManagement/ledger/index.vue +++ b/src/pages/equipmentManagement/ledger/index.vue @@ -78,25 +78,25 @@ </view> </view> - <!-- 鎸夐挳鍖哄煙锛屽弬鑰� invoiceLedger 鐨勬牱寮� --> + <!-- 鎸夐挳鍖哄煙 - 鏇挎崲涓� uview-plus 鎸夐挳 --> <view class="action-buttons"> - <van-button + <u-button type="primary" size="small" class="action-btn" @click="edit(item.id)" > 缂栬緫 - </van-button> - <van-button - type="danger" + </u-button> + <u-button + type="error" size="small" plain class="action-btn" @click="deleteRow(item.id)" > 鍒犻櫎 - </van-button> + </u-button> </view> </view> </view> @@ -119,7 +119,14 @@ import PageHeader from '@/components/PageHeader.vue' import { getLedgerPage, delLedger } from '@/api/equipmentManagement/ledger' import useUserStore from "@/store/modules/user" -import { showToast } from 'vant'; + +// 鏇挎崲 toast 鏂规硶 +const showToast = (message) => { + uni.showToast({ + title: message, + icon: 'none' + }) +} const userStore = useUserStore() @@ -136,6 +143,7 @@ // 鏌ヨ鍒楄〃锛坈urrent/size 鍥哄畾浼� -1锛� const getList = () => { + showLoadingToast('鍔犺浇涓�...') const params = { current: -1, size: -1, @@ -143,12 +151,27 @@ } getLedgerPage(params) .then((res) => { - ledgerList.value = res.records || res.data?.records || [] + ledgerList.value = res.data.records + closeToast() }) .catch(() => { + closeToast() showToast('鑾峰彇鏁版嵁澶辫触') }) } + +// 鏄剧ず鍔犺浇鎻愮ず +const showLoadingToast = (message) => { + uni.showLoading({ + title: message, + mask: true + }); +}; + +// 鍏抽棴鎻愮ず +const closeToast = () => { + uni.hideLoading(); +}; // 鏂板 - 璺宠浆鍒拌鎯呴〉闈� const add = () => { @@ -160,8 +183,9 @@ // 缂栬緫 - 璺宠浆鍒拌鎯呴〉闈� const edit = (id) => { if (!id) return + uni.setStorageSync('ledgerId', id) uni.navigateTo({ - url: `/pages/equipmentManagement/ledger/detail?id=${id}` + url: '/pages/equipmentManagement/ledger/detail' }) } @@ -330,7 +354,7 @@ color: #999; } -// 鎸夐挳鏍峰紡锛屽弬鑰� invoiceLedger +// 鎸夐挳鏍峰紡 .action-buttons { display: flex; gap: 12px; -- Gitblit v1.9.3