feat(t241): improve freight admin views

This commit is contained in:
QiuSW
2026-07-29 15:34:51 +08:00
parent 8b0752dc53
commit 7e3aaac982
14 changed files with 451 additions and 105 deletions
@@ -25,17 +25,20 @@
<div><dt>采购状态</dt><dd>{{if .Detail.Order.PurchaseStatus}}{{.Detail.Order.PurchaseStatus}}{{else}}未提供{{end}}</dd></div>
</dl>
</section>
<section class="table-region" aria-labelledby="freight-items-title">
<h2 id="freight-items-title">商品明细</h2>
<section class="table-region freight-region" aria-labelledby="freight-items-title">
<div class="freight-table-heading">
<h2 id="freight-items-title">商品明细</h2>
<span class="secondary">共 {{.Detail.Order.ItemCount}} 项</span>
</div>
{{if .Detail.Items}}
<table>
<table class="freight-table freight-items-table">
<thead>
<tr>
<th scope="col">商品</th>
<th scope="col">规格 / SKU</th>
<th scope="col">数量</th>
<th scope="col">采购状态</th>
<th scope="col">来源版本</th>
<th scope="col">ERP 原始单价</th>
<th scope="col">货运状态</th>
<th scope="col">采购处理</th>
</tr>
</thead>
@@ -43,17 +46,32 @@
{{range .Detail.Items}}
<tr>
<td data-label="商品">
<strong>{{if .Item.Title}}{{.Item.Title}}{{else}}缺少标题{{end}}</strong>
<span class="secondary">明细 ID:{{.Item.ExternalItemID}}</span>
{{if .Item.ProductThumbRef}}<span class="secondary">图片引用:{{.Item.ProductThumbRef}}</span>{{end}}
<div class="freight-media freight-item-media">
{{if .Item.ImageURL}}
<img class="freight-thumb freight-thumb-detail" src="{{.Item.ImageURL}}"
width="84" height="84" loading="lazy" decoding="async"
alt="{{if .Item.Title}}{{.Item.Title}}{{else}}货运商品{{end}}图片">
{{else}}
<span class="freight-thumb freight-thumb-detail freight-thumb-placeholder"
aria-label="{{imageStatusLabel .Item.ImageStatus}}">
{{imageStatusLabel .Item.ImageStatus}}
</span>
{{end}}
<span class="freight-media-copy">
<strong class="freight-product-title">{{if .Item.Title}}{{.Item.Title}}{{else}}缺少标题{{end}}</strong>
<span class="secondary">明细 ID:{{.Item.ExternalItemID}}</span>
</span>
</div>
</td>
<td data-label="规格 / SKU">
<span>{{if .Item.ProductSpec}}{{.Item.ProductSpec}}{{else}}未提供规格{{end}}</span>
<span class="secondary">SKU:{{if .Item.SKU}}{{.Item.SKU}}{{else}}未提供{{end}}</span>
<strong>{{if .Item.ProductSpec}}{{.Item.ProductSpec}}{{else}}未提供{{end}}</strong>
</td>
<td data-label="数量"><span class="freight-number">{{if .Item.Quantity}}{{.Item.Quantity}}{{else}}未提供{{end}}</span></td>
<td data-label="ERP 原始单价"><span class="freight-money">{{formatMoney .Item.OriginalUnitPriceMinor .Item.OriginalCurrency}}</span></td>
<td data-label="货运状态">
<span>{{if .Item.PurchaseStatus}}{{.Item.PurchaseStatus}}{{else}}未提供{{end}}</span>
<span class="secondary">来源版本 {{.Item.Revision}}</span>
</td>
<td data-label="数量">{{if .Item.Quantity}}{{.Item.Quantity}}{{else}}未提供{{end}}</td>
<td data-label="采购状态">{{if .Item.PurchaseStatus}}{{.Item.PurchaseStatus}}{{else}}未提供{{end}}</td>
<td data-label="来源版本">{{.Item.Revision}}</td>
<td data-label="采购处理" class="procurement-actions">
{{if .Request}}
<strong>{{.Request.StatusLabel}}</strong>