贴标优化0923

This commit is contained in:
2026-09-23 11:25:35 +08:00
parent 25db3c1777
commit bc5c56d0e4
4 changed files with 260 additions and 39 deletions
@@ -40,6 +40,17 @@ test('仓储转运支持无目的地、FBA 仓和私人仓并显式选择是否
assert.doesNotMatch(view, /relabelChargeAmount:/)
})
test('换标详情待客户确认时提供确认入口并刷新详情', () => {
assert.match(view, /application\.status === 'CUSTOMER_CONFIRM_PENDING'[\s\S]*@click="confirmSelectedRelabel">确认换标完成/)
assert.match(view, /async function confirmSelectedRelabel\(\)[\s\S]*await confirmRelabelCompletion\(relabelNo\)[\s\S]*await openDetail\(\{ '0': relabelNo \}\)/)
})
test('仓储转运换标绑定明细自动同步只读的旧 SKU', () => {
assert.match(view, /watch\(\(\) => cargoRows\.value\.map\(\(row\) => row\.sku\)/)
assert.match(view, /if \(sourceSku\) row\.sku = sourceSku/)
assert.match(view, /transferRelabelRows\.value\.push\(\{ \.\.\.createCargoRow\(\), sku: source\?\.sku \|\| '' \}\)/)
})
test('仓储转运换标整票只允许一个目的仓', () => {
assert.match(view, /props\.service === 'transfer' && transferDestinationType === 'FBA'[^\n]+FBA 目的仓/)
assert.match(view, /FBA 货件编号<\/span><el-input v-model="form\.fbaShipmentNo" placeholder="选填,可后续补充"/)
@@ -120,6 +131,8 @@ test('仓储转运需要换标时上传总文件并挂到关联换标单', () =>
assert.match(view, /uploadRelabelFile\(relabelNo, 'CARTON_TOTAL', cartonTotalFile\.value\)/)
assert.match(view, /uploadRelabelFile\(relabelNo, 'SKU_TOTAL', skuTotalFile\.value\)/)
assert.match(view, /转运单已提交,附件待补传/)
assert.match(transferRelabelSection, /native-type="button"[^>]+chooseCreateTotalFile\('CARTON_TOTAL'\)/)
assert.match(transferRelabelSection, /native-type="button"[^>]+chooseCreateTotalFile\('SKU_TOTAL'\)/)
})
test('仓储转运换标总文件与明细模板在桌面端左右排列', () => {
@@ -155,13 +168,17 @@ test('仓储转运列表操作仓使用海外仓接口数据', () => {
assert.doesNotMatch(view, /美西洛杉矶仓/)
})
test('仓储转运预计发货时间可选并只读展示实际发货时间', () => {
assert.match(view, /预计发货时间/)
test('仓储转运期望发货时间可选并在订单概览回填发货时间', () => {
assert.doesNotMatch(view, /预计发货时间/)
assert.match(view, /期望发货时间/)
assert.match(view, /v-model="form\.estimatedShipAt"/)
assert.match(view, /v-model="form\.estimatedShipAt"[^>]+placeholder="选填"/)
assert.doesNotMatch(view, /!form\.estimatedShipAt && '预计发货时间'/)
assert.doesNotMatch(view, /!form\.estimatedShipAt/)
assert.match(view, /estimatedShipAt: form\.estimatedShipAt/)
assert.match(view, /实际发货时间由仓库出库或 PDA 完成后回填/)
assert.match(view, /<span>期望发货时间<\/span><strong>\{\{ formatDateTime\(selectedDetail\?\.estimatedShipAt\) \}\}<\/strong>/)
assert.match(view, /<span>实际发货时间<\/span><strong>\{\{ formatDateTime\(selectedDetail\?\.actualShipAt\) \}\}<\/strong>/)
assert.doesNotMatch(view, /class="warehouse-card warehouse-form-section warehouse-transfer-times"/)
assert.match(view, /estimatedArrivalAt: detail\.estimatedArrivalAt \|\| '', estimatedShipAt: detail\.estimatedShipAt \|\| ''/)
assert.match(api, /estimatedShipAt\?: string/)
})
@@ -176,6 +193,66 @@ test('客户仓储转运展示每个实际流转状态的中文名称', () => {
assert.match(view, /OUTBOUNDED: '已出库'/)
})
test('仓储转运列表展示换标单号、换标状态并为两类状态着色', () => {
const transferConfig = view.match(/transfer:\s*\{[^\n]+/)?.[0] || ''
assert.match(transferConfig, /'是否换标', '换标单号', '换标状态', '状态'/)
assert.match(api, /relabelNo\?: string; relabelStatus\?: string; relabelFulfillmentStatus\?: string/)
assert.match(view, /item\.needRelabel \? '是' : '否', item\.relabelNo, relabelStatus\.label/)
assert.match(view, /if \(!item\.relabelNo\) return \{ code: 'WAIT_RELABEL', label: '待换标' \}/)
assert.match(view, /READY_FOR_OUTBOUND: '已换标', COMPLETED: '已换标'/)
assert.match(view, /#transferRelabelStatus=.*transferRelabelStatusTagType/)
assert.match(view, /#transferStatus=.*transferStatusTagType/)
assert.doesNotMatch(view, /是 · 待绑定换标单/)
})
test('仓储转运详情订单概览使用详情接口命名字段回填', () => {
assert.match(view, /v-else-if="props\.service === 'transfer'" class="warehouse-detail-grid warehouse-transfer-overview-grid"/)
assert.doesNotMatch(view, /入库箱数/)
assert.match(view, /'转运单号', '箱数', '海外仓'/)
for (const field of ['transferNo', 'packageCount', 'operatingWarehouseId', 'deliveryMethod', 'needRelabel', 'relabelNo', 'status', 'createdAt']) {
assert.match(view, new RegExp(`selectedDetail\\?\\.${field}`))
}
assert.match(view, /selectedDetail\?\.destinationWarehouseCode \|\| selectedDetail\?\.fbaWarehouseCode/)
assert.match(view, /transferRelabelStatus\(selectedDetail \|\| \{\}\)/)
assert.match(view, /transferStatusTagType\(selectedDetail\?\.status \|\| ''\)/)
})
test('仓储转运和贴标申请详情先展示主数据再串行补充仓库名称', () => {
const loader = view.match(/async function loadDetailPage\(\) \{[\s\S]*?\n\}/)?.[0] || ''
assert.match(loader, /await openDetail\(\{ '0': detailNumber\.value \}\)/)
assert.match(loader, /await loadWarehouses\(\)/)
assert.ok(loader.indexOf('await openDetail') < loader.indexOf('await loadWarehouses'))
assert.match(view, /props\.service === 'labeling' \? await getRelabel\(value\['0'\]\)/)
assert.match(view, /: props\.service === 'disposal' \? await getDiscard\(value\['0'\]\) : await getTransfer\(value\['0'\]\)/)
})
test('仓储转运详情展示目的去向和对应目的仓资料并让货物明细铺满', () => {
assert.match(view, />目的去向<\/span><strong>\{\{ destinationTypeLabel\(selectedDetail\?\.destinationType, selectedDetail\?\.fbaWarehouseCode\) \}\}/)
assert.match(view, />FBA 目的仓<\/span>.*selectedDetail\?\.destinationWarehouseCode \|\| selectedDetail\?\.fbaWarehouseCode/)
assert.match(view, />FBA 货件号<\/span><strong>\{\{ selectedDetail\?\.fbaShipmentNo \|\| '—' \}\}/)
for (const field of ['privateDestinationAddress', 'privateDestinationPostalCode', 'privateDestinationContactName', 'privateDestinationContactPhone']) {
assert.match(view, new RegExp(`selectedDetail\\?\\.${field}`))
}
assert.match(view, /warehouse-service-page--detail \.warehouse-transfer-cargo-card \.warehouse-section-heading,[^}]+\.warehouse-table-scroll\{max-width:none\}/)
})
test('仓储转运订单概览使用紧凑左右信息布局', () => {
assert.match(view, /warehouse-detail-grid warehouse-transfer-overview-grid/)
assert.match(view, /warehouse-transfer-overview-grid"><div><span>状态<\/span>.*<span>目的去向<\/span>/)
assert.match(view, /class="warehouse-overview-wide"><span>私人仓地址/)
assert.match(view, /warehouse-transfer-overview-grid>\.warehouse-overview-wide\{grid-column:span 2\}/)
assert.match(view, /warehouse-transfer-overview-grid>div\{min-height:26px;padding:2px 0;border:0\}/)
assert.match(view, /warehouse-transfer-overview-grid span\{flex:0 0 auto;min-width:76px\}/)
assert.match(view, /warehouse-transfer-overview-grid\{grid-template-columns:1fr;gap:4px/)
})
test('贴标申请详情使用紧凑订单概览并中文展示换标状态', () => {
assert.match(view, /WAIT_APPROVAL: '待审核'/)
assert.match(view, /WAIT_PROCESSING: '待仓库处理'/)
assert.match(view, /relabelFulfillmentLabel\(selectedRelabelDetail\?\.application\.fulfillmentStatus\)/)
assert.match(view, />\.warehouse-detail-header\+\.warehouse-card \.warehouse-detail-grid\{grid-template-columns:repeat\(4,minmax\(180px,1fr\)\)/)
})
test('PDA 打托完成后客户可从列表或详情确认并查看实测数据', () => {
assert.match(view, /item\.__status === 'WAIT_CUSTOMER_CONFIRMATION'/)
assert.match(view, /confirmTransferFromList\(item\['0'\]\)/)
@@ -189,6 +266,20 @@ test('PDA 打托完成后客户可从列表或详情确认并查看实测数据'
assert.doesNotMatch(view, /pallet\.items/)
})
test('仓储转运详情按订单概览、PDA 实测数据、货物明细排序并放大测量照片', () => {
const detailStart = view.indexOf('<header class="warehouse-detail-header">')
const detailSource = view.slice(detailStart)
const overviewIndex = detailSource.indexOf('<h3>订单概览</h3>')
const measurementIndex = detailSource.indexOf('<h3>PDA 打托实测数据</h3>')
const cargoIndex = detailSource.indexOf('<h3>货物明细</h3>')
assert.ok(overviewIndex >= 0 && overviewIndex < measurementIndex)
assert.ok(measurementIndex < cargoIndex)
assert.match(view, /class="warehouse-photo-grid warehouse-measurement-photo-grid"/)
assert.match(view, /class="warehouse-photo-item warehouse-measurement-photo-item"/)
assert.match(view, /warehouse-measurement-photo-grid\{flex:1;grid-template-columns:repeat\(auto-fill,minmax\(240px,1fr\)\)\}/)
assert.match(view, /warehouse-measurement-photo-item\{width:100%;height:180px\}/)
})
test('仓储转运详情自动加载 PDA 测量照片并释放 Blob URL', () => {
assert.match(api, /downloadTransferMeasurementPhoto/)
assert.match(api, /measurement-photos\/files\/\$\{encodeURIComponent\(fileId\)\}\/download/)
@@ -229,6 +320,12 @@ test('仓储转运可在新建页直接提交,也可保存草稿后编辑提
assert.doesNotMatch(view, /<h3>箱唛明细<\/h3>/)
})
test('转运贴标单在PDA确认库存前不误报附件上传失败', () => {
assert.match(view, /if \(!relabelNo\) \{[\s\S]*PDA 入库确认后将自动生成关联换标单/)
assert.match(view, /届时请进入关联换标单详情上传贴标总文件/)
assert.doesNotMatch(view, /if \(!relabelNo\) throw new Error\('转运单已提交,但未返回关联换标单号'\)/)
})
test('仓储转运基础货物不强制 SKU 和中文品名,只换箱唛不强制旧 SKU', () => {
assert.match(view, /商品 SKU\{\{ props\.service === 'transfer' \? '' : ' \*' \}\}/)
assert.match(view, /中文品名\{\{ props\.service === 'transfer' \? '' : ' \*' \}\}/)