Przeglądaj źródła

成本分配表-辅料tab-增加合计行

jbb 2 lat temu
rodzic
commit
4978725054
1 zmienionych plików z 44 dodań i 2 usunięć
  1. 44 2
      src/views/reportForms/cost-allocation-table.vue

+ 44 - 2
src/views/reportForms/cost-allocation-table.vue

@@ -376,6 +376,7 @@ export default {
             })
             this.$refs.unitTabs.ingData = oneData.syCostAllocationIngredientList
             this.$refs.unitTabs.shipData = oneData.syCostAllocationShipdetail
+            this.addAmountIng(oneData.syCostAllocationIngredientList)
             this.calculation(oneData.syCostAllocationShipdetail)
             //合计中面料相关金额
             var s=0
@@ -394,8 +395,8 @@ export default {
               s+=Number(item.priceExcludingtax),
               v+=Number(item.rmbAmount)
             })
-            this.$refs.unitTabs.sumInfo.ingExcludAmount = s.toFixed(3),//辅料不含税金额合计
-            this.$refs.unitTabs.sumInfo.ingAmount =v.toFixed(3)//辅料金额合计
+            this.$refs.unitTabs.sumInfo.ingExcludAmount = (s/2).toFixed(3),//辅料不含税金额合计
+            this.$refs.unitTabs.sumInfo.ingAmount =(v/2).toFixed(3)//辅料金额合计
             //合计中出运明细相关金额
             var s =0,
             v = 0,
@@ -463,6 +464,47 @@ export default {
         }
         this.$refs.unitTabs.shipData.push(allObj)
     },
+    //辅料中的合计行
+    addAmountIng(val){
+      debugger
+      var ingredientsTransferQuantityALll = 0,
+      transferCostAll =0,
+      usageQuantityAll = 0,
+      purchaseQuantityAll = 0,
+      ingredientsRemainingQuantityAll = 0,
+      lossAll = 0,
+      rmbAmountAll = 0,
+      usdAmountAll = 0,
+      priceExcludingtaxAll = 0,
+      dosageAll = 0
+        val.map(item=>{
+          ingredientsTransferQuantityALll+=Number(item.ingredientsTransferQuantity)
+          transferCostAll+=Number(item.transferCost)
+          usageQuantityAll+=Number(item.usageQuantity)
+          purchaseQuantityAll+=Number(item.purchaseQuantity)
+          ingredientsRemainingQuantityAll+=Number(item.ingredientsRemainingQuantity)
+          lossAll+=Number(item.loss)
+          rmbAmountAll+=Number(item.rmbAmount)
+          usdAmountAll+=Number(item.usdAmount)
+          priceExcludingtaxAll+=Number(item.priceExcludingtax)
+          dosageAll+=Number(item.dosage)
+        })
+      var allObj ={
+          goodsName:'合计',
+          ingredientsTransferQuantity:ingredientsTransferQuantityALll.toFixed(3),
+          transferCost:transferCostAll.toFixed(3),
+          usageQuantity:usageQuantityAll.toFixed(3),
+          purchaseQuantity:purchaseQuantityAll.toFixed(3),
+          ingredientsRemainingQuantity:ingredientsRemainingQuantityAll.toFixed(3),
+          loss:lossAll.toFixed(3),
+          rmbAmount:rmbAmountAll.toFixed(3),
+          usdAmount:usdAmountAll.toFixed(3),
+          priceExcludingtax:priceExcludingtaxAll.toFixed(3),
+          dosage:dosageAll.toFixed(3)
+        }
+        this.$refs.unitTabs.ingData.push(allObj)
+        debugger
+    },
     daYin(){
       //  printJS({
 	    //      printable:this.fabricLoss.fabricOMOrderList1,