This commit is contained in:
2026-08-18 11:33:01 +08:00
parent 834382e04b
commit 114d5bacc7
34 changed files with 522 additions and 570 deletions
@@ -6,9 +6,9 @@ const source = readFileSync(resolve(process.cwd(), 'src/modules/inbounds/weight/
describe('WeightOcrPanel contract', () => {
it('uses customer language at the page boundary while retaining a compatibility input', () => {
expect(source).toContain("defineProps<{ customerId?: string; tenantId?: string; inboundId: string }>()")
expect(source).toContain('reviewMode?: boolean')
expect(source).toContain("const customerId = computed(() => props.customerId || props.tenantId || '')")
expect(source).toContain('summaryChanged: [actualGrossWeightKg: number | null]')
expect(source).toContain('summaryChanged: [actualGrossWeightKg: number | null, actualNetWeightKg: number | null]')
expect(source).toContain("defineExpose({ reload: loadWorkspace })")
const template = source.match(/<template>([\s\S]*?)<\/template>/)?.[1] || ''
expect(template).not.toContain('租户')
@@ -29,11 +29,13 @@ describe('WeightOcrPanel contract', () => {
expect(source).toContain('OCR 识别毛重')
expect(source).toContain('确认含托盘毛重')
expect(source).toContain('payload.adjustedWeightValue = Number(draft.value)')
expect(source).toContain('payload.adjustmentReason = buildAdjustmentReason(row)')
expect(source).toContain('货物总重量')
expect(source).toContain("row.recognitionStatus === 'CONFIRMED' && reviewCorrectionEnabled.value")
expect(source).toContain('draft.reason.trim()')
expect(source).toContain('实测毛重')
expect(source).toContain('货物重量')
expect(source).toContain('palletTareWeightKg')
expect(source).toContain('netWeightKg')
expect(source).toContain("emit('summaryChanged', workspace.value?.actualGrossWeightKg ?? null)")
expect(source).toContain("emit('summaryChanged', workspace.value?.actualGrossWeightKg ?? null, workspace.value?.actualNetWeightKg ?? null)")
})
it('matches backend image limits and keeps technical OCR data out of the list', () => {
@@ -65,6 +67,9 @@ describe('WeightOcrPanel contract', () => {
expect(source).toContain("platform:firstleg:inbound:weight:edit")
expect(source).toContain("platform:firstleg:inbound:weight:confirm")
expect(source).toContain("new Set(['WAIT_MEASURE', 'MEASURING', 'MEASURE_REJECTED'])")
expect(source).toContain("workspace.value?.processStatus === 'MEASURE_PENDING'")
expect(source).toContain('v-if="canEdit && !reviewMode"')
expect(source).toContain('v-if="canEdit && editable && !reviewMode"')
})
it('provides error tracking, empty, loading, and narrow-screen states', () => {