供应商对账:退货表格改为十条并固定表头

This commit is contained in:
苏木 2026-10-20 11:20:51 +08:00
parent 5e05a8728e
commit aa9e3e8cb7
4 changed files with 19 additions and 5 deletions

View File

@ -20,6 +20,9 @@ class SupplierReconciliationPageData
/** 厂家上传的对账数据表:每页行数(短表 + 翻页)。 */
private const PER_PAGE = 15;
/** 退货明细行较高:每页 10 行,并在页面内固定表头滚动查看。 */
private const RETURN_PER_PAGE = 10;
public function __construct(
private readonly SupplierPayableOverrideStore $store,
private readonly SupplierStatementStore $statements,
@ -377,8 +380,8 @@ class SupplierReconciliationPageData
$rows[] = ['_key' => $key, 'status' => $status, 'deduction' => $deduction] + $row;
}
// 全部退货行按导入顺序分页展示(每页 15 行),不做金额排序。
$perPage = self::PER_PAGE;
// 全部退货行按导入顺序分页展示(每页 10 行),不做金额排序。
$perPage = self::RETURN_PER_PAGE;
$pages = max((int) ceil(count($rows) / $perPage), 1);
$page = min(max((int) request()->query($pageQueryKey, 1), 1), $pages);

View File

@ -45,6 +45,8 @@
.supplier-reconciliation-page .sr-return-stat strong small { margin-left: 3px; color: var(--vip-content-muted, #595959); font-size: .75rem; font-weight: 500; }
.supplier-reconciliation-page .sr-return-stat em { color: var(--vip-content-muted, #595959); font-size: .8125rem; font-style: normal; font-variant-numeric: tabular-nums; }
.supplier-reconciliation-page .sr-return-table { min-width: 1420px; }
.supplier-reconciliation-page .sr-return-scroll { max-height: min(62vh, 560px); overflow: auto; scrollbar-gutter: stable; }
.supplier-reconciliation-page .sr-return-scroll thead th { position: sticky; top: 0; z-index: 4; box-shadow: 0 1px 0 var(--vip-border, #D8D2C7); }
.supplier-reconciliation-page .sr-filter { display: grid; grid-template-columns: minmax(220px, 1.6fr) repeat(2, minmax(135px, .8fr)) minmax(150px, 1fr) minmax(125px, .75fr); gap: 10px 12px; align-items: end; padding: 12px; border: 1px solid #EFEAE0; border-radius: 8px; background: #FCFAF5; }
.supplier-reconciliation-page .sr-filter-actions { display: flex; flex-wrap: wrap; gap: 8px; grid-column: 1 / -1; }
.supplier-reconciliation-page .sr-date-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; grid-column: 1 / -1; margin-top: -2px; }
@ -316,7 +318,7 @@
</a>
</div>
</form>
<div class="sr-scroll">
<div class="sr-scroll sr-return-scroll">
<table class="sr-return-table">
<thead>
<tr>

View File

@ -43,6 +43,8 @@
.supplier-portal-page .sp-return-stat strong small { margin-left: 3px; color: var(--vip-content-muted, #595959); font-size: .75rem; font-weight: 500; }
.supplier-portal-page .sp-return-stat em { color: var(--vip-content-muted, #595959); font-size: .8125rem; font-style: normal; font-variant-numeric: tabular-nums; }
.supplier-portal-page .sp-return-table { min-width: 1420px; }
.supplier-portal-page .sp-return-scroll { max-height: min(62vh, 560px); overflow: auto; scrollbar-gutter: stable; }
.supplier-portal-page .sp-return-scroll thead th { position: sticky; top: 0; z-index: 4; box-shadow: 0 1px 0 var(--vip-border, #D8D2C7); }
.supplier-portal-page .sp-filter { display: grid; grid-template-columns: minmax(220px, 1.6fr) repeat(2, minmax(135px, .8fr)) minmax(150px, 1fr) minmax(125px, .75fr); gap: 10px 12px; align-items: end; padding: 12px; border: 1px solid #EFEAE0; border-radius: 8px; background: #FCFAF5; }
.supplier-portal-page .sp-filter-actions { display: flex; flex-wrap: wrap; gap: 8px; grid-column: 1 / -1; }
.supplier-portal-page .sp-date-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; grid-column: 1 / -1; margin-top: -2px; }
@ -202,7 +204,7 @@
</div>
</form>
<div class="sp-scroll">
<div class="sp-scroll sp-return-scroll">
<table class="sp-return-table">
<thead>
<tr>

View File

@ -142,6 +142,8 @@ class SupplierReconciliationTest extends FeatureTestCase
->assertSeeText('查询')
->assertSeeText('导出当前筛选结果');
$response->assertSee('sr-return-scroll', false);
$html = (string) $response->getContent();
$tableStart = strpos($html, '<table class="sr-return-table">');
$tableEnd = $tableStart === false ? false : strpos($html, '</table>', $tableStart);
@ -238,6 +240,7 @@ class SupplierReconciliationTest extends FeatureTestCase
->assertDontSeeText('OTHER-SUPPLIER-RETURN')
->assertDontSeeText('鸣飞家具')
->assertDontSee('supplier-name-options', false)
->assertSee('sp-return-scroll', false)
->assertSee('id="portal-return-date-from"', false)
->assertSee('data-return-date-range="last-month"', false)
->assertDontSeeText('预估单价');
@ -469,15 +472,19 @@ class SupplierReconciliationTest extends FeatureTestCase
$this->loginAs()->get($pageUrl(1))
->assertOk()
->assertSeeText('每页 15 行')
->assertSeeText('每页 10 行')
->assertSeeText('第 1 / 2 页')
->assertSeeText('RT-01')
->assertSeeText('RT-10')
->assertDontSeeText('RT-11')
->assertDontSeeText('RT-20');
$this->loginAs()->get($pageUrl(2))
->assertOk()
->assertSeeText('第 2 / 2 页')
->assertSeeText('RT-11')
->assertSeeText('RT-20')
->assertDontSeeText('RT-10')
->assertDontSeeText('RT-01');
}