Pārlūkot izejas kodu

成本分配表-事故单-增加合计行

jbb 2 gadi atpakaļ
vecāks
revīzija
a01d6e12f5
1 mainītis faili ar 20 papildinājumiem un 1 dzēšanām
  1. 20 1
      src/views/reportForms/cost-allocation-table.vue

+ 20 - 1
src/views/reportForms/cost-allocation-table.vue

@@ -320,7 +320,7 @@ export default {
           className: 'replacecolor' ,
           customRender: (text, record, index) => {
             if(text!==''&&text){
-              return Number(text).toFixed(4)
+              return Number(text).toFixed(2)
             }
           },
         },
@@ -443,6 +443,7 @@ export default {
             this.$refs.unitTabs.shipData = oneData.syCostAllocationShipdetail
             this.addAmountIng(oneData.syCostAllocationIngredientList)
             this.addAmountCostPay(this.costPayData)
+            this.addAccident(this.accidentListData)
             this.calculation(oneData.syCostAllocationShipdetail)
             //合计中面料相关金额
             var s=0
@@ -615,6 +616,24 @@ export default {
      if(this.$refs.unitTabs.ingData[this.$refs.unitTabs.ingData.length-1].goodsName=='合计'){this.$refs.unitTabs.ingData.pop()}
         if(this.$refs.unitTabs.ingData.length!==0 ){  this.$refs.unitTabs.ingData.push(allObj)}
     },
+    //事故单合计行
+    addAccident(val){
+     var amountAll=0,
+     amountrmbAll=0
+     val.map(item=>{
+      if(item.accidentUndertaker!=='合计'){
+        amountAll+=Number(item.amount) 
+        amountrmbAll+=Number(item.amountrmb)  
+      }
+     })
+     var allObj={
+      accidentUndertaker:'合计',
+      amount:amountAll,
+      amountrmb:amountrmbAll
+     }
+     if(this.accidentListData[this.accidentListData.length-1].goodsName=='合计'){this.accidentListData.pop()}
+        if(this.accidentListData.length!==0 ){  this.accidentListData.push(allObj)}
+    },
     //费用支出合计行
     addAmountCostPay(val){
       var disbursedLocalmoneyALL=0,