From dd88e93db4dabeb69b7166c23ffdc364ee64bd9a Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Wed, 4 Jun 2025 16:13:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E7=89=88=E5=AF=BC=E5=87=BAexcelutil?= =?UTF-8?q?=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/excel-util.js | 2 +- src/views/modules/ecss/codelnotify.vue | 22 +++++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/utils/excel-util.js b/src/utils/excel-util.js index 663f767..93e0294 100644 --- a/src/utils/excel-util.js +++ b/src/utils/excel-util.js @@ -115,7 +115,7 @@ let export2Excel = opt => { message: resp.description }); } - let rows = options.rowFetcher(resp).rows; + let rows = !!resp.data.rows?options.rowFetcher(resp).rows:resp.data.page.list; var columns = [ [] ]; diff --git a/src/views/modules/ecss/codelnotify.vue b/src/views/modules/ecss/codelnotify.vue index 86e0f74..a030089 100644 --- a/src/views/modules/ecss/codelnotify.vue +++ b/src/views/modules/ecss/codelnotify.vue @@ -56,7 +56,8 @@ {{'导入'}} - {{'导出'}} + {{'导出发票'}} @@ -668,6 +669,7 @@ import delUploadExcel from "./del_upload_excel.vue"; import delDetailUploadExcel from "./del_detail_upload_excel.vue"; import {} from "@/api/sysLanguage.js" + import excel from "@/utils/excel-util.js"; import { searchEcssCoDelNotifyHeader, searchEcssCoDelNotifyDetail, @@ -2264,6 +2266,20 @@ 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) { const { columns } = param; const sums = [];