|
|
@ -599,31 +599,12 @@ Page({ |
|
|
console.log('✓ 售空分支执行: 只显示规格信息'); |
|
|
console.log('✓ 售空分支执行: 只显示规格信息'); |
|
|
console.log('weightQuantityData设置为:', weightQuantityData); |
|
|
console.log('weightQuantityData设置为:', weightQuantityData); |
|
|
} else { |
|
|
} else { |
|
|
// 非售空状态,正常处理规格信息,显示件数
|
|
|
// 非售空状态,使用processWeightAndQuantityData函数正确处理规格和件数信息
|
|
|
console.log('× 非售空分支执行: 显示毛重和件数'); |
|
|
console.log('× 非售空分支执行: 调用processWeightAndQuantityData处理'); |
|
|
console.log('输入参数: weightSpecString="', weightSpecString, '", quantityString="', quantityString, '"'); |
|
|
console.log('输入参数: weightSpecString="', weightSpecString, '", quantityString="', quantityString, '"'); |
|
|
|
|
|
|
|
|
if (weightSpecString) { |
|
|
weightQuantityData = processWeightAndQuantityData(weightSpecString, quantityString, ''); |
|
|
// 处理毛重规格字符串
|
|
|
|
|
|
const weightSpecArray = weightSpecString.split(/[,,、]/).map(item => item.trim()).filter(item => item); |
|
|
|
|
|
// 处理件数字符串
|
|
|
|
|
|
const quantityArray = quantityString ? quantityString.split(/[,,、]/).map(item => item.trim()).filter(item => item) : []; |
|
|
|
|
|
// 获取最大长度
|
|
|
|
|
|
const maxLength = Math.max(weightSpecArray.length, quantityArray.length); |
|
|
|
|
|
|
|
|
|
|
|
weightQuantityData = []; |
|
|
|
|
|
for (let i = 0; i < maxLength; i++) { |
|
|
|
|
|
const spec = weightSpecArray[i] || ''; |
|
|
|
|
|
const qty = quantityArray[i] || ''; |
|
|
|
|
|
const weightSpec = spec.includes('毛重') ? spec : `毛重${spec}`; |
|
|
|
|
|
const display = `${weightSpec}----------${qty}件`; |
|
|
|
|
|
weightQuantityData.push({ |
|
|
|
|
|
weightSpec: weightSpec, |
|
|
|
|
|
quantity: qty, |
|
|
|
|
|
display: display |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
console.log('× 非售空分支结果:', weightQuantityData); |
|
|
console.log('× 非售空分支结果:', weightQuantityData); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|