| | |
| | | </view> |
| | | |
| | | <!-- 列表区域 --> |
| | | <view class="ledger-list" v-if="total > 0"> |
| | | <view class="ledger-list" v-if="ledgerList.length > 0"> |
| | | <view v-for="(item, index) in ledgerList" :key="index"> |
| | | <view class="ledger-item"> |
| | | <view class="item-header"> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, onMounted } from 'vue' |
| | | import {reactive, ref} from 'vue' |
| | | import dayjs from 'dayjs' |
| | | import PageHeader from '@/components/PageHeader.vue' |
| | | import useUserStore from '@/store/modules/user' |
| | | import {getToken} from '@/utils/auth' |
| | | import config from '@/config.js' |
| | | import { |
| | | commitFile, |
| | | delInvoiceLedgerByRegProductId, |
| | | registrationProductPage |
| | | } from '@/api/salesManagement/invoiceLedger.js' |
| | | import {onShow} from "@dcloudio/uni-app"; |
| | | |
| | | const showToast = (message) => { |
| | | uni.showToast({ |
| | | title: message, |
| | |
| | | const closeToast = () => { |
| | | uni.hideLoading() |
| | | } |
| | | import useUserStore from '@/store/modules/user' |
| | | import { getToken } from '@/utils/auth' |
| | | import config from '@/config.js' |
| | | import { |
| | | registrationProductPage, |
| | | commitFile, |
| | | delInvoiceLedgerByRegProductId |
| | | } from '@/api/salesManagement/invoiceLedger.js' |
| | | import {onShow} from "@dcloudio/uni-app"; |
| | | |
| | | const userStore = useUserStore() |
| | | |
| | | // 列表与查询 |
| | | const ledgerList = ref([]) |
| | | const total = ref(0) |
| | | const page = reactive({ current: -1, size: -1 }) |
| | | const searchForm = reactive({ |
| | | searchText: '', |
| | |
| | | const { invoiceDate, ...rest } = searchForm |
| | | const res = await registrationProductPage({ ...rest, ...page }) |
| | | // 兼容不同返回结构 |
| | | const records = res?.data?.records || res?.records || res?.data || [] |
| | | const totalVal = res?.data?.total || res?.total || records.length || 0 |
| | | ledgerList.value = records |
| | | total.value = totalVal |
| | | ledgerList.value = res?.data?.records || res?.records || res?.data || [] |
| | | closeToast() |
| | | } catch (e) { |
| | | closeToast() |