正在显示
1 个修改的文件
包含
20 行增加
和
0 行删除
| @@ -119,6 +119,7 @@ | @@ -119,6 +119,7 @@ | ||
| 119 | 119 | ||
| 120 | <script> | 120 | <script> |
| 121 | 121 | ||
| 122 | + import { downFile } from '@/api/manage' | ||
| 122 | import { JeecgListMixin } from '@/mixins/JeecgListMixin' | 123 | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| 123 | import { mixinDevice } from '@/utils/mixin' | 124 | import { mixinDevice } from '@/utils/mixin' |
| 124 | import TblTradePriceInquiryModal from './modules/TblTradePriceInquiryModal' | 125 | import TblTradePriceInquiryModal from './modules/TblTradePriceInquiryModal' |
| @@ -230,6 +231,25 @@ | @@ -230,6 +231,25 @@ | ||
| 230 | }, | 231 | }, |
| 231 | downloadBidFile(record) { | 232 | downloadBidFile(record) { |
| 232 | console.log('下载文件', record) | 233 | console.log('下载文件', record) |
| 234 | + downFile(this.url.exportXlsUrl, record).then((data) => { | ||
| 235 | + if (!data) { | ||
| 236 | + this.$message.warning('文件下载失败') | ||
| 237 | + return | ||
| 238 | + } | ||
| 239 | + if (typeof window.navigator.msSaveBlob !== 'undefined') { | ||
| 240 | + window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), '投标文件' + '.xls') | ||
| 241 | + } else { | ||
| 242 | + let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' })) | ||
| 243 | + let link = document.createElement('a') | ||
| 244 | + link.style.display = 'none' | ||
| 245 | + link.href = url | ||
| 246 | + link.setAttribute('download', '投标文件' + '.xls') | ||
| 247 | + document.body.appendChild(link) | ||
| 248 | + link.click() | ||
| 249 | + document.body.removeChild(link) // 下载完成移除元素 | ||
| 250 | + window.URL.revokeObjectURL(url) // 释放掉blob对象 | ||
| 251 | + } | ||
| 252 | + }) | ||
| 233 | }, | 253 | }, |
| 234 | 254 | ||
| 235 | handleExpand(expanded, record) { | 255 | handleExpand(expanded, record) { |
-
请 注册 或 登录 后发表评论