|
@@ -1139,12 +1139,6 @@ let generateStep3Form = (withOldData = false) => {
|
|
|
.chain(i.product_cost)
|
|
|
.add(i.extend_cost)
|
|
|
.add(temp.freight_cost)
|
|
|
- // .add(
|
|
|
- // mathjs
|
|
|
- // .chain(temp.cn_freight_cost)
|
|
|
- // .divide(setting.value.rate_rmb_aud)
|
|
|
- // .done(),
|
|
|
- // )
|
|
|
.add(
|
|
|
withOldData
|
|
|
? oldData[`cal_quote_${n}_${i.number}`].tax_fee
|
|
@@ -1164,9 +1158,13 @@ let generateStep3Form = (withOldData = false) => {
|
|
|
} else if (n === 3) {
|
|
|
temp.local_freight_cost = 0
|
|
|
temp.add_freight_cost = 0
|
|
|
- temp.freight_cost = mathjs
|
|
|
+ // 记录中途运费, 用在step3表单项变更后的重复计算
|
|
|
+ temp.midway_price = mathjs
|
|
|
.chain(i[`freight_cost_${n}`])
|
|
|
.add(i[`city_price_${n}`])
|
|
|
+ .done()
|
|
|
+ temp.freight_cost = mathjs
|
|
|
+ .chain(temp.midway_price)
|
|
|
.add(
|
|
|
mathjs
|
|
|
.chain(temp.cn_freight_cost)
|
|
@@ -1206,9 +1204,15 @@ let generateStep3Form = (withOldData = false) => {
|
|
|
} else if (n === 4) {
|
|
|
temp.local_freight_cost = 0
|
|
|
temp.add_freight_cost = 0
|
|
|
- temp.freight_cost = mathjs
|
|
|
+ temp.local_freight_cost = 0
|
|
|
+ temp.add_freight_cost = 0
|
|
|
+ // 记录中途运费, 用在step3表单项变更后的重复计算
|
|
|
+ temp.midway_price = mathjs
|
|
|
.chain(i[`freight_cost_${n}`])
|
|
|
.add(i[`city_price_${n}`])
|
|
|
+ .done()
|
|
|
+ temp.freight_cost = mathjs
|
|
|
+ .chain(temp.midway_price)
|
|
|
.add(
|
|
|
mathjs
|
|
|
.chain(temp.cn_freight_cost)
|
|
@@ -1301,8 +1305,6 @@ let generateStep3Form = (withOldData = false) => {
|
|
|
exportForm.value[`cycle_name_${n}_${i.number}`] = 'weeks'
|
|
|
|
|
|
if (withOldData === true) {
|
|
|
- console.log('witholdata true')
|
|
|
- console.log(oldData, 'oldData')
|
|
|
if (oldData[`cal_quote_${n}_${i.number}`]) {
|
|
|
const cloneData = cloneDeep(oldData[`cal_quote_${n}_${i.number}`])
|
|
|
cloneData.freight_cost = cloneData.freight
|
|
@@ -1315,7 +1317,7 @@ let generateStep3Form = (withOldData = false) => {
|
|
|
oldData[`cycle_name_${n}_${i.number}`] || 'weeks'
|
|
|
}
|
|
|
|
|
|
- console.log(temp, 'temp')
|
|
|
+ // console.log(temp, 'temp')
|
|
|
result.push(temp)
|
|
|
}
|
|
|
}
|