优化
This commit is contained in:
@@ -114,7 +114,14 @@ function measurement(overrides: Partial<InboundMeasurementDetail> = {}): Inbound
|
||||
outerHeightCm: null,
|
||||
remark: '设备自动回传',
|
||||
}],
|
||||
weightResults: [],
|
||||
weightResults: [{
|
||||
id: '30001', fileId: '40001', palletId: '50001', palletCode: 'TP-001', palletType: '木托盘',
|
||||
palletCapacityCbm: 1.2, palletTareWeightKg: 10, ocrProvider: 'FILE_WEIGHT_OCR', ocrRawText: '120',
|
||||
ocrWeightValue: 120, ocrWeightUnit: 'KG', confidence: 0.98, adjustedWeightValue: null,
|
||||
adjustedWeightUnit: null, grossWeightKg: 120, netWeightKg: 110, recognitionStatus: 'CONFIRMED',
|
||||
adjustmentReason: null, adjustedBy: null, adjustedAt: null, confirmedBy: '9',
|
||||
confirmedAt: '2026-08-04T10:35:00+08:00', version: 1,
|
||||
}],
|
||||
...overrides,
|
||||
}
|
||||
}
|
||||
@@ -478,6 +485,16 @@ describe('InboundMeasurementPanel', () => {
|
||||
expect(wrapper.emitted('changed')).toHaveLength(1)
|
||||
})
|
||||
|
||||
it('requires at least one confirmed weight image before submitting for review', async () => {
|
||||
vi.mocked(getInboundMeasurement).mockResolvedValueOnce(measurement({ weightResults: [] }))
|
||||
const wrapper = await mountPanel()
|
||||
|
||||
expect(wrapper.text()).toContain('至少上传并确认一张称重图片后才能提交审核')
|
||||
const submit = wrapper.findAll('button').find((button) => button.text().includes('提交审核'))
|
||||
expect(submit?.attributes('disabled')).toBeDefined()
|
||||
expect(submitInboundMeasurement).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('emits updated without closing the parent task after manual carton entry', async () => {
|
||||
const wrapper = await mountPanel()
|
||||
const source = await import('./InboundMeasurementPanel.vue?raw').then((module) => module.default)
|
||||
|
||||
Reference in New Issue
Block a user