This commit is contained in:
2026-08-17 18:00:42 +08:00
parent c7334b2cf8
commit ec3dbb3fe4
23 changed files with 407 additions and 999 deletions
@@ -13,6 +13,7 @@ defineEmits<{ open: [] }>()
<template>
<MeasurementEvidenceThumbnail
class="weight-thumb"
:customer-id="props.customerId"
:inbound-id="props.inboundId"
:file-id="props.fileId"
@@ -221,7 +221,10 @@ describe('WeightOcrPanel confirmation behavior', () => {
expect(dialogText).toContain('OCR 识别毛重')
expect(dialogText).toContain('285.500 KG')
expect(dialogText).toContain('确认含托盘毛重')
for (const hiddenLabel of ['托盘编码', '托盘类型', '托盘容量', '识别状态', '置信度', '服务端毛重', '服务端净重', 'OCR 原文']) {
expect(dialogText).toContain('托盘类型')
expect(dialogText).toContain('木托盘')
expect(dialogText).not.toContain('TP-001')
for (const hiddenLabel of ['托盘编码', '托盘容量', '识别状态', '置信度', '服务端毛重', '服务端净重', 'OCR 原文']) {
expect(dialogText).not.toContain(hiddenLabel)
}
expect(dialogConfirmButton().attributes('disabled')).toBeUndefined()
@@ -25,6 +25,7 @@ describe('WeightOcrPanel contract', () => {
expect(source).toContain('class="weight-card__value"')
expect(source).toContain('v-model="weightDrafts[previewResult.id].value"')
expect(source).toContain('当前托盘皮重')
expect(source).toContain("previewResult.palletType || '未记录类型'")
expect(source).toContain('OCR 识别毛重')
expect(source).toContain('确认含托盘毛重')
expect(source).toContain('payload.adjustedWeightValue = Number(draft.value)')
@@ -44,10 +45,12 @@ describe('WeightOcrPanel contract', () => {
expect(source).not.toContain('<span>置信度</span>')
expect(source).not.toContain('<span>OCR 原文</span>')
expect(source).not.toContain('<span>托盘编码</span>')
expect(source).not.toContain('<span>托盘类型</span>')
expect(source).toContain('<span>托盘类型</span>')
expect(source).not.toContain('<span>托盘容量</span>')
expect(source).not.toContain('<span>服务端毛重</span>')
expect(source).not.toContain('<span>服务端净重</span>')
expect(source).not.toContain('`${option.palletCode} · ${option.palletType}`')
expect(source).toContain("option.palletType || '未记录类型'")
})
it('gates every action with the implemented permissions and editable statuses', () => {
@@ -400,7 +400,7 @@ defineExpose({ reload: loadWorkspace })
<el-option
v-for="option in palletOptions"
:key="option.palletId"
:label="`${option.palletCode} · ${option.palletType}`"
:label="option.palletType || '未记录类型'"
:value="option.palletId"
/>
</el-select>
@@ -499,10 +499,10 @@ defineExpose({ reload: loadWorkspace })
@click="openPreview(row)"
><strong>{{ cardWeight(row) }}</strong></button>
<dl class="weight-card__facts">
<div><dt>托盘</dt><dd>{{ row.palletCode }}</dd></div>
<div><dt>含托盘毛重</dt><dd>{{ formatWeight(row.grossWeightKg) }}</dd></div>
<div><dt>托盘类型</dt><dd>{{ row.palletType || '未记录类型' }}</dd></div>
<div><dt>服务端确认毛重</dt><dd>{{ formatWeight(row.grossWeightKg) }}</dd></div>
<div><dt>托盘皮重</dt><dd>{{ formatWeight(row.palletTareWeightKg) }}</dd></div>
<div><dt>货物净重</dt><dd>{{ formatWeight(row.netWeightKg) }}</dd></div>
<div><dt>货物重量</dt><dd>{{ formatWeight(row.netWeightKg) }}</dd></div>
</dl>
</div>
</article>
@@ -535,6 +535,7 @@ defineExpose({ reload: loadWorkspace })
<template v-else-if="previewResult">
<img v-if="previewUrl" class="weight-preview" :src="previewUrl" alt="当前入库单的称重图片" />
<div class="weight-key-facts" aria-label="称重关键数据">
<div><span>托盘类型</span><strong>{{ previewResult.palletType || '未记录类型' }}</strong></div>
<div><span>当前托盘皮重</span><strong>{{ formatWeight(previewResult.palletTareWeightKg) }}</strong></div>
<div><span>OCR 识别毛重</span><strong>{{ formatWeight(previewResult.ocrWeightValue, previewResult.ocrWeightUnit || 'KG') }}</strong></div>
</div>