fix: 精简财务台账账户视图与旧网银钱包表头 (#1151)

移除动账明细重复账户导航,并增加旧网银钱包专用空表表头。
This commit is contained in:
shanshi 2026-11-13 11:24:11 +08:00
parent f78149e630
commit 31ef152cc9
3 changed files with 74 additions and 5 deletions

View File

@ -799,7 +799,7 @@
<a class="ledger-subtab {{ $accountView === 'bank' ? 'is-active' : '' }}" href="{{ $accountViewUrl('bank') }}" @if ($accountView === 'bank') aria-current="page" @endif>银行账户</a>
<a class="ledger-subtab {{ $accountView === 'non_store' ? 'is-active' : '' }}" href="{{ $accountViewUrl('non_store') }}" @if ($accountView === 'non_store') aria-current="page" @endif>支付宝</a>
<a class="ledger-subtab {{ $accountView === 'wangshang' ? 'is-active' : '' }}" href="{{ $accountViewUrl('wangshang') }}" @if ($accountView === 'wangshang') aria-current="page" @endif>网商银行</a>
<a class="ledger-subtab {{ $accountView === 'wallet' ? 'is-active' : '' }}" href="{{ $accountViewUrl('wallet') }}" @if ($accountView === 'wallet') aria-current="page" @endif>网银账户</a>
<a class="ledger-subtab {{ $accountView === 'wallet' ? 'is-active' : '' }}" href="{{ $accountViewUrl('wallet') }}" @if ($accountView === 'wallet') aria-current="page" @endif>旧网银钱包</a>
<a class="ledger-subtab {{ $accountView === 'other' ? 'is-active' : '' }}" href="{{ $accountViewUrl('other') }}" @if ($accountView === 'other') aria-current="page" @endif>其他账户</a>
</nav>
@endif
@ -987,6 +987,26 @@
</form>
</dialog>
@endif
@if ($standaloneAccountView === 'wallet')
<div class="ledger-table-wrap ledger-accounts-table-wrap">
<table class="ledger-table ledger-wallet-accounts-table" data-ledger-wallet-account-table style="min-width:52rem">
<thead>
<tr>
<th>店铺名称</th>
<th>店铺ID</th>
<th>钱包号</th>
<th>主体公司</th>
<th>提现账户</th>
<th>提现账号</th>
<th>是否保留</th>
</tr>
</thead>
<tbody>
<tr><td colspan="7"><div class="ledger-empty">暂无数据</div></td></tr>
</tbody>
</table>
</div>
@else
<div class="ledger-summary">
<div class="ledger-summary__item"><span>账户数</span><b>{{ number_format((int) ($ledgerAccountSummary['count'] ?? 0)) }}</b></div>
<a class="ledger-summary__item ledger-summary__item--link" href="{{ route('business.financial-ledger.unretained-accounts') }}" aria-label="查看不保留账户处理待办"><span>不保留账户数</span><b>{{ number_format((int) ($ledgerAccountSummary['unretained'] ?? 0)) }}</b></a>
@ -1114,6 +1134,7 @@
'paginationKey' => 'accounts',
'paginationLabel' => ($standaloneAccountView === null ? '账户总表' : $standaloneAccountTitle) . '分页',
])
@endif
</section>
{{-- 店铺台账 --}}
@ -1291,7 +1312,6 @@
{{-- 动账明细 --}}
<section class="ledger-panel" id="ledger-panel-transactions" role="tabpanel" data-ledger-panel="transactions" data-transaction-view="{{ $transactionView }}" data-transaction-view-account="{{ $transactionViewAccount }}" data-transaction-view-independent="{{ $transactionViewIsIndependent ? '1' : '0' }}" data-transaction-account-url-template="{{ route('business.financial-ledger.transactions.account.update', ['id' => '__TRANSACTION__']) }}" data-transaction-statement-update-url-template="{{ route('business.financial-ledger.transactions.statement.update', ['id' => '__TRANSACTION__']) }}" data-transaction-statement-delete-url-template="{{ route('business.financial-ledger.transactions.statement.delete', ['id' => '__TRANSACTION__']) }}" data-transaction-statement-insert-url-template="{{ route('business.financial-ledger.transactions.insert', ['id' => '__TRANSACTION__']) }}" data-transaction-column-storage-key="caiwu.financial-ledger.transactions.widths.v1.{{ auth()->id() }}.{{ company_id() }}" @if ($activeTab !== 'transactions') hidden @endif>
@include('business.pages.financial-ledger.partials.account-home-tabs')
<nav class="ledger-subtabbar" role="tablist" aria-label="动账明细分页">
@foreach ($transactionViews as $viewKey => $view)
@continue($viewKey !== 'all')

View File

