diff --git a/src/modules/inbounds/measurement/InboundMeasurementPanel.test.ts b/src/modules/inbounds/measurement/InboundMeasurementPanel.test.ts index f62d82aa..a4e85b20 100644 --- a/src/modules/inbounds/measurement/InboundMeasurementPanel.test.ts +++ b/src/modules/inbounds/measurement/InboundMeasurementPanel.test.ts @@ -381,8 +381,8 @@ describe('InboundMeasurementPanel', () => { vi.mocked(getInboundMeasurement).mockResolvedValueOnce(measurement({ measurementId: null, items: [], weightResults: [] })) const wrapper = await mountPanel() expect(wrapper.find('.measurement-summary-header h4').text()).toBe('申报与实测对比') - expect(wrapper.find('.measurement-declaration-header').text()).not.toContain('DOC-001') - expect(wrapper.find('.measurement-section__heading .measurement-goods-name').exists()).toBe(false) + expect(wrapper.find('.measurement-declaration-header').text()).toContain('DOC-001') + expect(wrapper.find('.measurement-section__heading .measurement-goods-name input').exists()).toBe(true) expect(wrapper.find('.measurement-section__heading .measurement-section-actions').text()).toContain('手动录入箱规') expect(wrapper.findAll('.el-alert').some(alert => alert.text().includes('请先完成箱规测量'))).toBe(false) expect(wrapper.find('.measurement-panel__footer').text()).toContain('请先完成箱规测量') @@ -396,11 +396,11 @@ describe('InboundMeasurementPanel', () => { expect(comparison.text()).toContain('118.5') expect(comparison.text()).toContain('0.8') expect(comparison.findAll('tbody tr')[0].text()).toContain('10') - expect(declaration.text()).not.toContain('原单据号码') - expect(declaration.text()).not.toContain('DOC-001') - expect(declaration.findAll('.measurement-readonly-field')).toHaveLength(0) + expect(declaration.text()).toContain('原单据号码') + expect(declaration.text()).toContain('DOC-001') + expect(declaration.findAll('.measurement-readonly-field')).toHaveLength(1) expect(declaration.findAll('input')).toHaveLength(0) - expect(wrapper.find('.measurement-items-section .measurement-goods-name').exists()).toBe(false) + expect(wrapper.find('.measurement-items-section .measurement-goods-name input').exists()).toBe(true) expect(declaration.find('[aria-label="客户申报箱规明细"]').text()).toContain('蓝牙音箱') expect(declaration.find('[aria-label="客户申报箱规明细"]').text()).toContain('50 × 40 × 30') }) @@ -418,14 +418,18 @@ describe('InboundMeasurementPanel', () => { expect(declaration.find('input').exists()).toBe(false) expect(declaration.text()).toContain('蓝牙音箱') - expect(declaration.findAll('.measurement-readonly-field')).toHaveLength(0) - expect(wrapper.find('.measurement-items-section .measurement-goods-name').exists()).toBe(false) + expect(declaration.findAll('.measurement-readonly-field')).toHaveLength(1) + const actualGoods = wrapper.get('.measurement-items-section .measurement-goods-name') + expect(actualGoods.text()).toContain('蓝牙音箱') + expect(actualGoods.find('input').exists()).toBe(false) }) - it('preserves the hidden actual goods name without overriding declaration facts', async () => { + it('saves the edited actual goods name without overriding declaration facts', async () => { const wrapper = await mountPanel() - expect(wrapper.text()).not.toContain('实际品名') - await wrapper.find('input[aria-label="仓库修改外箱长"]').setValue('55') + expect(wrapper.get('input[aria-label="实际品名"]').element.value).toBe('蓝牙音箱') + await wrapper.get('input[aria-label="实际品名"]').setValue(' 实测蓝牙音箱 ') + expect(wrapper.get('.measurement-declaration').text()).toContain('蓝牙音箱') + expect(wrapper.get('.measurement-declaration').text()).not.toContain('实测蓝牙音箱') const save = wrapper.findAll('button').find((button) => button.text().includes('保存测量数据')) await save?.trigger('click') await flushPromises() @@ -433,7 +437,7 @@ describe('InboundMeasurementPanel', () => { expect(saveInboundMeasurementDraft).toHaveBeenCalledWith('10001', '7001', expect.objectContaining({ measurementId: '9001', version: 2, - actualGoodsName: '蓝牙音箱', + actualGoodsName: '实测蓝牙音箱', items: expect.any(Array), })) const payload = vi.mocked(saveInboundMeasurementDraft).mock.calls[0]?.[2] @@ -630,7 +634,7 @@ describe('InboundMeasurementPanel', () => { const wrapper = await mountPanel() expect(wrapper.find('.measurement-declaration input').exists()).toBe(false) expect(wrapper.find('.measurement-items-section .measurement-expected-pallets input').exists()).toBe(true) - expect(wrapper.find('.measurement-items-section .measurement-goods-name').exists()).toBe(false) + expect(wrapper.find('.measurement-items-section .measurement-goods-name input').exists()).toBe(true) }) it('requires at least one confirmed weight image before submitting for review', async () => { diff --git a/src/modules/inbounds/measurement/InboundMeasurementPanel.vue b/src/modules/inbounds/measurement/InboundMeasurementPanel.vue index cd04ee59..ab8448c7 100644 --- a/src/modules/inbounds/measurement/InboundMeasurementPanel.vue +++ b/src/modules/inbounds/measurement/InboundMeasurementPanel.vue @@ -736,7 +736,7 @@ defineExpose({ saveDraft, submitForReview, updateWeightEvidence, submissionBlock

{{ warning.text }}

-
+
@@ -748,7 +748,7 @@ defineExpose({ saveDraft, submitForReview, updateWeightEvidence, submissionBlock -
指标客户申报平台实测差异(实测 − 申报)
+
货物净重 {{ formatNumber(detail.actualNetWeightKg) }} kg 计费材积重 {{ formatNumber(detail.volumeWeightKg) }} kg @@ -759,6 +759,7 @@ defineExpose({ saveDraft, submitForReview, updateWeightEvidence, submissionBlock

客户申报明细

+
原单据号码{{ detail.originalDocumentNo || '—' }}

平台实测箱规

-
+
+ +
实际品名{{ detail.actualGoodsName || '—' }}
预计托数{{ detail.expectedPalletCount ?? '—' }}
@@ -927,9 +930,9 @@ defineExpose({ saveDraft, submitForReview, updateWeightEvidence, submissionBlock