This commit is contained in:
2026-11-04 14:39:22 +08:00
parent 84dd9dcbb4
commit 73dc7311d3
3 changed files with 5 additions and 7 deletions
@@ -132,7 +132,7 @@ describe('formal settlement download-center exports', () => {
expect(router.currentRoute.value.name).toBe('download-center')
})
it('uses the payable detail type without a direction parameter', async () => {
it('removes the payable detail export while retaining list exports', async () => {
vi.mocked(getFinanceSettlement).mockResolvedValueOnce({ ...detail, id: '801', settlementNo: 'AP-801', direction: 'PAYABLE' })
vi.mocked(createPlatformExportTask).mockResolvedValueOnce({ taskName: '应付结算单详情', taskNo: 'EXP-DETAIL-2' } as never)
const router = testRouter()
@@ -143,9 +143,8 @@ describe('formal settlement download-center exports', () => {
await (wrapper.vm as unknown as { exportDetail(): Promise<void> }).exportDetail()
expect(createPlatformExportTask).toHaveBeenCalledWith({
exportType: 'FINANCE_PAYABLE_SETTLEMENT_DETAIL', format: 'XLSX', taskName: '应付结算单详情', parameters: { settlementId: '801' },
})
expect(wrapper.find('.finance-detail-actions').text()).not.toContain('导出')
expect(createPlatformExportTask).not.toHaveBeenCalled()
})
it('hides export actions unless both export and download-list permissions are present', async () => {
@@ -526,7 +526,7 @@ async function createSettlementExport(detailId?: string) {
}
function exportRows() { return createSettlementExport() }
function exportDetail() { return detail.value ? createSettlementExport(detail.value.id) : undefined }
function exportDetail() { return props.kind === 'receivable' && detail.value ? createSettlementExport(detail.value.id) : undefined }
onMounted(() => {
if (canListCustomers.value) void loadCustomers()
@@ -545,7 +545,7 @@ onMounted(() => {
<el-result v-if="!canView" icon="warning" :title="`无权访问${title}`" sub-title="请联系管理员开通结算单查看权限" />
<DetailPageLayout v-else-if="detailMode" class="settlement-detail-page surface-panel finance-density-detail workbench-panel is-flush is-page-surface" :aria-label="`${title}详情`">
<template #header><div class="density-detail-header"><div class="density-detail-heading"><el-button link class="density-back" aria-label="返回列表" @click="backToList"><ArrowLeft :size="16" />返回列表</el-button><h1 class="density-detail-title">{{ detail?.settlementNo || '—' }}</h1><StatusBadge v-if="detail" :status="financeStatusLabel(detail.status)" /></div><div class="finance-detail-actions">
<el-button v-if="detail && canExport" :loading="exportSubmitting" :disabled="exportSubmitting" @click="exportDetail"><Download :size="15" />导出</el-button>
<el-button v-if="kind === 'receivable' && detail && canExport" :loading="exportSubmitting" :disabled="exportSubmitting" @click="exportDetail"><Download :size="15" />导出</el-button>
<el-button v-if="detail && canReceive && ['ISSUED','PARTIALLY_PAID'].includes(detail.status)" type="primary" :loading="receiptBusy" @click="openReceiptFromDetail"><HandCoins :size="15" />部分收款</el-button>
<el-button v-if="detail && canPay && ['ISSUED','PARTIALLY_PAID'].includes(detail.status)" type="primary" @click="openPaymentFromDetail"><CreditCard :size="15" />部分付款</el-button>
<el-button v-if="detail && canVoid && detail.status === 'ISSUED'" type="danger" :loading="actionBusy" @click="performAction(detailActionRow(), 'VOID')"><XCircle :size="15" />作废</el-button>
@@ -214,7 +214,6 @@ const allFields: QueryField[] = [
{ label: '头程订单', value: 'FIRST_LEG' }, { label: '换标下单', value: 'RELABEL_APPLICATION' },
{ label: '仓储转运', value: 'WAREHOUSE_TRANSFER' }, { label: '本土散板', value: 'LOCAL_LOOSEBOARD' },
{ label: '退货换标', value: 'RETURN_RELABEL' }, { label: '一件代发', value: 'ONE_CLICK_DROPSHIP' },
{ label: '货物废弃订单', value: 'CARGO_DISCARD' },
] },
{ key: 'sourceOrderNo', type: 'input', label: '来源订单号', width: 190, placeholder: '请输入来源订单号' },
{ key: 'containerNo', type: 'input', label: '集装箱号', width: 180, placeholder: '请输入集装箱号' },