Browse Source

0825附加值添加进计算

liuhj 4 days ago
parent
commit
e258e53a5d
1 changed files with 8 additions and 7 deletions
  1. 8 7
      src/components/Finance/ConferenceCost.vue

+ 8 - 7
src/components/Finance/ConferenceCost.vue

@@ -368,7 +368,7 @@ export default {
                 priceName: '',//费用名称
                 costPrice: 0,//成本费用
                 currency: 836,//币种
-                rate: 0,//当时汇率
+                rate: 1,//当时汇率s
                 count: 0,//数量333
                 unit: '',//单位
                 coefficient: 0,//系数
@@ -396,23 +396,24 @@ export default {
         },
 
         updateTotals() {
-            // Calculate cost total
+            // 计算成本总计
             this.conferenceAffairsCost.costAll = this.tableDatas.reduce((sum, item) => {
                 console.log(item);
+                console.log(sum);
                 
                 if (this.rateStatistics.length > 1) {
-                    return sum + (Number(item.costPrice) || 0) * (Number(item.count) || 0) * (Number(item.rate) || 0);
+                    return sum + ((Number(item.costPrice) || 0) * (Number(item.count) || 0) * (Number(item.rate) || 0))+((Number(item.rate) || 0) * (Number(item.addedValue) || 0));
                 } else {
-                    return sum + (Number(item.costPrice) || 0) * (Number(item.count) || 0);
+                    return sum + ((Number(item.costPrice) || 0) * (Number(item.count) || 0))+(Number(item.addedValue) || 0);
                 }
             }, 0).toFixed(2);
 
-            // Calculate quotation total
+            // 计算报价总计
             this.conferenceAffairsCost.baoJiaAll = this.tableDatas.reduce((sum, item) => {
                 if (this.rateStatistics.length > 1) {
-                    return sum + (Number(item.costPrice) || 0) * (Number(item.count) || 0) * (Number(item.rate) || 0) * (Number(item.coefficient) || 0);
+                    return sum + ((Number(item.costPrice) || 0) * (Number(item.count) || 0) * (Number(item.rate) || 0) * (Number(item.coefficient) || 0))+((Number(item.rate) || 0) * (Number(item.addedValue) || 0));
                 } else {
-                    return sum + (Number(item.costPrice) || 0) * (Number(item.count) || 0) * (Number(item.coefficient) || 0);
+                    return sum + ((Number(item.costPrice) || 0) * (Number(item.count) || 0) * (Number(item.coefficient) || 0))+(Number(item.addedValue) || 0);
                 }
  
             }, 0).toFixed(2);