| | |
| | | |
| | | // 返回上一页 |
| | | const goBack = () => { |
| | | uni.removeStorageSync('supplierId') |
| | | uni.navigateBack(); |
| | | }; |
| | | |
| | | // 获取页面参数 |
| | | const getPageParams = () => { |
| | | const pages = getCurrentPages(); |
| | | const currentPage = pages[pages.length - 1]; |
| | | const options = currentPage.options; |
| | | |
| | | if (options.supplierId) { |
| | | supplierId.value = options.supplierId; |
| | | // 从本地存储获取供应商ID |
| | | const storedSupplierId = uni.getStorageSync('supplierId'); |
| | | if (storedSupplierId) { |
| | | supplierId.value = storedSupplierId; |
| | | } |
| | | }; |
| | | |
| | |
| | | }); |
| | | return; |
| | | } |
| | | showLoadingToast('加载中...') |
| | | const param = { |
| | | supplierId: supplierId.value, |
| | | current: -1, |
| | |
| | | }; |
| | | paymentLedgerList(param).then((res) => { |
| | | tableData.value = res.data.records; |
| | | closeToast() |
| | | }).catch(() => { |
| | | closeToast() |
| | | uni.showToast({ |
| | | title: '查询失败', |
| | | icon: 'error' |
| | |
| | | return amount ? parseFloat(amount).toFixed(2) : '0.00'; |
| | | }; |
| | | |
| | | // 显示加载提示 |
| | | const showLoadingToast = (message) => { |
| | | uni.showLoading({ |
| | | title: message, |
| | | mask: true |
| | | }); |
| | | }; |
| | | |
| | | // 关闭提示 |
| | | const closeToast = () => { |
| | | uni.hideLoading(); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | // 页面加载时获取参数并刷新列表 |
| | | getPageParams(); |