From 9b0aecc50a4111dca686e896811f1e4cf3396a57 Mon Sep 17 00:00:00 2001 From: limeng <1131177064@qq.com> Date: Tue, 15 Sep 2026 13:34:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E8=BF=9B=E9=94=80=E5=AD=98?= =?UTF-8?q?=E4=BB=93=E5=82=A8=E8=B4=B9=E6=B1=87=E6=80=BB=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../third-party-warehouse-storage.blade.php | 39 +------------------ .../ThirdPartyWarehouseStorageViewTest.php | 17 ++++++++ 2 files changed, 19 insertions(+), 37 deletions(-) diff --git a/resources/views/business/pages/courier-payables/third-party-warehouse-storage.blade.php b/resources/views/business/pages/courier-payables/third-party-warehouse-storage.blade.php index d192f2f3..4992a695 100644 --- a/resources/views/business/pages/courier-payables/third-party-warehouse-storage.blade.php +++ b/resources/views/business/pages/courier-payables/third-party-warehouse-storage.blade.php @@ -87,19 +87,6 @@ : (is_countable($rows) ? count($rows) : 0); $summaryReady = ! $pending && collect(['count', 'opening_qty', 'closing_qty']) ->every(static fn (string $key): bool => array_key_exists($key, $summary)); - $settlement = [ - 'ready' => false, 'complete' => false, - 'inbound_fee' => 0, 'outbound_fee' => 0, 'storage_fee' => 0, 'total_fee' => 0, - 'message' => null, - ]; - if ($summaryReady) { - try { - $settlement = app(\Modules\EcommerceFinance\Services\ThirdPartyWarehouseStorageSettlementService::class)->settle($filters); - } catch (\Throwable) { - $settlement['message'] = '仓储费暂时无法核算,请稍后重试。'; - } - } - $settlementComplete = ($settlement['ready'] ?? false) && ($settlement['complete'] ?? false); $showingLastVersion = $rowTotal > 0 && ($error !== '' || in_array($statusCode, [ 'syncing', 'reconciling', 'stale', 'delayed', 'failed', ], true)); @@ -108,7 +95,6 @@ $filters, static fn (mixed $value): bool => $value !== null && $value !== '' ); - $settlementExportUrl = route('business.courier-payables.third-party-warehouse-storage.settlement-export', $activeFilters); if (is_object($rows) && method_exists($rows, 'appends')) { $rows->appends($activeFilters); } @@ -233,7 +219,7 @@ .third-party-warehouse-actions [data-finance-server-export] { display:none; } .third-party-warehouse-page[data-finance-enhanced] .third-party-warehouse-actions [data-finance-server-export] { display:inline-flex; } .third-party-warehouse-page .finance-table-field-picker__panel { right:0; left:auto; } - .third-party-warehouse-summary { display:grid; grid-template-columns:repeat(7,minmax(8rem,1fr)); overflow:hidden; border:1px solid var(--warehouse-border); border-radius:.5rem; background:#fff; } + .third-party-warehouse-summary { display:grid; grid-template-columns:repeat(3,minmax(8rem,1fr)); overflow:hidden; border:1px solid var(--warehouse-border); border-radius:.5rem; background:#fff; } .third-party-warehouse-summary__item { min-width:0; padding:.625rem .75rem; border-right:1px solid var(--warehouse-border); } .third-party-warehouse-summary__item:last-child { border-right:0; } .third-party-warehouse-summary__label { display:block; color:var(--warehouse-muted); font-size:.7rem; } @@ -377,13 +363,6 @@ - $settlementComplete, 'is-disabled' => ! $settlementComplete]) - href="{{ $settlementComplete ? $settlementExportUrl : '#' }}" - @if (! $settlementComplete) aria-disabled="true" @endif - > - 导出仓储费核算 -
- @if (! empty($settlement['message'])) -
- - {{ $settlement['message'] }} -
- @endif -
assertStringContainsString('referrerpolicy="no-referrer"', $source); } + public function test_summary_only_displays_inventory_counts(): void + { + $source = $this->viewSource(); + + $this->assertStringContainsString('grid-template-columns:repeat(3,minmax(8rem,1fr))', $source); + $this->assertStringContainsString("['key' => 'count', 'label' => '明细记录数'", $source); + $this->assertStringContainsString("['key' => 'opening_qty', 'label' => '期初数量合计'", $source); + $this->assertStringContainsString("['key' => 'closing_qty', 'label' => '期末数量合计'", $source); + $this->assertStringNotContainsString("['key' => 'inbound_fee'", $source); + $this->assertStringNotContainsString("['key' => 'outbound_fee'", $source); + $this->assertStringNotContainsString("['key' => 'storage_fee'", $source); + $this->assertStringNotContainsString("['key' => 'total_fee'", $source); + $this->assertStringNotContainsString('ThirdPartyWarehouseStorageSettlementService', $source); + $this->assertStringNotContainsString('导出仓储费核算', $source); + $this->assertStringNotContainsString('仓储费暂时无法核算', $source); + } + private function viewSource(): string { $root = dirname(__DIR__, 3); -- 2.47.2