From 7d624d1a52a1644c99b5bfc4d9fe02c5661370b9 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:32:51 +0800
Subject: [PATCH] =?UTF-8?q?=E9=80=80=E8=B4=A7=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 | 3 +-
.../partials/final-dataset-table.blade.php | 1 +
.../SupplierPayableFinalPagesTest.php | 45 +++++++++++++++++++
3 files changed, 48 insertions(+), 1 deletion(-)
diff --git a/app/Http/Controllers/Business/Pages.php b/app/Http/Controllers/Business/Pages.php
index 8ff64855..ae5cfbb4 100644
--- a/app/Http/Controllers/Business/Pages.php
+++ b/app/Http/Controllers/Business/Pages.php
@@ -2741,7 +2741,8 @@ class Pages extends Controller
}));
}
- $perPage = 50;
+ // 退货明细较宽,固定每页 15 行,减少纵向滚动并保持横向核对区稳定。
+ $perPage = $dataset === 'return-reconciliation' ? 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 781ec6aa..645b3eaf 100644
--- a/resources/views/business/pages/partials/final-dataset-table.blade.php
+++ b/resources/views/business/pages/partials/final-dataset-table.blade.php
@@ -119,6 +119,7 @@
上一页
@endif
第 {{ $finalRows?->currentPage() ?? 1 }} 页 / 共 {{ $finalRows?->lastPage() ?? 1 }} 页
+ · 每页 {{ $finalRows?->perPage() ?? ($finalDataset === 'return-reconciliation' ? 15 : 50) }} 条
@if ($finalRows?->hasMorePages())
下一页
@endif
diff --git a/tests/Feature/Business/SupplierPayableFinalPagesTest.php b/tests/Feature/Business/SupplierPayableFinalPagesTest.php
index 8202ccd5..14285d09 100644
--- a/tests/Feature/Business/SupplierPayableFinalPagesTest.php
+++ b/tests/Feature/Business/SupplierPayableFinalPagesTest.php
@@ -8,6 +8,7 @@ use Illuminate\Support\Facades\DB;
use Illuminate\Validation\ValidationException;
use Modules\EcommerceFinance\Services\PayablesFinalImporter;
use Modules\EcommerceFinance\Services\PayablesFinalRegistry;
+use Modules\EcommerceFinance\Services\SupplierPayableOverrideStore;
use Tests\Feature\FeatureTestCase;
class SupplierPayableFinalPagesTest extends FeatureTestCase
@@ -203,6 +204,50 @@ class SupplierPayableFinalPagesTest extends FeatureTestCase
$this->assertStringNotContainsString('快递名称', $export->streamedContent());
}
+ public function test_final_return_reconciliation_page_paginates_fifteen_rows(): void
+ {
+ $records = [];
+ for ($index = 1; $index <= 20; $index++) {
+ $records[sprintf('return:%02d', $index)] = [
+ 'summary_month' => '2026-09',
+ 'send_time' => '2026-09-30',
+ 'supplier' => '退货供应商',
+ 'barcode' => sprintf('RC-%02d', $index),
+ 'sku_name' => '退货商品',
+ 'qty' => '1',
+ 'unit_price' => '10',
+ 'amount' => '10',
+ ];
+ }
+ app(SupplierPayableOverrideStore::class)->saveBatch(
+ 'final:supplier:return-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' => 'return-reconciliation',
+ ]);
+ $url = fn (int $page): string => $baseUrl . '?page=' . $page;
+
+ $this->loginAs()->get($url(1))
+ ->assertOk()
+ ->assertSeeText('每页 15 条')
+ ->assertSeeText('第 1 页 / 共 2 页')
+ ->assertSeeText('RC-01')
+ ->assertDontSeeText('RC-16');
+
+ $this->loginAs()->get($url(2))
+ ->assertOk()
+ ->assertSeeText('第 2 页 / 共 2 页')
+ ->assertSeeText('RC-16')
+ ->assertSeeText('RC-20')
+ ->assertDontSeeText('RC-01');
+ }
+
public function test_final_import_reads_files_larger_than_one_chunk(): void
{
$lines = ['月份,入库单号,采购单号,日期,供应商,货号,商品编码,规格名称,数量,单价,金额,预估单价,预估金额,供应商商品编码,备注,仓库名称,快递名称,快递单号,未发出,对账人'];
--
2.47.2