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