feat: 用户详情模态框发票抬头列表新增分页功能。
This commit is contained in:
parent
728ff095cb
commit
9e821e1bd2
@ -34,6 +34,12 @@ const logPagination = ref({
|
||||
itemCount: 0,
|
||||
})
|
||||
|
||||
const invoicePagination = ref({
|
||||
page: 1,
|
||||
pageSize: 5,
|
||||
itemCount: 0,
|
||||
})
|
||||
|
||||
const invoiceColumns = [
|
||||
{ title: '公司名称', key: 'company_name', ellipsis: { tooltip: true } },
|
||||
{ title: '公司税号', key: 'tax_number', ellipsis: { tooltip: true } },
|
||||
@ -100,6 +106,7 @@ watch(
|
||||
invoiceList.value = []
|
||||
logList.value = []
|
||||
logPagination.value.page = 1
|
||||
invoicePagination.value.page = 1
|
||||
}
|
||||
}
|
||||
)
|
||||
@ -117,12 +124,13 @@ watch(activeTab, (tab) => {
|
||||
async function fetchInvoices() {
|
||||
invoiceLoading.value = true
|
||||
try {
|
||||
const { data = [] } = await api.getInvoiceHeaders({
|
||||
const { data = [], total = 0 } = await api.getInvoiceHeaders({
|
||||
user_id: props.baseInfo.id,
|
||||
page: 1,
|
||||
page_size: 100
|
||||
page: invoicePagination.value.page,
|
||||
page_size: invoicePagination.value.pageSize
|
||||
})
|
||||
invoiceList.value = data
|
||||
invoicePagination.value.itemCount = total
|
||||
} catch (error) {
|
||||
message.error(error?.message || '获取发票抬头失败')
|
||||
} finally {
|
||||
@ -130,6 +138,11 @@ async function fetchInvoices() {
|
||||
}
|
||||
}
|
||||
|
||||
function handleInvoicePageChange(page) {
|
||||
invoicePagination.value.page = page
|
||||
fetchInvoices()
|
||||
}
|
||||
|
||||
async function fetchLogs() {
|
||||
logLoading.value = true
|
||||
try {
|
||||
@ -202,9 +215,11 @@ function handleClose() {
|
||||
class="section-table"
|
||||
:columns="invoiceColumns"
|
||||
:data="invoiceList"
|
||||
:pagination="false"
|
||||
:pagination="invoicePagination"
|
||||
:remote="true"
|
||||
:bordered="false"
|
||||
:single-line="false"
|
||||
@update:page="handleInvoicePageChange"
|
||||
>
|
||||
<template #empty>
|
||||
<div class="empty">暂无发票抬头信息</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user