|
|
|
@ -2165,6 +2165,15 @@ const onLoad = async (idsArr = []) => {
|
|
|
|
|
val.freightPrice = isNumber(val.freightPrice) ? Number(val.freightPrice) : 0; |
|
|
|
|
val.deliveryPrice = isNumber(val.deliveryPrice) ? Number(val.deliveryPrice) : 0; |
|
|
|
|
val.pickupPrice = isNumber(val.pickupPrice) ? Number(val.pickupPrice) : 0; |
|
|
|
|
val.subtotalFreight = isNumber(val.subtotalFreight) ? Number(val.subtotalFreight) : 0; |
|
|
|
|
/** 系统维护 -- 干线计价方式 */ |
|
|
|
|
val.systemChargeType = val.systemChargeType || 1; |
|
|
|
|
/** 系统维护 -- 配送计价方式 */ |
|
|
|
|
val.systemDeliveryChargeType = val.systemDeliveryChargeType || 1; |
|
|
|
|
/** 系统维护 -- 提货计价方式 */ |
|
|
|
|
val.systemPickupChargeType = val.systemPickupChargeType || 1; |
|
|
|
|
/** 系统维护 -- 仓库计价方式 */ |
|
|
|
|
val.systemWarehouseChargeType = val.systemWarehouseChargeType || 1; |
|
|
|
|
|
|
|
|
|
val.volume = isNumber(val.volume) ? Number(val.volume) : 0; |
|
|
|
|
val.weight = isNumber(val.weight) ? Number(val.weight) : 0; |
|
|
|
@ -2350,11 +2359,11 @@ const onEditLoad = async () => {
|
|
|
|
|
val.pickupPrice = isNumber(val.pickupPrice) ? Number(val.pickupPrice) : 0; |
|
|
|
|
val.subtotalFreight = isNumber(val.subtotalFreight) ? Number(val.subtotalFreight) : 0; |
|
|
|
|
/** 系统维护 -- 干线计价方式 */ |
|
|
|
|
val.systemChargeType = 1; |
|
|
|
|
val.systemChargeType = val.systemChargeType || 1; |
|
|
|
|
/** 系统维护 -- 配送计价方式 */ |
|
|
|
|
val.systemDeliveryChargeType = 1; |
|
|
|
|
val.systemDeliveryChargeType = val.systemDeliveryChargeType || 1; |
|
|
|
|
/** 系统维护 -- 提货计价方式 */ |
|
|
|
|
val.systemPickupChargeType = 1; |
|
|
|
|
val.systemPickupChargeType = val.systemPickupChargeType || 1; |
|
|
|
|
/** 系统维护 -- 仓库计价方式 */ |
|
|
|
|
val.systemWarehouseChargeType = val.systemWarehouseChargeType || 1; |
|
|
|
|
val.goodsName = val.productName; |
|
|
|
@ -3654,16 +3663,34 @@ const handleSubmit = (formEl: FormInstance | undefined) => {
|
|
|
|
|
const timer = setTimeout(async () => { |
|
|
|
|
try { |
|
|
|
|
// 检测货物名称和件数是否正确填写 |
|
|
|
|
const _flag = details.goodsList.every(val => { |
|
|
|
|
if (!val.goodsName || !isNumber(val.num) || val.num === 0) return false; |
|
|
|
|
return true; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
if (!_flag) { |
|
|
|
|
return ElMessage({ |
|
|
|
|
type: 'warning', |
|
|
|
|
message: '请填写正确的货物名称和件数', |
|
|
|
|
}); |
|
|
|
|
for (let i = 0; i < details.goodsList.length; i++) { |
|
|
|
|
const val = details.goodsList[i]; |
|
|
|
|
// 检测货物名称和件数是否正确填写 |
|
|
|
|
if (!val.goodsName || !isNumber(val.num) || val.num === 0) |
|
|
|
|
return ElMessage.warning('请填写正确的货物名称和件数'); |
|
|
|
|
|
|
|
|
|
val.chargeType = !isNumber(val.chargeType) || !val.chargeType ? 1 : val.chargeType; |
|
|
|
|
val.systemChargeType = |
|
|
|
|
!isNumber(val.systemChargeType) || !val.systemChargeType ? 1 : val.systemChargeType; |
|
|
|
|
val.systemDeliveryChargeType = |
|
|
|
|
!isNumber(val.systemDeliveryChargeType) || !val.systemDeliveryChargeType |
|
|
|
|
? 1 |
|
|
|
|
: val.systemDeliveryChargeType; |
|
|
|
|
val.systemPickupChargeType = |
|
|
|
|
!isNumber(val.systemPickupChargeType) || !val.systemPickupChargeType |
|
|
|
|
? 1 |
|
|
|
|
: val.systemPickupChargeType; |
|
|
|
|
val.systemWarehouseChargeType = |
|
|
|
|
!isNumber(val.systemWarehouseChargeType) || !val.systemWarehouseChargeType |
|
|
|
|
? 1 |
|
|
|
|
: val.systemWarehouseChargeType; |
|
|
|
|
val.weight = !isNumber(val.weight) ? 0 : val.weight; |
|
|
|
|
val.volume = !isNumber(val.volume) ? 0 : val.volume; |
|
|
|
|
val.price = !isNumber(val.price) ? 0 : val.price; |
|
|
|
|
val.freightPrice = !isNumber(val.freightPrice) ? 0 : val.freightPrice; |
|
|
|
|
val.deliveryPrice = !isNumber(val.deliveryPrice) ? 0 : val.deliveryPrice; |
|
|
|
|
val.pickupPrice = !isNumber(val.pickupPrice) ? 0 : val.pickupPrice; |
|
|
|
|
val.subtotalFreight = !isNumber(val.subtotalFreight) ? 0 : val.subtotalFreight; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// if (!(details.query.totalFreight > 0)) { |
|
|
|
@ -4042,7 +4069,6 @@ const handleAssignmentItemPriceTrunkline = (value, trunkLine, template, chargeTy
|
|
|
|
|
} else { |
|
|
|
|
// 定义计价方式 -- 不改变系统值 |
|
|
|
|
const _arr = _obj[chargeType]; |
|
|
|
|
|
|
|
|
|
let _item: any = {}; |
|
|
|
|
|
|
|
|
|
if (getObjType(_arr) === 'array') { |
|
|
|
@ -4254,7 +4280,7 @@ const handleAssignmentItemPriceDispatch = (value, dispatch, template) => {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 赋值 |
|
|
|
|
value.systemDeliveryChargeType = _item.chargeType || 0; |
|
|
|
|
value.systemDeliveryChargeType = _item.chargeType || 1; |
|
|
|
|
value.deliveryPrice = _item.price || 0; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|