瀏覽代碼

成本分配表-事故单-字段调整

jbb 2 年之前
父節點
當前提交
01cbde1566
共有 1 個文件被更改,包括 14 次插入6 次删除
  1. 14 6
      src/views/reportForms/cost-allocation-table.vue

+ 14 - 6
src/views/reportForms/cost-allocation-table.vue

@@ -302,8 +302,11 @@ export default {
           scopedSlots: { customRender: 'accidentNum' }
         },
         { title: '事故承担方', width: 120, dataIndex: 'accidentUndertaker', className: 'replacecolor' },
-        { title: '金额', width: 120, dataIndex: 'amount', className: 'replacecolor' },
-        { title: '币种', width: 120, dataIndex: 'moneyType', className: 'replacecolor' },
+        { title: '美元金额', width: 120, dataIndex: 'amount', className: 'replacecolor' },
+        { title: '人民币金额', width: 120, dataIndex: 'amountrmb', className: 'replacecolor' },
+        { title: '事故单主题', width: 120, dataIndex: 'accidentTheme', className: 'replacecolor' },
+        { title: '责任人', width: 120, dataIndex: 'responsibilityPerson1', className: 'replacecolor' },
+        // { title: '币种', width: 120, dataIndex: 'moneyType', className: 'replacecolor' },
         // { title: '金额', dataIndex: 'amount', width: 120, className: 'replacecolor' }
       ],
       accidentListData: [],
@@ -588,11 +591,16 @@ export default {
       var usaMoney = 0,
           rmbMoney = 0
       val.map(item=>{
-        usaMoney += item.amount,
-        rmbMoney+=item.rmbAmount
+        if(item.accidentType=='应补' && item.amount!==''&&item.amount&&item.amount!=='0'){
+           item.amount=Number(item.amount)*(-1)
+        }else if(item.accidentType=='应补' && item.amountrmb!==''&&item.amountrmb&&item.amountrmb!=='0'){
+          item.amountrmb = Number(item.amountrmb)*(-1)
+        }
+        usaMoney += Number(item.amount),
+        rmbMoney+=Number(item.amountrmb)
       })
-      this.detailsPlanNum.accidentUsdamount = usaMoney
-      this.detailsPlanNum.accidentcnyAmount = usaMoney
+      this.detailsPlanNum.accidentUsdamount = usaMoney.toFixed(2)
+      this.detailsPlanNum.accidentcnyAmount = rmbMoney.toFixed(2)
     },
 
     // 页面 保存