From 4c3d3826334e37e543bb7f5cdf2a51eeafc2fbf1 Mon Sep 17 00:00:00 2001 From: shanshi <3316401569@qq.com> Date: Thu, 12 Nov 2026 19:09:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B0=86=E8=B4=A6=E6=88=B7=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E4=BF=A1=E6=81=AF=E7=A7=BB=E5=85=A5=E8=B4=A6=E6=88=B7?= =?UTF-8?q?=E8=B5=84=E9=87=91=E6=B1=87=E6=80=BB=20(#1141)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将账户基本信息卡片索引迁入账户资金汇总,并移除账户总表中的入口。 --- .../View/FinanceLedgerPageData.php | 27 +++---- .../pages/financial-ledger/ledger.blade.php | 70 ++++++++----------- .../partials/account-home-tabs.blade.php | 8 ++- .../partials/account-type-cards.blade.php | 26 +++++++ .../Business/FinanceLedgerNavigationTest.php | 37 ++++++++-- 5 files changed, 103 insertions(+), 65 deletions(-) create mode 100644 resources/views/business/pages/financial-ledger/partials/account-type-cards.blade.php diff --git a/modules/EcommerceFinance/View/FinanceLedgerPageData.php b/modules/EcommerceFinance/View/FinanceLedgerPageData.php index 6f2ef946..980f952f 100644 --- a/modules/EcommerceFinance/View/FinanceLedgerPageData.php +++ b/modules/EcommerceFinance/View/FinanceLedgerPageData.php @@ -88,11 +88,11 @@ class FinanceLedgerPageData $openingDate = (string) config('finance_ledger.opening_date', '2026-10-17'); $transactionView = $this->transactionView(); $requestedFlowView = trim((string) request('flows_view', 'summary')); - $flowView = in_array($requestedFlowView, ['summary', 'bank', 'non_store', 'wangshang', 'wallet', 'daily'], true) + $flowView = in_array($requestedFlowView, ['summary', 'bank', 'non_store', 'wangshang', 'wallet', 'daily', 'basic'], true) ? $requestedFlowView : 'summary'; $requestedAccountView = trim((string) request('accounts_view', 'all')); - $accountView = in_array($requestedAccountView, ['all', 'basic', 'bank', 'non_store', 'wangshang', 'wallet', 'other'], true) + $accountView = in_array($requestedAccountView, ['all', 'bank', 'non_store', 'wangshang', 'wallet', 'other'], true) ? $requestedAccountView : 'all'; $flowPeriod = $this->dateRange('flows'); @@ -101,21 +101,16 @@ class FinanceLedgerPageData $sourcePeriod = $this->dateRange('sources'); $accountDisplayLabels = $this->accountDisplayLabels(); - $accounts = $accountView === 'basic' - ? [ - 'rows' => collect(), - 'summary' => [ - 'count' => 0, - 'unretained' => 0, - 'current_balance' => 0, - 'balance' => 0, - 'blocked' => 0, - ], - ] - : $this->accounts($accountView, $accountDisplayLabels); + $accounts = $this->accounts($accountView, $accountDisplayLabels); $shops = $this->shops(); $availableBreakdown = $this->availableBreakdown($shops); - $flows = $this->flows($flowPeriod, $flowView, $accountDisplayLabels); + $flows = $flowView === 'basic' + ? [ + 'rows' => collect(), + 'summary' => ['count' => 0, 'opening' => 0, 'inflow' => 0, 'outflow' => 0, 'closing' => 0], + 'custom_fields' => [], + ] + : $this->flows($flowPeriod, $flowView, $accountDisplayLabels); $transactions = $this->transactions($transactionView['account_short'], $transactionPeriod); $transactionViewIsIndependent = (bool) ($transactionView['independent'] ?? false); $transactionViewAccountExists = $transactionViewIsIndependent @@ -132,7 +127,7 @@ class FinanceLedgerPageData 'ledgerAccountView' => $accountView, 'ledgerAccounts' => $accounts['rows'], 'ledgerAccountSummary' => $accounts['summary'], - 'ledgerAccountTypeCards' => $accountView === 'basic' ? $this->accountTypeCards() : [], + 'ledgerAccountTypeCards' => $flowView === 'basic' ? $this->accountTypeCards() : [], 'ledgerShops' => $shops['rows'], 'ledgerShopSummary' => $shops['summary'], 'ledgerShopBalanceDate' => $shops['balance_date'] ?? null, diff --git a/resources/views/business/pages/financial-ledger/ledger.blade.php b/resources/views/business/pages/financial-ledger/ledger.blade.php index 39bbf170..7f77a045 100644 --- a/resources/views/business/pages/financial-ledger/ledger.blade.php +++ b/resources/views/business/pages/financial-ledger/ledger.blade.php @@ -72,6 +72,8 @@ 'accounts_filter_value', 'accounts_sort', 'accounts_direction', + 'flows_view', + 'txns_view', ]) ->filter(static fn ($value): bool => is_scalar($value) || $value === null) ->all(); @@ -92,7 +94,7 @@ $currentMonthEnd = now()->endOfMonth()->toDateString(); $flowPeriod = $ledgerFlowPeriod ?? ['from' => $currentMonthStart, 'to' => $currentMonthEnd]; $flowView = $ledgerFlowView ?? 'summary'; - $flowUsesAccountSummary = $flowView !== 'daily'; + $flowUsesAccountSummary = ! in_array($flowView, ['daily', 'basic'], true); $flowSummaryCustomFields = $ledgerFlowSummaryCustomFields ?? []; $transactionPeriod = $ledgerTransactionPeriod ?? ['from' => $currentMonthStart, 'to' => $currentMonthEnd]; $mappingPeriod = $ledgerMappingPeriod ?? ['from' => $currentMonthStart, 'to' => $currentMonthEnd]; @@ -117,7 +119,15 @@ $transactionDateHeaderOptions = $ledgerTransactionDateHeaderOptions ?? []; $optionMap = static fn (array $values): array => array_combine($values, $values) ?: []; $flowViewQuery = collect(request()->query()) - ->except(['flows_page', 'flows_filter_column', 'flows_filter_value', 'flows_sort', 'flows_direction']) + ->except([ + 'flows_page', + 'flows_filter_column', + 'flows_filter_value', + 'flows_sort', + 'flows_direction', + 'accounts_view', + 'txns_view', + ]) ->filter(static fn ($value): bool => is_scalar($value) || $value === null) ->all(); $flowViewUrl = static fn (string $view): string => $ledgerPageUrl . '?' . http_build_query(array_merge( @@ -125,14 +135,21 @@ ['tab' => 'flows', 'flows_view' => $view], )); $transactionViewQuery = collect(request()->query()) - ->except(['txns_page', 'txns_filter_column', 'txns_filter_value', 'txns_sort', 'txns_direction']) + ->except([ + 'txns_page', + 'txns_filter_column', + 'txns_filter_value', + 'txns_sort', + 'txns_direction', + 'accounts_view', + 'flows_view', + ]) ->filter(static fn ($value): bool => is_scalar($value) || $value === null) ->all(); $transactionViewUrl = static fn (string $view): string => $ledgerPageUrl . '?' . http_build_query(array_merge( $transactionViewQuery, ['tab' => 'transactions', 'txns_view' => $view], )); - $accountBasicViewUrl = $accountViewUrl('basic'); $flowSummaryEditDate = now()->toDateString(); if (($flowPeriod['to'] ?? null) !== null && $flowSummaryEditDate > $flowPeriod['to']) { $flowSummaryEditDate = $flowPeriod['to']; @@ -705,34 +722,6 @@ {{-- 账户总表 --}} {{-- 店铺台账 --}} @@ -1137,6 +1124,7 @@ {{-- 账户资金汇总 --}} {{-- 动账明细 --}} diff --git a/resources/views/business/pages/financial-ledger/partials/account-home-tabs.blade.php b/resources/views/business/pages/financial-ledger/partials/account-home-tabs.blade.php index 3cca9f08..6e15c607 100644 --- a/resources/views/business/pages/financial-ledger/partials/account-home-tabs.blade.php +++ b/resources/views/business/pages/financial-ledger/partials/account-home-tabs.blade.php @@ -10,5 +10,11 @@ @endif @endforeach 按日流水 - 账户基本信息 + 账户基本信息 + @if ($activeTab === 'flows' && $flowUsesAccountSummary && $canEditAccounts) + + + + + @endif diff --git a/resources/views/business/pages/financial-ledger/partials/account-type-cards.blade.php b/resources/views/business/pages/financial-ledger/partials/account-type-cards.blade.php new file mode 100644 index 00000000..68700516 --- /dev/null +++ b/resources/views/business/pages/financial-ledger/partials/account-type-cards.blade.php @@ -0,0 +1,26 @@ +
+
+
+

账户基本信息

+

点击账户类型卡片查看对应账户资料;每种账户只展示自己需要的表头。

+
+ 返回 +
+
+ @foreach ($ledgerAccountTypeCards as $card) + + @endforeach +
+
diff --git a/tests/Feature/Business/FinanceLedgerNavigationTest.php b/tests/Feature/Business/FinanceLedgerNavigationTest.php index f29e9776..12e0ac18 100644 --- a/tests/Feature/Business/FinanceLedgerNavigationTest.php +++ b/tests/Feature/Business/FinanceLedgerNavigationTest.php @@ -131,7 +131,8 @@ class FinanceLedgerNavigationTest extends FeatureTestCase ['账户汇总', '银行账户', '支付宝', '网商银行', '网银账户', '朱俊祥支付宝', '朱俊祥微信', '按日流水', '账户基本信息'], array_map(static fn (string $label): string => trim(html_entity_decode(strip_tags($label))), $flowTabLabels[1] ?? []) ); - $this->assertStringContainsString('accounts_view=basic', $flowTabs[1]); + $this->assertStringContainsString('flows_view=basic', $flowTabs[1]); + $this->assertStringNotContainsString('账户基本信息', preg_match('/