This commit is contained in:
wujinliang
2026-09-18 09:15:15 +08:00
parent 51f27ccda7
commit bb94f88bb3
4 changed files with 75 additions and 13 deletions
+7 -1
View File
@@ -141,9 +141,15 @@ export function validateFirstLegOrderDraft(draft: FirstLegOrderDraft) {
}
if (item.grossWeightKg <= 0) errors.push(`${line}毛重必须大于 0`)
if (item.volumeCbm <= 0) errors.push(`${line}体积必须大于 0`)
if (item.woodenProduct && draft.customsInspection !== true) errors.push(`${line}为木制品,“是否商检”必须选择“是”`)
})
const woodenCargoLines = draft.items
.map((item, index) => item.woodenProduct ? index + 1 : null)
.filter((index): index is number => index != null)
if (woodenCargoLines.length && draft.customsInspection !== true) {
errors.push(`第 ${woodenCargoLines.join('、')} 条货物为木制品,“是否商检”必须选择“是”`)
}
if (draft.fulfillmentType === 'ONE_CLICK_DROPSHIP') {
const groups = new Map<string, FirstLegCargoItem>()
draft.items.forEach((item) => {