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) -($field['type'] ?? '') === 'number'])> + | 序号 | + @foreach ($visibleFields as $field) +($field['type'] ?? '') === 'number']) + > {{ $field['label'] }} | @endforeach @@ -369,8 +438,8 @@|||
|---|---|---|---|---|---|---|
| {{ ($rows->firstItem() ?? 1) + $index }} | - @foreach ($fields as $field) +{{ ($rows->firstItem() ?? 1) + $index }} | + @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 -$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', [ |