<el-button :loading="downloadLoading" class="filter-item" type="text" size="mini" icon="el-icon-download" @click="handleDownload(scope.row)">导出</el-button>
data() {
return {
downloadLoading: false,
list: []
};
},
methods:{
handleDownload(row) {
this.downloadLoading = true
const parmas = {
limit: 1000000,
page: 1,
billType: "",
endTime: row.bDate + ' 23:59:59',
startTime: row.bDate + ' 00:00:00',
tradeNo: ""
}
billDetails(parmas)
.then((res) => {
if (res.data.errno == 0) {
this.list = res.data.data.list
this.down()
}
})
.catch((response) => {
MessageBox.alert(response.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
})
})
},
down(){
import('@/vendor/Export2Excel').then(excel => {
const tHeader = [
'收支类型',
'入账时间',
'名称',
'订单编号',
'支付流水号',
'金额(元)',
'余额(元)'
]
const filterVal = ['tradeTypeLable', 'addTime', 'title', 'orderSn', 'tradeNo', 'tradeAmount','changeAfterBalance'
]
excel.export_json_to_excel2(
tHeader,
this.list,
filterVal,
'对账单明细'
)
this.downloadLoading = false
})
},
}