浏览代码

成本分配表表头计算

jbb 2 年之前
父节点
当前提交
821e4fcd3f
共有 2 个文件被更改,包括 18 次插入12 次删除
  1. 16 10
      src/views/reportForms/cost-allocation-table.vue
  2. 2 2
      src/views/reportForms/cost-allocation-table/tabs.vue

+ 16 - 10
src/views/reportForms/cost-allocation-table.vue

@@ -103,7 +103,7 @@
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="8">
-              <a-form-model-item label="短出货值" prop="shortvalue" class="fontColor">
+              <a-form-model-item label="短出货值" prop="shortvalue" >
                 {{ detailsPlanNum.shortvalue }}
               </a-form-model-item>
             </a-col>
@@ -113,7 +113,7 @@
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="8">
-              <a-form-model-item label="事故单美金金额" prop="accidentUsdamount" class="fontColor">
+              <a-form-model-item label="事故单美金金额" prop="accidentUsdamount" >
                 {{ detailsPlanNum.accidentUsdamount }}
               </a-form-model-item>
             </a-col>
@@ -133,7 +133,7 @@
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="8">
-              <a-form-model-item label="事故单人民币金额" prop="accidentcnyAmount" class="fontColor">
+              <a-form-model-item label="事故单人民币金额" prop="accidentcnyAmount" >
                 {{ detailsPlanNum.accidentcnyAmount }}
               </a-form-model-item>
             </a-col>
@@ -334,7 +334,7 @@ export default {
              this.loading = false
             this.detailsPlanNum = res.result //所有详情
             this.accidentListData = res.result.syCostAllocationAccidentList //事故单
-            // this.accidentCalculation(this.accidentListData)
+            this.accidentCalculation(this.accidentListData)
             var accidentNum = 0
             this.accidentListData.map(item =>{
               item.id = accidentNum + 1
@@ -399,7 +399,7 @@ export default {
       })
     },
 
-    //计算
+    //计算短出货值
     calculation(val){
       var  average = 0
        val.map(item=>{
@@ -407,11 +407,17 @@ export default {
        })
        this.detailsPlanNum.shortvalue = this.detailsPlanNum.shortseveral*average
     },
-    // accidentCalculation(val){
-    //   val.map(item=>{
-    //     debugger
-    //   })
-    // },
+    //计算事故单美元金额和事故单人民币金额
+    accidentCalculation(val){
+      var usaMoney = 0,
+          rmbMoney = 0
+      val.map(item=>{
+        usaMoney += item.amount,
+        rmbMoney+=item.rmbAmount
+      })
+      this.detailsPlanNum.accidentUsdamount = usaMoney
+      this.detailsPlanNum.accidentcnyAmount = usaMoney
+    },
 
     // 页面 保存
     save() {

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

@@ -205,11 +205,11 @@ export default {
           scopedSlots: { customRender: 'fabInQuaSlot' },
         },
         {
-          title: '转入成本',
+          // title: '转入成本',
           dataIndex: 'transferCost',
           width: 120,
           className: 'replacecolor',
-          // slots:{title:'transferCostTitle'} ,
+          slots:{title:'transferCostTitle'} ,
         },
 
         { title: '单耗/件', dataIndex: 'unitConsumption', width: 120, className: 'replacecolor' },