fix: 移除账户详情页汇总卡片 (#1208)
This commit is contained in:
parent
81fd0465e4
commit
f5371c24f3
@ -1223,6 +1223,7 @@
|
||||
</table>
|
||||
</div>
|
||||
@else
|
||||
@if ($standaloneAccountView === null)
|
||||
<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>
|
||||
@ -1272,6 +1273,7 @@
|
||||
</footer>
|
||||
</div>
|
||||
</dialog>
|
||||
@endif
|
||||
<div class="ledger-table-wrap ledger-accounts-table-wrap">
|
||||
<table class="ledger-table ledger-accounts-table">
|
||||
<thead>
|
||||
@ -5364,7 +5366,7 @@
|
||||
const currentSummary = accountPanel.querySelector('.ledger-summary');
|
||||
const currentPagination = accountPanel.querySelector('.ledger-pagination');
|
||||
const tableWrap = accountPanel.querySelector('.ledger-accounts-table-wrap');
|
||||
if (!currentBody || !currentSummary || !currentPagination || !tableWrap) {
|
||||
if (!currentBody || !currentPagination || !tableWrap) {
|
||||
window.location.assign(pageUrl.toString());
|
||||
return;
|
||||
}
|
||||
@ -5393,10 +5395,12 @@
|
||||
const nextBody = nextPanel?.querySelector('.ledger-accounts-table tbody');
|
||||
const nextSummary = nextPanel?.querySelector('.ledger-summary');
|
||||
const nextPagination = nextPanel?.querySelector('.ledger-pagination');
|
||||
if (!nextBody || !nextSummary || !nextPagination) throw new Error('分页内容解析失败');
|
||||
if (!nextBody || !nextPagination) throw new Error('分页内容解析失败');
|
||||
|
||||
currentBody.replaceWith(document.importNode(nextBody, true));
|
||||
currentSummary.replaceWith(document.importNode(nextSummary, true));
|
||||
if (currentSummary && nextSummary) {
|
||||
currentSummary.replaceWith(document.importNode(nextSummary, true));
|
||||
}
|
||||
currentPagination.replaceWith(document.importNode(nextPagination, true));
|
||||
if (window.history?.replaceState) {
|
||||
window.history.replaceState({ ...window.history.state, ledgerAccountsAjax: true }, '', pageUrl.toString());
|
||||
|
||||
@ -715,6 +715,41 @@ class FinanceLedgerHeaderControlsTest extends FeatureTestCase
|
||||
$this->assertTrue(str_contains($html, 'zhujunxiang-wechat'));
|
||||
}
|
||||
|
||||
public function test_standalone_account_basic_pages_do_not_render_summary_cards(): void
|
||||
{
|
||||
foreach (['bank', 'non_store', 'wangshang', 'wallet', 'other'] as $view) {
|
||||
$html = $this->loginAs()->get(route('business.financial-ledger.account-basic', [
|
||||
'company_id' => $this->company->id,
|
||||
'view' => $view,
|
||||
]))->assertOk()->getContent();
|
||||
preg_match(
|
||||
'/<section class="ledger-panel" id="ledger-panel-accounts".*?(?=<section class="ledger-panel" id="ledger-panel-shops")/s',
|
||||
$html,
|
||||
$accountPanelMatch,
|
||||
);
|
||||
$accountPanelHtml = $accountPanelMatch[0] ?? '';
|
||||
|
||||
$this->assertNotSame('', $accountPanelHtml, $view);
|
||||
$this->assertFalse(str_contains($accountPanelHtml, '<div class="ledger-summary">'), $view);
|
||||
$this->assertFalse(str_contains($accountPanelHtml, 'data-ledger-available-trigger'), $view);
|
||||
$this->assertTrue(
|
||||
str_contains($accountPanelHtml, 'ledger-accounts-table') || str_contains($accountPanelHtml, 'ledger-wallet-accounts-table'),
|
||||
$view,
|
||||
);
|
||||
}
|
||||
|
||||
$mainHtml = $this->loginAs()->get($this->pageUrl())->assertOk()->getContent();
|
||||
preg_match(
|
||||
'/<section class="ledger-panel" id="ledger-panel-accounts".*?(?=<section class="ledger-panel" id="ledger-panel-shops")/s',
|
||||
$mainHtml,
|
||||
$mainAccountPanelMatch,
|
||||
);
|
||||
$mainAccountPanelHtml = $mainAccountPanelMatch[0] ?? '';
|
||||
$this->assertNotSame('', $mainAccountPanelHtml);
|
||||
$this->assertTrue(str_contains($mainAccountPanelHtml, '<div class="ledger-summary">'));
|
||||
$this->assertTrue(str_contains($mainAccountPanelHtml, 'data-ledger-available-trigger'));
|
||||
}
|
||||
|
||||
public function test_account_directory_bank_affiliation_filter_uses_account_short_suffix(): void
|
||||
{
|
||||
DB::connection('business_mirror')->table('fin_accounts')->insert([
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user