[update] 修改企标导出
This commit is contained in:
@@ -170,7 +170,6 @@ import UserSelectModal from '../../../components/selection/UserSelectModal'
|
|||||||
// 配置标准弹框
|
// 配置标准弹框
|
||||||
import AllocationStandardDrawer from './modules/AllocationStandardDrawer'
|
import AllocationStandardDrawer from './modules/AllocationStandardDrawer'
|
||||||
import { postDownFile } from '@/api/manage'
|
import { postDownFile } from '@/api/manage'
|
||||||
import Vue from 'vue'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'EnterpriseStandardList',
|
name: 'EnterpriseStandardList',
|
||||||
@@ -336,18 +335,18 @@ export default {
|
|||||||
document.getElementsByClassName('ant-modal-confirm-btns')[0].style = 'display:none'
|
document.getElementsByClassName('ant-modal-confirm-btns')[0].style = 'display:none'
|
||||||
})
|
})
|
||||||
postDownFile(this.url.exportXlsUrl, param).then((data) => {
|
postDownFile(this.url.exportXlsUrl, param).then((data) => {
|
||||||
if (!data || data.size === 0) {
|
if (!data) {
|
||||||
Vue.prototype.$message.warning('文件下载失败')
|
this.$message.warning('文件下载失败')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
||||||
window.navigator.msSaveBlob(new Blob([data]), fileName + '.zip')
|
window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xlsx')
|
||||||
} else {
|
} else {
|
||||||
const url = window.URL.createObjectURL(new Blob([data]))
|
const url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
|
||||||
const link = document.createElement('a')
|
const link = document.createElement('a')
|
||||||
link.style.display = 'none'
|
link.style.display = 'none'
|
||||||
link.href = url
|
link.href = url
|
||||||
link.setAttribute('download', fileName + '.zip')
|
link.setAttribute('download', fileName + '.xlsx')
|
||||||
document.body.appendChild(link)
|
document.body.appendChild(link)
|
||||||
link.click()
|
link.click()
|
||||||
document.body.removeChild(link) // 下载完成移除元素
|
document.body.removeChild(link) // 下载完成移除元素
|
||||||
|
|||||||
Reference in New Issue
Block a user