From c8e24f5866b6f7e51c2d644d2f67429e4382aadc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E6=9C=A8?= <594326199@qq.com> Date: Wed, 28 Oct 2026 14:21:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=86=BB=E7=BB=93=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E8=B4=9F=E6=95=B0=E9=A2=84=E8=AD=A6=E5=85=B3=E9=94=AE?= =?UTF-8?q?=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 隐藏公司主体名称并冻结供应商简称及之前的列。 Co-authored-by: 苏木 <594326199@qq.com> Co-committed-by: 苏木 <594326199@qq.com> --- .../supplier-negative-alert.blade.php | 92 +++++++++++++++++-- .../Business/NegativeAlertPagesTest.php | 13 ++- 2 files changed, 94 insertions(+), 11 deletions(-) diff --git a/resources/views/business/pages/negative-alerts/supplier-negative-alert.blade.php b/resources/views/business/pages/negative-alerts/supplier-negative-alert.blade.php index 3ea65d91..dfbdacb8 100644 --- a/resources/views/business/pages/negative-alerts/supplier-negative-alert.blade.php +++ b/resources/views/business/pages/negative-alerts/supplier-negative-alert.blade.php @@ -1,6 +1,10 @@ @php $rows = $negativeAlertRows ?? null; $fields = $negativeAlertFields ?? []; + $visibleFields = array_values(array_filter( + $fields, + static fn (array $field): bool => ($field['name'] ?? '') !== 'company', + )); $months = $negativeAlertMonths ?? []; $month = $negativeAlertMonth ?? ''; $supplierQuery = $negativeAlertSupplier ?? ''; @@ -176,6 +180,7 @@ max-height: min(62vh, 620px); overflow: auto; scrollbar-gutter: stable; + position: relative; } .supplier-negative-alert-data-page table { @@ -199,6 +204,61 @@ white-space: nowrap; } + .supplier-negative-alert-data-page th[data-fixed-column], + .supplier-negative-alert-data-page td[data-fixed-column] { + position: sticky; + z-index: 3; + overflow: hidden; + background: var(--vip-surface, #FFFFFF); + text-overflow: ellipsis; + } + + .supplier-negative-alert-data-page th[data-fixed-column] { + z-index: 5; + background: var(--vip-content-accent-soft, #F7F0DE); + } + + .supplier-negative-alert-data-page th[data-fixed-column="index"], + .supplier-negative-alert-data-page td[data-fixed-column="index"] { + left: 0; + width: 52px; + min-width: 52px; + max-width: 52px; + } + + .supplier-negative-alert-data-page th[data-fixed-column="summary_month"], + .supplier-negative-alert-data-page td[data-fixed-column="summary_month"] { + left: 52px; + width: 88px; + min-width: 88px; + max-width: 88px; + } + + .supplier-negative-alert-data-page th[data-fixed-column="checker"], + .supplier-negative-alert-data-page td[data-fixed-column="checker"] { + left: 140px; + width: 90px; + min-width: 90px; + max-width: 90px; + } + + .supplier-negative-alert-data-page th[data-fixed-column="settlement_method"], + .supplier-negative-alert-data-page td[data-fixed-column="settlement_method"] { + left: 230px; + width: 180px; + min-width: 180px; + max-width: 180px; + } + + .supplier-negative-alert-data-page th[data-fixed-column="supplier"], + .supplier-negative-alert-data-page td[data-fixed-column="supplier"] { + left: 410px; + width: 130px; + min-width: 130px; + max-width: 130px; + box-shadow: 2px 0 4px rgba(23, 23, 23, 0.08); + } + .supplier-negative-alert-data-page td { padding: 10px 12px; border-bottom: 1px solid #EFEAE0; @@ -210,6 +270,10 @@ background: #FFFDF7; } + .supplier-negative-alert-data-page tbody tr:hover td[data-fixed-column] { + background: #FFFDF7; + } + .supplier-negative-alert-data-page td.is-number { font-variant-numeric: tabular-nums; text-align: right; @@ -358,9 +422,14 @@ - - @foreach ($fields as $field) - + @foreach ($visibleFields as $field) + @endforeach @@ -369,8 +438,8 @@ @foreach ($rows as $index => $row) - - @foreach ($fields as $field) + + @foreach ($visibleFields as $field) @php $value = $row->{$field['name']} ?? null; $isNumber = ($field['type'] ?? '') === 'number'; @@ -378,10 +447,15 @@ && is_numeric($value) && (float) $value < 0; @endphp -
序号 ($field['type'] ?? '') === 'number'])> + 序号 ($field['type'] ?? '') === 'number']) + > {{ $field['label'] }}
{{ ($rows->firstItem() ?? 1) + $index }}{{ ($rows->firstItem() ?? 1) + $index }} $isNumber, - 'is-negative' => $isNegativeBalance, - ])> + $isNumber, + 'is-negative' => $isNegativeBalance, + ]) + > @if ($value === null || $value === '') - @elseif ($isNumber && is_numeric($value)) diff --git a/tests/Feature/Business/NegativeAlertPagesTest.php b/tests/Feature/Business/NegativeAlertPagesTest.php index 9e8d2adf..7c38dbf7 100644 --- a/tests/Feature/Business/NegativeAlertPagesTest.php +++ b/tests/Feature/Business/NegativeAlertPagesTest.php @@ -79,8 +79,17 @@ class NegativeAlertPagesTest extends FeatureTestCase PayablesFinalRegistry::SECTION_SUPPLIER, 'supplier-payables-report', ); - preg_match_all('/)/', (string) $response->getContent(), $headers); - $this->assertCount(count($fields) + 1, $headers[0]); + $html = (string) $response->getContent(); + preg_match_all('/)/', $html, $headers); + $this->assertCount(count($fields), $headers[0]); + $this->assertStringNotContainsString('供应商公司主体名称', $html); + $this->assertStringNotContainsString('测试供应商有限公司', $html); + + preg_match_all('/]*data-fixed-column="([^"]+)"/', $html, $fixedHeaders); + $this->assertSame( + ['index', 'summary_month', 'checker', 'settlement_method', 'supplier'], + $fixedHeaders[1], + ); $this->loginAs() ->get(route('business.pages.show', [