@ -3,7 +3,7 @@
<a class="ledger-subtab {{ $activeTab === 'flows' && $flowView === 'bank' ? 'is-active' : '' }}" href="{{ $flowViewUrl('bank') }}" @if ($activeTab === 'flows' && $flowView === 'bank') aria-current="page" @endif>银行账户</a>
<a class="ledger-subtab {{ $activeTab === 'flows' && $flowView === 'non_store' ? 'is-active' : '' }}" href="{{ $flowViewUrl('non_store') }}" @if ($activeTab === 'flows' && $flowView === 'non_store') aria-current="page" @endif>支付宝</a>
<a class="ledger-subtab {{ $activeTab === 'flows' && $flowView === 'wangshang' ? 'is-active' : '' }}" href="{{ $flowViewUrl('wangshang') }}" @if ($activeTab === 'flows' && $flowView === 'wangshang') aria-current="page" @endif>网商银行</a>
<a class="ledger-subtab {{ $activeTab === 'flows' && $flowView === 'wallet' ? 'is-active' : '' }}" href="{{ $flowViewUrl('wallet') }}" @if ($activeTab === 'flows' && $flowView === 'wallet') aria-current="page" @endif>网银账户</a>
<a class="ledger-subtab {{ $activeTab === 'flows' && $flowView === 'wallet' ? 'is-active' : '' }}" href="{{ $flowViewUrl('wallet') }}" @if ($activeTab === 'flows' && $flowView === 'wallet') aria-current="page" @endif>旧网银钱包</a>
@foreach (['zhu-junxiang-alipay', 'zhu-junxiang-wechat'] as $accountViewKey)
@if (isset($transactionViews[$accountViewKey]))
<a class="ledger-subtab {{ $activeTab === 'transactions' && $transactionView === $accountViewKey ? 'is-active' : '' }}" href="{{ $transactionViewUrl($accountViewKey) }}" @if ($activeTab === 'transactions' && $transactionView === $accountViewKey) aria-current="page" @endif>{{ $transactionViews[$accountViewKey]['title'] }}</a>

View File

@ -130,7 +130,7 @@ class FinanceLedgerNavigationTest extends FeatureTestCase
);
preg_match_all('/<a\b[^>]*class="ledger-subtab[^"]*"[^>]*>(.*?)<\/a>/s', $flowTabs[1], $flowTabLabels);
$this->assertSame(
['账户汇总', '银行账户', '支付宝', '网商银行', '网银账户', '朱俊祥支付宝', '朱俊祥微信', '按日流水', '账户基本信息'],
['账户汇总', '银行账户', '支付宝', '网商银行', '旧网银钱包', '朱俊祥支付宝', '朱俊祥微信', '按日流水', '账户基本信息'],
array_map(static fn (string $label): string => trim(html_entity_decode(strip_tags($label))), $flowTabLabels[1] ?? [])
);
$this->assertStringContainsString('flows_view=basic', $flowTabs[1]);
@ -225,12 +225,61 @@ class FinanceLedgerNavigationTest extends FeatureTestCase
$this->assertStringNotContainsString('data-ledger-tab="flows"', $html);
$this->assertStringNotContainsString('aria-label="账户总表账户分类"', $html);
$this->assertStringContainsString('账户基本信息 - ' . $definition['title'], $html);
$this->assertStringContainsString('aria-label="' . $definition['title'] . '分页"', $html);
if ($view === 'wallet') {
$this->assertStringContainsString('data-ledger-wallet-account-table', $html);
} else {
$this->assertStringContainsString('aria-label="' . $definition['title'] . '分页"', $html);
}
$this->assertStringContainsString('action="' . e($url) . '"', $html);
$this->assertStringContainsString('href="' . e($backUrl) . '"', $html);
}
}
public function test_transaction_panel_does_not_repeat_account_navigation(): void
{
$this->loginAs();
$content = $this->get(route('business.pages.show', [
'section' => 'financial-operations',
'page' => 'ledger',
]) . '?tab=transactions')
->assertOk()
->getContent();
$transactionsStart = strpos($content, 'id="ledger-panel-transactions"');
$mappingStart = strpos($content, 'id="ledger-panel-mapping"', $transactionsStart ?: 0);
$this->assertIsInt($transactionsStart);
$this->assertIsInt($mappingStart);
$transactionPanel = substr($content, $transactionsStart, $mappingStart - $transactionsStart);
$this->assertStringNotContainsString('aria-label="账户页面导航"', $transactionPanel);
$this->assertStringContainsString('aria-label="动账明细分页"', $transactionPanel);
$this->assertStringContainsString('全部明细', $transactionPanel);
}
public function test_legacy_wallet_page_uses_empty_custom_headers(): void
{
$this->loginAs();
$content = $this->get(route('business.financial-ledger.account-basic', ['view' => 'wallet']))
->assertOk()
->getContent();
$this->assertSame(
1,
preg_match('/<table\b[^>]*data-ledger-wallet-account-table[^>]*>(.*?)<\/table>/s', $content, $table),
);
preg_match_all('/<th>(.*?)<\/th>/s', $table[1], $headers);
$this->assertSame(
['店铺名称', '店铺ID', '钱包号', '主体公司', '提现账户', '提现账号', '是否保留'],
array_map('trim', $headers[1] ?? []),
);
$this->assertStringContainsString('暂无数据', $table[1]);
$this->assertStringNotContainsString('data-ledger-account-row=', $table[1]);
}
public function test_legacy_independent_company_reconciliation_permission_follows_the_renamed_page(): void
{
$regular = $this->regularAccount();