From 288b2ae95ba8cc547a136f0476fa0f4e982acd35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E6=9C=A8?= <594326199@qq.com> Date: Tue, 1 Dec 2026 09:16:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BE=9B=E5=BA=94=E5=95=86=E8=B4=9F?= =?UTF-8?q?=E6=95=B0=E9=A2=84=E8=AD=A6)=EF=BC=9A=E7=B2=BE=E7=AE=80?= =?UTF-8?q?=E4=BB=98=E6=AC=BE=E5=88=97=E5=B9=B6=E5=8E=8B=E7=BC=A9=E5=A4=87?= =?UTF-8?q?=E6=B3=A8=E5=AE=BD=E5=BA=A6=20(#1592)=20Co-authored-by:=20?= =?UTF-8?q?=E8=8B=8F=E6=9C=A8=20<594326199@qq.com>=20Co-committed-by:=20?= =?UTF-8?q?=E8=8B=8F=E6=9C=A8=20<594326199@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supplier-negative-alert.blade.php | 19 +++++++++++- .../Business/NegativeAlertPagesTest.php | 31 +++++++++++++++++-- 2 files changed, 47 insertions(+), 3 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 1b9ec627..3f0f1a93 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 @@ -3,7 +3,11 @@ $fields = $negativeAlertFields ?? []; $visibleFields = array_values(array_filter( $fields, - static fn (array $field): bool => ($field['name'] ?? '') !== 'company', + static fn (array $field): bool => ! in_array( + $field['name'] ?? '', + ['company', 'to_corporate', 'to_private', 'cashier_paid', 'private_reason'], + true, + ), )); $months = $negativeAlertMonths ?? []; $month = $negativeAlertMonth ?? ''; @@ -506,6 +510,17 @@ color: var(--sna-danger); } + .supplier-negative-alert-data-page .sna-remarks-cell { + display: -webkit-box; + width: 14rem; + max-width: 14rem; + overflow: hidden; + white-space: normal; + overflow-wrap: anywhere; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + } + .supplier-negative-alert-data-page .sna-workflow-feedback { margin: 0; padding: 10px 12px; @@ -863,6 +878,8 @@ 修改后失焦自动保存 + @elseif ($field['name'] === 'remarks' && $value !== null && $value !== '') + {{ $value }} @elseif ($field['name'] === 'handling_result')
@if ($value !== null && $value !== '') diff --git a/tests/Feature/Business/NegativeAlertPagesTest.php b/tests/Feature/Business/NegativeAlertPagesTest.php index 9cb42a58..99f8adda 100644 --- a/tests/Feature/Business/NegativeAlertPagesTest.php +++ b/tests/Feature/Business/NegativeAlertPagesTest.php @@ -198,8 +198,8 @@ class NegativeAlertPagesTest extends FeatureTestCase ); $html = (string) $response->getContent(); preg_match_all('/)/', $html, $headers); - // 序号 + 隐藏主体名称后的原字段 + 最晚出账单时间 + 动态匹配的采购 + 处理结果。 - $this->assertCount(count($fields) + 3, $headers[0]); + // 序号 + 业务字段(隐藏主体及4个付款列)+ 最晚出账单时间 + 采购 + 处理结果。 + $this->assertCount(count($fields) - 1, $headers[0]); preg_match_all('/]*>(.*?)<\/th>/s', $html, $headerMatches); $labels = array_map( static fn (string $label): string => trim(html_entity_decode(strip_tags($label), ENT_QUOTES | ENT_HTML5, 'UTF-8')), @@ -543,6 +543,33 @@ class NegativeAlertPagesTest extends FeatureTestCase ->assertDontSeeText('九月负余额供应商'); } + public function test_supplier_negative_alert_hides_payment_columns_and_compacts_remarks(): void + { + $this->saveSupplierPayable('layout:1', '列布局供应商', '-88.00', '2026-10', [ + 'remarks' => "第一行备注\n第二行备注", + 'to_corporate' => '11.00', + 'to_private' => '22.00', + 'cashier_paid' => '33.00', + 'private_reason' => '不应展示', + ]); + + $this->loginAs() + ->get(route('business.pages.show', [ + 'section' => 'negative-alerts', + 'page' => 'supplier-negative-alert', + 'tab' => 'alert', + 'month' => '2026-10', + ])) + ->assertOk() + ->assertDontSeeText('对公打款金额') + ->assertDontSeeText('对私打款金额') + ->assertDontSeeText('已销账金额') + ->assertDontSeeText('对私原因') + ->assertSee('class="sna-remarks-cell"', false) + ->assertSee('title="第一行备注', false) + ->assertSee('-webkit-line-clamp: 2', false); + } + public function test_supplier_negative_alert_filters_by_checker_settlement_and_purchaser(): void { $this->saveSupplierPayable('filter:target', '目标供应商', '-50.00', '2026-09', [