瀏覽代碼

change: indent计价总成本明细拆分.

peter 3 周之前
父節點
當前提交
fc3ee8086d
共有 1 個文件被更改,包括 79 次插入25 次删除
  1. 79 25
      src/pages/indent-manage/indent/components/calcPrice/index.vue

+ 79 - 25
src/pages/indent-manage/indent/components/calcPrice/index.vue

@@ -277,6 +277,26 @@
                   </div>
                 </div>
 
+                <div class="flex items-center tr">
+                  <div class="td column-label">入口报关费(AUD)</div>
+                  <div class="td">
+                    {{ Number(form.gatt_tax_fee).toFixed(2) }}
+                  </div>
+                  <div class="td">
+                    {{ (Number(form.gatt_tax_fee) / form.number).toFixed(2) }}
+                  </div>
+                </div>
+
+                <div class="flex items-center tr">
+                  <div class="td column-label">验货费(AUD)</div>
+                  <div class="td">
+                    {{ Number(form.review_cost).toFixed(2) }}
+                  </div>
+                  <div class="td">
+                    {{ (Number(form.review_cost) / form.number).toFixed(2) }}
+                  </div>
+                </div>
+
                 <div class="flex items-center tr">
                   <div class="td column-label">总成本(AUD)</div>
                   <div class="td">
@@ -1107,18 +1127,24 @@ let generateStep3Form = (withOldData = false) => {
           temp.freight_cost = mathjs
             .chain(i[`midway_price_${n}`])
             .add(i[`city_price_${n}`])
-            .done()
-          // 用demo默认值是重新计算的数据. 如果是初始化时需要用保存到数据库的数据覆盖掉这个.
-          temp.total_cost = mathjs
-            .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(),
             )
+            .done()
+          // 用demo默认值是重新计算的数据. 如果是初始化时需要用保存到数据库的数据覆盖掉这个.
+          temp.total_cost = mathjs
+            .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
@@ -1141,18 +1167,24 @@ let generateStep3Form = (withOldData = false) => {
           temp.freight_cost = mathjs
             .chain(i[`freight_cost_${n}`])
             .add(i[`city_price_${n}`])
-            .done()
-
-          temp.total_cost = mathjs
-            .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(),
             )
+            .done()
+
+          temp.total_cost = mathjs
+            .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
@@ -1177,6 +1209,12 @@ let generateStep3Form = (withOldData = false) => {
           temp.freight_cost = mathjs
             .chain(i[`freight_cost_${n}`])
             .add(i[`city_price_${n}`])
+            .add(
+              mathjs
+                .chain(temp.cn_freight_cost)
+                .divide(setting.value.rate_rmb_aud)
+                .done(),
+            )
             .done()
           // total_lcl 运费总成本
           // price 国内总运费
@@ -1184,12 +1222,12 @@ 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(
+            //   mathjs
+            //     .chain(temp.cn_freight_cost)
+            //     .divide(setting.value.rate_rmb_aud)
+            //     .done(),
+            // )
             .add(
               withOldData
                 ? oldData[`cal_quote_${n}_${i.number}`].tax_fee
@@ -1461,12 +1499,12 @@ let calcTotalCost = (form: any) => {
     .chain(form.product_cost)
     .add(form.extend_cost)
     .add(form.freight_cost)
-    .add(
-      mathjs
-        .chain(form.cn_freight_cost)
-        .divide(setting.value.rate_rmb_aud)
-        .done(),
-    )
+    // .add(
+    //   mathjs
+    //     .chain(form.cn_freight_cost)
+    //     .divide(setting.value.rate_rmb_aud)
+    //     .done(),
+    // )
     .add(form.tax_fee)
     .add(form.gatt_tax_fee)
     .add(form.review_cost)
@@ -1522,7 +1560,17 @@ let onForm3ItemChange = (form: any, key: string) => {
       calcProfitMargin(form)
       break
     case 'cn_freight_cost':
-      // 影响 总成本、利润率、利润值
+      // 影响 运费总成本、总成本、利润率、利润值
+      form.freight_cost = mathjs
+        .chain(form.local_freight_cost)
+        .add(form.midway_price)
+        .add(
+          mathjs
+            .chain(form.cn_freight_cost)
+            .divide(setting.value.rate_rmb_aud)
+            .done(),
+        )
+        .done()
       calcTotalCost(form)
       calcProfit(form)
       calcProfitMargin(form)
@@ -1533,6 +1581,12 @@ let onForm3ItemChange = (form: any, key: string) => {
       form.freight_cost = mathjs
         .chain(form.local_freight_cost)
         .add(form.midway_price)
+        .add(
+          mathjs
+            .chain(form.cn_freight_cost)
+            .divide(setting.value.rate_rmb_aud)
+            .done(),
+        )
         .done()
       calcTotalCost(form)
       calcProfitMargin(form)