feat(client): align account and order foundations
This commit is contained in:
@@ -84,6 +84,7 @@ export function createEmptyCargoItem(id = `cargo-${Date.now()}`): FirstLegCargoI
|
||||
declaredValue: 0,
|
||||
currency: 'USD',
|
||||
dangerousGoods: false,
|
||||
woodenProduct: false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,12 +100,14 @@ export function validateFirstLegOrderDraft(draft: FirstLegOrderDraft) {
|
||||
if (!['TAX_INCLUDED', 'TAX_EXCLUDED'].includes(draft.pricingTaxMode)) errors.push('请选择报价包税方式')
|
||||
if (!draft.receivingWarehouseId) errors.push('请选择平台收货仓')
|
||||
if (draft.pickupMethod === 'PICKUP') {
|
||||
if (!draft.senderAddressId) errors.push('请选择已保存的提货地址')
|
||||
if (!draft.shipperPartySnapshot?.contactName.trim()) errors.push('请填写提货联系人')
|
||||
if (!draft.shipperPartySnapshot?.phone.trim()) errors.push('请填写提货联系电话')
|
||||
if (!draft.shipperPartySnapshot?.city.trim()) errors.push('请填写提货城市')
|
||||
if (!draft.shipperPartySnapshot?.address.trim()) errors.push('请填写提货地址')
|
||||
}
|
||||
if (draft.destinationType === 'PRIVATE') {
|
||||
if (!draft.privateDestinationAddressId) errors.push('请选择已保存的私人仓地址')
|
||||
if (!draft.consigneePartySnapshot?.name.trim()) errors.push('请填写私人地址名称')
|
||||
if (!draft.consigneePartySnapshot?.contactName.trim()) errors.push('请填写收件人姓名')
|
||||
if (!draft.consigneePartySnapshot?.phone.trim()) errors.push('请填写收件人电话')
|
||||
@@ -130,6 +133,9 @@ export function validateFirstLegOrderDraft(draft: FirstLegOrderDraft) {
|
||||
if (item.grossWeightKg <= 0) errors.push(`${line}毛重必须大于 0`)
|
||||
if (item.volumeCbm <= 0) errors.push(`${line}体积必须大于 0`)
|
||||
})
|
||||
if (draft.items.some((item) => item.woodenProduct) && draft.customsInspection !== true) {
|
||||
errors.push('木制品必须选择商检')
|
||||
}
|
||||
|
||||
return errors
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user