<el-dialog :title="$t('changeView.summary')" :visible.sync="dialogTableVisible" width="70%">
<el-table :data="gridData" border>
<el-table-column property="payChannelCode" :label="$t('changeView.paychan')" :label-width="tableColWidth"></el-table-column>
<el-table-column property="num" :label="$t('changeView.volume')" :label-width="tableColWidth"></el-table-column>
<el-table-column property="sum" :label="$t('changeView.refundAmount')" :label-width="tableColWidth"></el-table-column>
<el-table-column property="channlFee" :label="$t('changeView.fee1')" :label-width="tableColWidth"></el-table-column>
<el-table-column property="totalAmount" :label="$t('changeView.totalAmount')" :label-width="tableColWidth"></el-table-column>
<el-table-column :label="$t('changeView.action')" :label-width="tableColWidth">
<template slot-scope="scope">
<el-button type="primary" plain @click="refund_tuikuan = true">{{$t('changeView.tuikuan')}}</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
grepPayChannel(channel) {
//1. payChannelCode 筛选出所有PAYTM的数据
let ptmArray = [] //这里新建了一个数组 存放 以ptm渠道退款的数据
let sumPtm = 0 //这里是支付的金额 初始定为0
let channlFee = 0 //手续费 同上
let totalAmount = 0
let num = 0
// 这里看下面的checkRefund 对this.multipleSelection 数据 进行遍历
this.multipleSelection.forEach( (item) => {
// 这里用一个if语句 对数据进行一个过滤 item.payChannelCode. 然后对其字母大小写 进行一个转换 成大写
if ( channel == item.payChannelCode.toUpperCase()) {
// 在这里 对得到的金额 进行一个累加 以10 进制 然后取整 下面的手续费也一样, 之后把得到的数据 push进新数组
sumPtm += parseInt(item.amount,10);
channlFee += parseInt(item.commissionAmt,10);
totalAmount = sumPtm+channlFee;
num = this.multipleSelection.length;
ptmArray.push(item)
}
})
// console.log('the PTM is and sum is and fee is',JSON.stringify(ptmArray),sumPtm,channlFee,totalAmount)
this.gridData = ptmArray.map(item => ({
'payChannelCode': item.payChannelCode,
'sum': sumPtm,
'amount': item.amount,
channlFee,
totalAmount,
num
}))
},