From 37ebd55045bcf0e88816116e68db82e331030dd9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8B=8F=E6=9C=A8?= <594326199@qq.com>
Date: Tue, 20 Oct 2026 09:47:59 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B4=A7=E6=AC=BE=E5=AF=B9=E8=B4=A6=EF=BC=9A?=
=?UTF-8?q?=E6=AF=8F=E9=A1=B5=E5=9B=BA=E5=AE=9A=E5=B1=95=E7=A4=BA15?=
=?UTF-8?q?=E6=9D=A1=E6=95=B0=E6=8D=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/Http/Controllers/Business/Pages.php | 4 +-
.../partials/final-dataset-table.blade.php | 2 +-
.../SupplierPayableFinalPagesTest.php | 47 +++++++++++++++++++
3 files changed, 50 insertions(+), 3 deletions(-)
diff --git a/app/Http/Controllers/Business/Pages.php b/app/Http/Controllers/Business/Pages.php
index ae5cfbb4..39ac2b4d 100644
--- a/app/Http/Controllers/Business/Pages.php
+++ b/app/Http/Controllers/Business/Pages.php
@@ -2741,8 +2741,8 @@ class Pages extends Controller
}));
}
- // 退货明细较宽,固定每页 15 行,减少纵向滚动并保持横向核对区稳定。
- $perPage = $dataset === 'return-reconciliation' ? 15 : 50;
+ // 货款/退货明细较宽,固定每页 15 行,减少纵向滚动并保持横向核对区稳定。
+ $perPage = in_array($dataset, ['payment-reconciliation', 'return-reconciliation'], true) ? 15 : 50;
$currentPage = max((int) request('page', 1), 1);
return [
diff --git a/resources/views/business/pages/partials/final-dataset-table.blade.php b/resources/views/business/pages/partials/final-dataset-table.blade.php
index 645b3eaf..251736b7 100644
--- a/resources/views/business/pages/partials/final-dataset-table.blade.php
+++ b/resources/views/business/pages/partials/final-dataset-table.blade.php
@@ -119,7 +119,7 @@
上一页
@endif
第 {{ $finalRows?->currentPage() ?? 1 }} 页 / 共 {{ $finalRows?->lastPage() ?? 1 }} 页
- · 每页 {{ $finalRows?->perPage() ?? ($finalDataset === 'return-reconciliation' ? 15 : 50) }} 条
+ · 每页 {{ $finalRows?->perPage() ?? (in_array($finalDataset, ['payment-reconciliation', 'return-reconciliation'], true) ? 15 : 50) }} 条
@if ($finalRows?->hasMorePages())
下一页
@endif
diff --git a/tests/Feature/Business/SupplierPayableFinalPagesTest.php b/tests/Feature/Business/SupplierPayableFinalPagesTest.php
index 14285d09..e7a2ab01 100644
--- a/tests/Feature/Business/SupplierPayableFinalPagesTest.php
+++ b/tests/Feature/Business/SupplierPayableFinalPagesTest.php
@@ -248,6 +248,53 @@ class SupplierPayableFinalPagesTest extends FeatureTestCase
->assertDontSeeText('RC-01');
}
+ public function test_final_payment_reconciliation_page_paginates_fifteen_rows(): void
+ {
+ $records = [];
+ for ($index = 1; $index <= 20; $index++) {
+ $records[sprintf('payment:%02d', $index)] = [
+ 'summary_month' => '2026-09',
+ 'stockNo' => sprintf('RK-%02d', $index),
+ 'purchaseNo' => sprintf('CG-%02d', $index),
+ 'date' => '2026-09-30',
+ 'supplier' => '货款供应商',
+ 'skuCode' => sprintf('PM-%02d', $index),
+ 'productCode' => sprintf('P-%02d', $index),
+ 'skuName' => '货款商品',
+ 'qty' => '1',
+ 'unitPrice' => '10',
+ 'amount' => '10',
+ ];
+ }
+ app(SupplierPayableOverrideStore::class)->saveBatch(
+ 'final:supplier:payment-reconciliation',
+ $records,
+ (int) $this->company->id,
+ (int) $this->user->id,
+ );
+
+ $baseUrl = route('business.pages.show', [
+ 'company_id' => (int) $this->company->id,
+ 'section' => 'supplier-payables-final',
+ 'page' => 'payment-reconciliation',
+ ]);
+ $url = fn (int $page): string => $baseUrl . '?page=' . $page;
+
+ $this->loginAs()->get($url(1))
+ ->assertOk()
+ ->assertSeeText('每页 15 条')
+ ->assertSeeText('第 1 页 / 共 2 页')
+ ->assertSeeText('PM-01')
+ ->assertDontSeeText('PM-16');
+
+ $this->loginAs()->get($url(2))
+ ->assertOk()
+ ->assertSeeText('第 2 页 / 共 2 页')
+ ->assertSeeText('PM-16')
+ ->assertSeeText('PM-20')
+ ->assertDontSeeText('PM-01');
+ }
+
public function test_final_import_reads_files_larger_than_one_chunk(): void
{
$lines = ['月份,入库单号,采购单号,日期,供应商,货号,商品编码,规格名称,数量,单价,金额,预估单价,预估金额,供应商商品编码,备注,仓库名称,快递名称,快递单号,未发出,对账人'];
--
2.47.2