This commit is contained in:
2026-08-12 17:29:35 +08:00
parent 16c5ed6301
commit d2a246b122
25 changed files with 238 additions and 69 deletions
@@ -52,7 +52,7 @@ const canReview = computed(() => access.can('platform:finance:reconciliation:rev
const canIssue = computed(() => access.can('platform:finance:reconciliation:issue'))
const canAdjust = computed(() => access.can('platform:finance:reconciliation:adjust'))
const canVoid = computed(() => access.can('platform:finance:reconciliation:void'))
const fields = computed<QueryField[]>(() => [{ key: 'customerId', type: 'select', label: '客户', width: 280, placeholder: '请选择客户', props: { filterable: true }, options: customers.value.filter((item) => item.status === 'ACTIVE').map((item) => ({ label: item.tenantName, value: String(item.id) })) }])
const fields = computed<QueryField[]>(() => [{ key: 'customerId', type: 'select', label: '客户', width: 280, placeholder: '全部客户', props: { filterable: true, clearable: true }, options: customers.value.filter((item) => item.status === 'ACTIVE').map((item) => ({ label: item.tenantName, value: String(item.id) })) }])
const columns: DataTableColumn[] = [
{ key: 'actions', label: '操作', width: 280, fixed: 'left', slotName: 'actions' },
{ key: 'billNo', label: '对账单号', minWidth: 180 },
@@ -79,9 +79,8 @@ async function load(model: QueryModel = filters.value) {
filters.value = { ...model }
rows.value = []
error.value = null
if (!filters.value.customerId) return
loading.value = true
try { rows.value = await listFinanceStatements(String(filters.value.customerId)) }
try { rows.value = await listFinanceStatements(String(filters.value.customerId || '').trim() || undefined) }
catch (cause) { error.value = getApiErrorDetails(cause, '客户对账单加载失败,请重试') }
finally { loading.value = false }
}
@@ -160,7 +159,7 @@ async function submitAdjustment() {
finally { adjustBusy.value = false }
}
onMounted(() => void loadCustomers())
onMounted(() => { void loadCustomers(); void load() })
</script>
<template>
@@ -170,7 +169,7 @@ onMounted(() => void loadCustomers())
<template #toolbar><QueryToolbar v-model="filters" class="surface-panel" ariaLabel="客户对账单筛选" :fields="fields" preference-key="finance-statements-query" @search="load" /></template>
<template v-if="customerError || error" #state><LoadErrorState title="客户对账单加载失败" :message="(customerError || error)?.message || ''" :loading="loading" @retry="customerError ? loadCustomers() : load()"><template #details><ApiErrorMeta :details="(customerError || error)!" /></template></LoadErrorState></template>
<section v-if="!customerError && !error" class="surface-panel table-panel">
<DataTable :data="rows" :columns="columns" :loading="loading" aria-label="客户对账单列表" row-key="id" empty-text="请选择客户查询对账单">
<DataTable :data="rows" :columns="columns" :loading="loading" aria-label="客户对账单列表" row-key="id" empty-text="暂无客户对账单">
<template #toolbar-actions><el-button v-if="canCreate" type="primary" @click="createOpen = true"><Plus :size="15" />生成对账单</el-button></template>
<template #actions="{ row }">
<el-button link type="primary" @click="openDetail(row as FinanceStatementReadModel)"><Eye :size="15" />详情</el-button>