Browse Source

fix: indent计价.dtd.lcl修复.

peter 2 weeks ago
parent
commit
3fd059c691
1 changed files with 13 additions and 11 deletions
  1. 13 11
      src/pages/indent-manage/indent/components/calcPrice/index.vue

+ 13 - 11
src/pages/indent-manage/indent/components/calcPrice/index.vue

@@ -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)
       }
     }