From b3ab87f22cb2164e056b365bca04c353bd085505 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Tue, 27 Oct 2026 16:55:34 +0800 Subject: [PATCH] style(finance): unify list and detail layouts and receipt controls --- src/modules/finance/financeDensity.css | 30 ++++- .../pages/FinanceCustomerAccountsView.test.ts | 17 +-- .../pages/FinanceCustomerAccountsView.vue | 112 +++++++++--------- .../pages/FinanceCustomerArapView.test.ts | 10 +- .../finance/pages/FinanceCustomerArapView.vue | 43 ++----- .../FinanceCustomerStatementsView.test.ts | 29 ++++- .../pages/FinanceCustomerStatementsView.vue | 80 +++++++------ .../FinanceFormalSettlementLayout.test.ts | 8 +- .../pages/FinanceFormalSettlementPage.vue | 91 +++++++------- .../finance/pages/FinancePresentation.test.ts | 28 ++--- .../FinanceReceivableStatisticsView.test.ts | 3 + .../pages/FinanceReceivableStatisticsView.vue | 40 ++++--- .../overseas-warehouse/pages/PalletsView.vue | 2 +- .../pallets/pages/PalletsView.vue | 2 +- src/shared/components/DataTable.vue | 2 + src/shared/components/FormSection.vue | 2 +- src/styles/adminDensity.test.ts | 104 ++++++++++++++++ 17 files changed, 385 insertions(+), 218 deletions(-) diff --git a/src/modules/finance/financeDensity.css b/src/modules/finance/financeDensity.css index 3e7b4049..1b606a86 100644 --- a/src/modules/finance/financeDensity.css +++ b/src/modules/finance/financeDensity.css @@ -7,7 +7,6 @@ .admin-density .finance-detail-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--admin-space-3); } .admin-density .finance-detail-context { min-width: 0; color: var(--workbench-muted); font-size: var(--admin-font-caption); overflow-wrap: anywhere; } .admin-density .statement-summary-grid .statement-summary-item--remark { grid-column: span 2; } -.admin-density .settlement-summary.density-detail-overview { padding: 0; border: 0; } .admin-density .statement-summary-section { padding: var(--admin-space-5); } .admin-density .account-metrics .is-negative, .admin-density .density-detail-overview .is-danger, @@ -15,3 +14,32 @@ .admin-density .density-detail-overview .is-success, .admin-density-dialog .partial-summary .is-success { color: var(--el-color-success); } .admin-density-dialog .partial-summary { margin-bottom: var(--admin-space-5); } + +/* Outrank AdminPage scoped spacing regardless of stylesheet load order; the toolbar supplies the gap. */ +.admin-workbench.receivable-statistics-page.admin-page.is-spacing-compact, +.admin-workbench.finance-settlement-page.admin-page.is-spacing-compact { gap: 0; } +.admin-workbench .finance-metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--workbench-grid-gap); } +@media (max-width: 720px) { + .admin-workbench .finance-metric-grid { grid-template-columns: 1fr; } +} + +/* The outer AdminPage owns the screen inset for every finance detail section. */ +@media screen { + .admin-density .detail-page-layout.finance-density-detail > :is(.detail-page-layout__header, .detail-page-layout__summary, .detail-page-layout__content, .detail-page-layout__footer), + .admin-density .finance-density-detail > .detail-page-layout__header > .density-detail-header, + .admin-density .finance-density-detail > .detail-page-layout__summary > :is(.density-detail-overview, .statement-summary-section), + .admin-density .finance-density-detail > .detail-page-layout__content > .settlement-detail-content { + padding-inline: 0; + } +} + +/* Detail sections share one vertical rhythm instead of stacking section padding. */ +.admin-density .finance-density-detail > .detail-page-layout__content, +.admin-density .finance-density-detail .settlement-detail-content { + display: flex; + flex-direction: column; + gap: var(--admin-space-5); +} +.admin-density .finance-density-detail > .detail-page-layout__content .density-form-section { + padding-block: 0; +} diff --git a/src/modules/finance/pages/FinanceCustomerAccountsView.test.ts b/src/modules/finance/pages/FinanceCustomerAccountsView.test.ts index daa356e5..123aa5d4 100644 --- a/src/modules/finance/pages/FinanceCustomerAccountsView.test.ts +++ b/src/modules/finance/pages/FinanceCustomerAccountsView.test.ts @@ -65,7 +65,7 @@ describe('FinanceCustomerAccountsView delivery', () => { expect(page).toContain('v-else-if="!detailOpen"') expect(page).toContain('返回客户账户') expect(page).toContain(' { it('keeps term editing aligned with the account summary and nearby actions', () => { for (const marker of ['class="term-section density-form-section"', 'class="term-editor"', '账期天数', '#footer', '保存账期']) expect(page).toContain(marker) - expect(page).toContain('density-detail-overview account-metrics') + expect(page).toContain('account-metrics') for (const column of ['实际余额(CNY)', '冻结金额(CNY)', '总可用余额(CNY)', '授信额度(CNY)', '已用授信(CNY)', '待审核充值']) expect(page).toContain(column) expect(page).toContain('grid-template-columns: 120px minmax(0, 220px)') expect(page).toContain('justify-content: start') expect(page).toContain('class="surface-panel finance-account-detail__surface workbench-panel is-flush is-page-surface"') expect(page).toContain('class="density-detail-header"') expect(page).toContain('padding: var(--admin-space-4) 0') - expect(page).toContain('class="detail-table-scroll workbench-table"') + expect(page).toContain('class="detail-table-scroll workbench-table is-page-surface"') expect(page).toContain('class="ledger-identifier"') expect(page).toContain('class="ledger-document"') - expect(page).toContain('text-overflow: ellipsis') - expect(page).toContain('white-space: nowrap') + expect(page).toContain('overflow-wrap: anywhere') + expect(page).not.toContain('text-overflow: ellipsis') }) it('keeps account detail and term editing readable across the 1920 workspace', () => { @@ -186,7 +186,10 @@ describe('FinanceCustomerAccountsView delivery', () => { await flushPromises() expect(wrapper.text()).toContain('客户A') - expect(wrapper.text()).toContain('C-001') + const profile = wrapper.find('.customer-profile-section') + expect(profile.text()).toContain('客户名称客户A') + expect(profile.text()).not.toContain('客户编号') + expect(profile.text()).not.toContain('C-001') expect(wrapper.text()).toContain('张三') expect(wrapper.text()).toContain('13800000000') const metrics = wrapper.find('.account-metrics') @@ -194,7 +197,7 @@ describe('FinanceCustomerAccountsView delivery', () => { expect(metrics.text()).toContain('实际余额¥126580.50 CNY') expect(metrics.text()).toContain('冻结金额¥8500.00 CNY') expect(metrics.text()).toContain('总可用余额¥138080.50 CNY') - expect(metrics.text()).toContain('授信额度¥20000.00 2028-09-10 到期') + expect(metrics.text()).toContain('授信额度¥20000.00 CNY2028-09-10 到期') expect(metrics.text()).toContain('已用授信¥0.00 CNY') expect(metrics.text()).toContain('可用授信¥20000.00 CNY') for (const auxiliary of ['待开账金额', '本期已收', '总成本', '已付成本', '已收客户款', '客户线下支付']) expect(metrics.text()).not.toContain(auxiliary) diff --git a/src/modules/finance/pages/FinanceCustomerAccountsView.vue b/src/modules/finance/pages/FinanceCustomerAccountsView.vue index 6033a7ee..5216714b 100644 --- a/src/modules/finance/pages/FinanceCustomerAccountsView.vue +++ b/src/modules/finance/pages/FinanceCustomerAccountsView.vue @@ -4,7 +4,7 @@ import '@/styles/adminDensity.css' import '../financeDensity.css' import { computed, onBeforeUnmount, onMounted, reactive, ref, watch } from 'vue' import { useRoute, useRouter } from 'vue-router' -import { ArrowLeft, CreditCard, Download, MinusCircle, PlusCircle, Save } from '@lucide/vue' +import { ArrowLeft, CircleCheck, CreditCard, Download, LockKeyhole, MinusCircle, PlusCircle, Save, Wallet } from '@lucide/vue' import { ElMessage } from 'element-plus' import { useAccessPreviewStore } from '@/core/access/accessPreview' import { createPlatformExportTask } from '@/modules/downloads' @@ -100,13 +100,13 @@ const columns: DataTableColumn[] = [ { key: 'customerCode', label: '客户编号', width: 150, slotName: 'customerCode' }, { key: 'contactName', label: '联系人', width: 130, slotName: 'contactName' }, { key: 'contactPhone', label: '联系电话', width: 150, slotName: 'contactPhone' }, - { key: 'actualBalance', label: '实际余额(CNY)', width: 155, slotName: 'actualBalance' }, - { key: 'frozenBalance', label: '冻结金额(CNY)', width: 150, slotName: 'frozenBalance' }, - { key: 'availableBalance', label: '总可用余额(CNY)', width: 155, slotName: 'availableBalance' }, - { key: 'creditLimit', label: '授信额度(CNY)', width: 155, slotName: 'creditLimit' }, + { key: 'actualBalance', label: '实际余额(CNY)', align: 'right', width: 155, slotName: 'actualBalance' }, + { key: 'frozenBalance', label: '冻结金额(CNY)', align: 'right', width: 150, slotName: 'frozenBalance' }, + { key: 'availableBalance', label: '总可用余额(CNY)', align: 'right', width: 155, slotName: 'availableBalance' }, + { key: 'creditLimit', label: '授信额度(CNY)', align: 'right', width: 155, slotName: 'creditLimit' }, { key: 'creditExpiresOn', label: '授信有效期', width: 140, slotName: 'creditExpiresOn' }, - { key: 'creditUsed', label: '已用授信(CNY)', width: 150, slotName: 'creditUsed' }, - { key: 'pendingRechargeCount', label: '待审核充值', width: 120, slotName: 'pendingRechargeCount' }, + { key: 'creditUsed', label: '已用授信(CNY)', align: 'right', width: 150, slotName: 'creditUsed' }, + { key: 'pendingRechargeCount', label: '待审核充值', align: 'right', width: 120, slotName: 'pendingRechargeCount' }, { key: 'status', label: '客户状态', width: 110, slotName: 'status' }, { key: 'lastChangedAt', label: '最近变动', width: 170, slotName: 'lastChangedAt' }, ] @@ -123,18 +123,18 @@ const ledgerQueryFields: QueryField[] = [ const ledgerColumns: DataTableColumn[] = [ { key: 'actions', label: '操作', width: 90, fixed: 'left', slotName: 'actions' }, { key: 'ledgerId', label: '流水号', width: 180, slotName: 'ledgerId' }, { key: 'occurredAt', label: '发生时间', width: 170, slotName: 'occurredAt' }, { key: 'businessType', label: '业务类型', width: 140, slotName: 'businessType' }, - { key: 'documentNo', label: '关联单据', width: 220, slotName: 'documentNo' }, { key: 'amount', label: '余额变动(CNY)', width: 145, slotName: 'amount' }, + { key: 'documentNo', label: '关联单据', width: 220, slotName: 'documentNo' }, { key: 'amount', label: '余额变动(CNY)', width: 145, align: 'right', slotName: 'amount' }, { key: 'paymentMethod', label: '支付方式', width: 130, slotName: 'ledgerPaymentMethod' }, - { key: 'actualBalanceAfter', label: '变动后实际余额', width: 160, slotName: 'actualBalanceAfter' }, - { key: 'frozenBalanceAfter', label: '变动后冻结金额', width: 160, slotName: 'frozenBalanceAfter' }, - { key: 'availableBalanceAfter', label: '变动后可用余额', width: 160, slotName: 'availableBalanceAfter' }, - { key: 'creditUsedAfter', label: '变动后已用授信', width: 160, slotName: 'creditUsedAfter' }, + { key: 'actualBalanceAfter', label: '变动后实际余额', width: 160, align: 'right', slotName: 'actualBalanceAfter' }, + { key: 'frozenBalanceAfter', label: '变动后冻结金额', width: 160, align: 'right', slotName: 'frozenBalanceAfter' }, + { key: 'availableBalanceAfter', label: '变动后可用余额', width: 160, align: 'right', slotName: 'availableBalanceAfter' }, + { key: 'creditUsedAfter', label: '变动后已用授信', width: 160, align: 'right', slotName: 'creditUsedAfter' }, { key: 'operatorName', label: '操作人', width: 140, slotName: 'operatorName' }, { key: 'remark', label: '备注', minWidth: 180 }, ] const rechargeColumns: DataTableColumn[] = [ - { key: 'actions', label: '操作', width: 150, fixed: 'left', slotName: 'actions' }, + { key: 'actions', label: '操作', width: 90, fixed: 'left', slotName: 'actions' }, { key: 'requestNo', label: '申请单号', minWidth: 190 }, { key: 'createdAt', label: '提交时间', width: 170, slotName: 'createdAt' }, - { key: 'amount', label: '充值金额(CNY)', width: 150, slotName: 'amount' }, + { key: 'amount', label: '充值金额(CNY)', width: 150, align: 'right', slotName: 'amount' }, { key: 'voucherFileName', label: '付款凭证', minWidth: 170, slotName: 'voucherFileName' }, { key: 'submittedByName', label: '提交人', width: 130 }, { key: 'status', label: '状态', width: 110, slotName: 'status' }, { key: 'reviewedByName', label: '审核人', width: 130 }, { key: 'reviewRemark', label: '审核备注', minWidth: 180 }, { key: 'reviewedAt', label: '审核时间', width: 170, slotName: 'reviewedAt' }, @@ -516,18 +516,43 @@ onBeforeUnmount(clearVoucherPreview) - +