From e7faf6e621bb99b461e69c31b4156e0a37fc6009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E8=AF=9D?= <752718920@qq.com> Date: Tue, 3 May 2022 11:07:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96excel=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E7=9A=84=E6=96=87=E4=BB=B6=E6=A0=BC=E5=BC=8F=E5=92=8C=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jshERP-web/src/mixins/JeecgListMixin.js | 4 ++-- jshERP-web/src/utils/util.js | 2 +- jshERP-web/src/views/system/modules/CustomerModal.vue | 2 +- jshERP-web/src/views/system/modules/VendorModal.vue | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/jshERP-web/src/mixins/JeecgListMixin.js b/jshERP-web/src/mixins/JeecgListMixin.js index 9a0490eb..8cfedc16 100644 --- a/jshERP-web/src/mixins/JeecgListMixin.js +++ b/jshERP-web/src/mixins/JeecgListMixin.js @@ -3,7 +3,7 @@ * 高级查询按钮调用 superQuery方法 高级查询组件ref定义为superQueryModal * data中url定义 list为查询列表 delete为删除单条记录 deleteBatch为批量删除 */ -import { filterObj } from '@/utils/util'; +import { filterObj,getNowFormatStr } from '@/utils/util'; import { deleteAction, getAction, postAction, downFile, getFileAccessHttpUrl } from '@/api/manage' import Vue from 'vue' import { ACCESS_TOKEN } from "@/store/mutation-types" @@ -301,7 +301,7 @@ export const JeecgListMixin = { let link = document.createElement('a') link.style.display = 'none' link.href = url - link.setAttribute('download', fileName+'.xls') + link.setAttribute('download', fileName + '_' + getNowFormatStr()+'.xls') document.body.appendChild(link) link.click() document.body.removeChild(link); //下载完成移除元素 diff --git a/jshERP-web/src/utils/util.js b/jshERP-web/src/utils/util.js index 4e796c32..e96984ec 100644 --- a/jshERP-web/src/utils/util.js +++ b/jshERP-web/src/utils/util.js @@ -618,7 +618,7 @@ export function openDownloadDialog (url, saveName) { } let aLink = document.createElement('a') aLink.href = url - saveName = saveName + '_' + getNowFormatStr() + '.xlsx' + saveName = saveName + '_' + getNowFormatStr() + '.xls' aLink.download = saveName || '' // HTML5新增的属性,指定保存文件名,可以不要后缀,注意,file:///模式下不会生效 let event if (window.MouseEvent) event = new MouseEvent('click') diff --git a/jshERP-web/src/views/system/modules/CustomerModal.vue b/jshERP-web/src/views/system/modules/CustomerModal.vue index f9545da5..20a2b319 100644 --- a/jshERP-web/src/views/system/modules/CustomerModal.vue +++ b/jshERP-web/src/views/system/modules/CustomerModal.vue @@ -63,7 +63,7 @@ - + diff --git a/jshERP-web/src/views/system/modules/VendorModal.vue b/jshERP-web/src/views/system/modules/VendorModal.vue index 6b4710f7..fe8fddaf 100644 --- a/jshERP-web/src/views/system/modules/VendorModal.vue +++ b/jshERP-web/src/views/system/modules/VendorModal.vue @@ -63,7 +63,7 @@ - +