This commit is contained in:
2026-09-04 14:31:09 +08:00
parent 4eda56acf1
commit dd47f3841c
4 changed files with 13 additions and 4 deletions
@@ -323,6 +323,7 @@ describe('UnifiedOrdersView contract', () => {
expect(source).toContain('仓库修改外箱(宽)')
expect(source).toContain('仓库修改外箱(高)')
expect(source).toContain('saveWarehouseOuterDimensions')
expect(source).toContain("'MEASURE_REJECTED', 'WAIT_SPLIT'")
expect(source).not.toContain('请至少输入一项需要修改的外箱尺寸')
expect(source).toContain(".map((value) => value == null || value === '' ? null : Number(value))")
expect(source).toContain('相关数值已重新计算')
@@ -381,6 +382,7 @@ describe('UnifiedOrdersView contract', () => {
expect(source).not.toContain("!customerSource && mode !== 'ACTUAL'")
expect(source).toContain('rawDimensions.map((value) => value + rule.edgeAdditionCm * 2)')
expect(source).toContain('matchedSpecificationCoefficient(chargeRule, calculationSource)')
expect(source).toContain(".find((item) => item.id === boundChargeRuleId && item.status === 'ACTIVE')")
expect(source).toContain('listCustomerChargeRules(customerId, tenantId)')
expect(source).toContain('matchedDimensions.map((value) => roundedUp(value * specificationCoefficient, 3))')
expect(source).toContain('const selectedMode: MeasurementCalculationMode = measurementSectionModes.outer')
@@ -375,7 +375,10 @@ function calculatedMeasurementRow(
const matchedDimensions = mode === 'ADD' && rule
? rawDimensions.map((value) => value + rule.edgeAdditionCm * 2)
: rawDimensions
const chargeRule = activeMeasurementChargeRule.value
const boundChargeRuleId = String(source.chargeRuleId || '')
const chargeRule = measurementChargeRules.value
.find((item) => item.id === boundChargeRuleId && item.status === 'ACTIVE')
|| activeMeasurementChargeRule.value
const specificationCoefficient = mode === 'MULTIPLY' && chargeRule
? matchedSpecificationCoefficient(chargeRule, calculationSource)
: 1
@@ -985,7 +988,9 @@ async function updateMeasurementCalculationMode(row: Record<string, unknown> | n
async function saveWarehouseOuterDimensions(row: Record<string, unknown>) {
const summary = detail.value?.summary
const measurement = measurementDetail.value
const editableMeasurementStatuses = new Set(['WAIT_MEASURE', 'MEASURING', 'MEASURE_PENDING', 'MEASURE_REJECTED'])
const editableMeasurementStatuses = new Set([
'WAIT_MEASURE', 'MEASURING', 'MEASURE_PENDING', 'MEASURE_REJECTED', 'WAIT_SPLIT',
])
const currentStatus = editableMeasurementStatuses.has(measurement?.processStatus || '')
? measurement!.processStatus
: summary?.mainStatus || measurement?.processStatus || ''