|
@@ -155,7 +155,7 @@
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
<div class="bg-white top" style="">
|
|
|
- <vxe-toolbar :refresh="{query: refreshList}" custom>
|
|
|
+ <vxe-toolbar :refresh="{query: refreshList}" export custom>
|
|
|
<template #buttons>
|
|
|
<el-button v-if="hasPermission('finance:invoice:add')" type="primary" size="small" icon="el-icon-plus" @click="start()">新建</el-button>
|
|
|
<!-- <el-button v-if="hasPermission('finance:invoice:del')" type="danger" size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.invoiceTable && $refs.invoiceTable.getCheckboxRecords().length === 0" plain>删除</el-button>-->
|
|
@@ -175,6 +175,14 @@
|
|
|
highlight-hover-row
|
|
|
:menu-config="{}"
|
|
|
@sort-change="sortChangeHandle"
|
|
|
+ :export-config="{
|
|
|
+ remote: true,
|
|
|
+ filename: `兴光评估发票数据${moment(new Date()).format('YYYY-MM-DD')}`,
|
|
|
+ sheetName: `兴光评估发票数据${moment(new Date()).format('YYYY-MM-DD')}`,
|
|
|
+ exportMethod: exportMethod,
|
|
|
+ types: ['xlsx'],
|
|
|
+ modes: ['current', 'selected', 'all']
|
|
|
+ }"
|
|
|
:sort-config="{remote:true}"
|
|
|
:data="dataList"
|
|
|
:checkbox-config="{}">
|
|
@@ -417,24 +425,24 @@
|
|
|
} else {
|
|
|
item.programName = ''
|
|
|
}
|
|
|
- if (!this.commonJS.isEmpty(item.financeInvoiceDetailDTOList)) {
|
|
|
- item.accountDetail = 0
|
|
|
- let num = ''
|
|
|
- item.financeInvoiceDetailDTOList.forEach((detail, index) => {
|
|
|
- if (!this.commonJS.isEmpty(detail.account)) {
|
|
|
- item.accountDetail = parseFloat(parseFloat(item.accountDetail) + parseFloat(detail.account)).toFixed(2)
|
|
|
- }
|
|
|
- if ((index + 1) !== item.financeInvoiceDetailDTOList.length) {
|
|
|
- num = num + detail.number + ','
|
|
|
- } else {
|
|
|
- num = num + detail.number
|
|
|
- }
|
|
|
- })
|
|
|
- item.number = num
|
|
|
- } else {
|
|
|
- item.number = ''
|
|
|
- item.accountDetail = ''
|
|
|
- }
|
|
|
+ // if (!this.commonJS.isEmpty(item.financeInvoiceDetailDTOList)) {
|
|
|
+ // item.accountDetail = 0
|
|
|
+ // let num = ''
|
|
|
+ // item.financeInvoiceDetailDTOList.forEach((detail, index) => {
|
|
|
+ // if (!this.commonJS.isEmpty(detail.account)) {
|
|
|
+ // item.accountDetail = parseFloat(parseFloat(item.accountDetail) + parseFloat(detail.account)).toFixed(2)
|
|
|
+ // }
|
|
|
+ // if ((index + 1) !== item.financeInvoiceDetailDTOList.length) {
|
|
|
+ // num = num + detail.number + ','
|
|
|
+ // } else {
|
|
|
+ // num = num + detail.number
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // item.number = num
|
|
|
+ // } else {
|
|
|
+ // item.number = ''
|
|
|
+ // item.accountDetail = ''
|
|
|
+ // }
|
|
|
})
|
|
|
this.tablePage.total = data.total
|
|
|
this.loading = false
|
|
@@ -713,6 +721,31 @@
|
|
|
clearProgram () {
|
|
|
this.searchForm.programName = ''
|
|
|
this.searchForm.programId = ''
|
|
|
+ },
|
|
|
+ // 自定义服务端导出
|
|
|
+ exportMethod ({ options }) {
|
|
|
+ // 传给服务端的参数
|
|
|
+ const params = {
|
|
|
+ 'current': this.tablePage.currentPage,
|
|
|
+ 'size': this.tablePage.pageSize,
|
|
|
+ 'orders': this.tablePage.orders,
|
|
|
+ ...this.searchForm,
|
|
|
+ filename: options.filename,
|
|
|
+ sheetName: options.sheetName,
|
|
|
+ isHeader: options.isHeader,
|
|
|
+ original: options.original,
|
|
|
+ mode: options.mode,
|
|
|
+ selectIds: options.mode === 'selected' ? options.data.map(item => item.id) : [],
|
|
|
+ exportFields: options.columns.map(column => column.property)
|
|
|
+ }
|
|
|
+ return this.financeInvoiceService.exportFile(params).then((res) => {
|
|
|
+ // 将二进制流文件写入excel表,以下为重要步骤
|
|
|
+ this.$utils.downloadExcel(res.data, options.filename)
|
|
|
+ }).catch(function (err) {
|
|
|
+ if (err.response) {
|
|
|
+ console.log(err.response)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|