Browse Source

新版导出excelutil适配

java8
han\hanst 8 months ago
parent
commit
dd88e93db4
  1. 2
      src/utils/excel-util.js
  2. 22
      src/views/modules/ecss/codelnotify.vue

2
src/utils/excel-util.js

@ -115,7 +115,7 @@ let export2Excel = opt => {
message: resp.description message: resp.description
}); });
} }
let rows = options.rowFetcher(resp).rows;
let rows = !!resp.data.rows?options.rowFetcher(resp).rows:resp.data.page.list;
var columns = [ var columns = [
[] []
]; ];

22
src/views/modules/ecss/codelnotify.vue

@ -56,7 +56,8 @@
</el-form-item> </el-form-item>
<el-form-item :label="' '" > <el-form-item :label="' '" >
<el-button @click="importModel()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'导入'}}</el-button> <el-button @click="importModel()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'导入'}}</el-button>
<download-excel
<el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{'导出'}}</el-button>
<!-- <download-excel
:fields="fields()" :fields="fields()"
:data="exportData" :data="exportData"
type="xls" type="xls"
@ -67,9 +68,9 @@
:before-generate="startDownload" :before-generate="startDownload"
:before-finish="finishDownload" :before-finish="finishDownload"
worksheet="导出信息" worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
class="el-button el-button&#45;&#45;primary el-button&#45;&#45;medium">
{{ '导出' }} {{ '导出' }}
</download-excel>
</download-excel>-->
</el-form-item> </el-form-item>
<el-form-item label=" "> <el-form-item label=" ">
<el-button @click="exportInvoiceList()" type="primary" style="margin-left: 2px">{{'导出发票'}}</el-button> <el-button @click="exportInvoiceList()" type="primary" style="margin-left: 2px">{{'导出发票'}}</el-button>
@ -668,6 +669,7 @@
import delUploadExcel from "./del_upload_excel.vue"; import delUploadExcel from "./del_upload_excel.vue";
import delDetailUploadExcel from "./del_detail_upload_excel.vue"; import delDetailUploadExcel from "./del_detail_upload_excel.vue";
import {} from "@/api/sysLanguage.js" import {} from "@/api/sysLanguage.js"
import excel from "@/utils/excel-util.js";
import { import {
searchEcssCoDelNotifyHeader, searchEcssCoDelNotifyHeader,
searchEcssCoDelNotifyDetail, searchEcssCoDelNotifyDetail,
@ -2264,6 +2266,20 @@
return s return s
}, },
async exportExcel() {
this.searchData.limit = -1
this.searchData.page = 1
excel.exportTable({
url: "/ecss/coDel/searchEcssCoDelNotifyHeader",
columnMapping: this.columnList1,//table
mergeSetting: [],//
params: this.searchData,
fileName: this.exportName+".xlsx",
rowFetcher: res => res.data,
columnFormatter: [],
dropColumns: [],//dropColumns: ["netWeight"]
});
},
getSummaries(param) { getSummaries(param) {
const { columns } = param; const { columns } = param;
const sums = []; const sums = [];

Loading…
Cancel
Save