Release/test 合并上生产 #2

Merged
admin merged 736 commits from release/test into main 2026-09-17 11:50:56 +08:00
2 changed files with 19 additions and 23 deletions
Showing only changes of commit a1ed15f055 - Show all commits
@@ -149,13 +149,14 @@ describe('InboundMeasurementPanel', () => {
expect(getInboundMeasurement).toHaveBeenCalledWith('10001', '7001')
expect(wrapper.text()).toContain('第三方设备')
expect(wrapper.text()).toContain('RK202608040001')
expect(wrapper.text()).toContain('箱规周长')
expect(wrapper.text()).toContain('190 cm')
expect(wrapper.text()).toContain('0.6 CBM')
expect(wrapper.text()).toContain('周长(cm)')
expect(wrapper.find('.measurement-table').text()).toContain('190')
expect(wrapper.find('.measurement-table').text()).toContain('0.6')
await wrapper.find('.el-table__expand-icon').trigger('click')
await flushPromises()
expect(wrapper.text()).toContain('MJ20210327')
const measuredAtInput = wrapper.findAll('label').find((label) => label.text().includes('测量时间'))?.find('input')
expect((measuredAtInput?.element as HTMLInputElement).value).toBe('2026-08-04 10:30:00+08:00')
expect(wrapper.text()).toContain('预览图片')
expect(wrapper.text()).toContain('2026-08-04 10:30:00+08:00')
expect(wrapper.find('button[aria-label="预览测量图片"]').exists()).toBe(true)
})
it('opens the manual carton entry form in an editable measurement state', async () => {
@@ -203,21 +204,13 @@ describe('InboundMeasurementPanel', () => {
expect(text).toContain('实测总材积重')
expect(text).not.toContain('租户')
const labels = wrapper.findAll('.measurement-item__grid label > span').map((label) => label.text())
expect(labels.slice(0, 8)).toEqual([
'箱号',
'测量长(cm)',
'测量宽(cm)',
'测量高(cm)',
'确认箱数 *',
'每箱毛重(kg)',
'机器编号',
'测量时间',
])
expect(wrapper.find('.measurement-table').exists()).toBe(true)
expect(wrapper.find('.measurement-item').exists()).toBe(false)
expect(wrapper.find('.measurement-table').text()).toContain('周长(cm)')
const source = await import('./InboundMeasurementPanel.vue?raw').then((module) => module.default)
expect(source).toContain('.measurement-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));')
expect(source).toContain('.measurement-item__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));')
expect(source).toContain('.measurement-form-grid, .measurement-item__grid, .measurement-item__advanced .measurement-item__grid { grid-template-columns: 1fr; }')
expect(source).toContain('.measurement-table { width: 100%; font-size: 12px; }')
expect(source).toContain('.measurement-order-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));')
expect(source).toContain('defineExpose({ saveDraft, submitForReview, mayMaintain, maySubmit, saving, submitting, canEdit, canSubmit })')
})
@@ -235,7 +228,7 @@ describe('InboundMeasurementPanel', () => {
boxCode: 'RK202608040001#10-1', confirmedPackageCount: 9,
})
const wrapper = await mountPanel()
const countInput = wrapper.findAll('label').find((label) => label.text().includes('确认箱数'))?.find('input')
const countInput = wrapper.find('.measurement-count-editor input')
await countInput?.setValue('9')
const save = wrapper.findAll('button').find((button) => button.text().includes('保存确认箱数'))
await save?.trigger('click')
@@ -252,7 +245,7 @@ describe('InboundMeasurementPanel', () => {
new ApiResponseError('数据版本已变化,请刷新后重试', 'A0409', 200, null, 'req-conflict', 'trace-conflict'),
)
const wrapper = await mountPanel()
const countInput = wrapper.findAll('label').find((label) => label.text().includes('确认箱数'))?.find('input')
const countInput = wrapper.find('.measurement-count-editor input')
await countInput?.setValue('9')
const save = wrapper.findAll('button').find((button) => button.text().includes('保存确认箱数'))
await save?.trigger('click')
@@ -266,7 +259,7 @@ describe('InboundMeasurementPanel', () => {
it('requires the dirty draft to be saved before submitting for review', async () => {
const wrapper = await mountPanel()
const countInput = wrapper.findAll('label').find((label) => label.text().includes('确认箱数'))?.find('input')
const countInput = wrapper.find('.measurement-count-editor input')
await countInput?.setValue('9')
const submit = wrapper.findAll('button').find((button) => button.text().includes('提交审核'))
await submit?.trigger('click')
@@ -305,7 +298,7 @@ describe('InboundMeasurementPanel', () => {
it('keeps device facts read-only but allows manual count correction after submission', async () => {
vi.mocked(getInboundMeasurement).mockResolvedValueOnce(measurement({ processStatus: 'MEASURE_PENDING' }))
const wrapper = await mountPanel()
const countInput = wrapper.findAll('label').find((label) => label.text().includes('确认箱数'))?.find('input')
const countInput = wrapper.find('.measurement-count-editor input')
expect((countInput?.element as HTMLInputElement).matches(':disabled')).toBe(false)
expect(wrapper.findAll('button').find((button) => button.text().includes('保存确认箱数'))?.attributes('disabled')).toBeUndefined()
@@ -612,6 +612,9 @@ defineExpose({ saveDraft, submitForReview, mayMaintain, maySubmit, saving, submi
<el-table-column label="单箱体积(m³)" width="112" align="right">
<template #default="{ row }">{{ formatNumber(row.serverValues.unitVolumeCbm, 4) }}</template>
</el-table-column>
<el-table-column label="周长(cm)" width="92" align="right">
<template #default="{ row }">{{ formatNumber(row.serverValues.girthCm) }}</template>
</el-table-column>
<el-table-column label="总毛重(kg)" width="104" align="right">
<template #default="{ row }">{{ formatNumber(row.serverValues.totalWeightKg) }}</template>
</el-table-column>