| | |
| | | |
| | | // 查询列表(current/size 固定传 -1) |
| | | const getList = () => { |
| | | showLoadingToast('加载中...') |
| | | const params = { |
| | | current: -1, |
| | | size: -1, |
| | |
| | | } |
| | | 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 = () => { |
| | |
| | | // 编辑 - 跳转到详情页面 |
| | | const edit = (id) => { |
| | | if (!id) return |
| | | uni.setStorageSync('ledgerId', id) |
| | | uni.navigateTo({ |
| | | url: `/pages/equipmentManagement/ledger/detail?id=${id}` |
| | | url: '/pages/equipmentManagement/ledger/detail' |
| | | }) |
| | | } |
| | | |