|
|
@ -122,7 +122,7 @@ |
|
|
|
class="diy-button--reset" |
|
|
|
@click="resetSearch">重置</el-button> |
|
|
|
<el-button style="margin-left:10px" |
|
|
|
class="diy-button--reset" |
|
|
|
class="diy-button--add" |
|
|
|
size="small" |
|
|
|
@click="handleExport">导出</el-button> |
|
|
|
</div> |
|
|
@ -470,21 +470,41 @@ export default { |
|
|
|
|
|
|
|
//导出表格 |
|
|
|
async handleExport () { |
|
|
|
let title = '核酸检测关注名单' |
|
|
|
|
|
|
|
const url = "/epmetuser/icEpidemicSpecialAttention/vaccination-export" |
|
|
|
this.exportBtn = true |
|
|
|
this.exportBtnTitle = '正在导出...' |
|
|
|
let params = { |
|
|
|
...this.formData |
|
|
|
} |
|
|
|
|
|
|
|
app.ajax.exportFilePost( |
|
|
|
url, |
|
|
|
this.formData, |
|
|
|
(data, rspMsg) => { |
|
|
|
|
|
|
|
this.download(data, title + '.xlsx') |
|
|
|
}, |
|
|
|
(rspMsg, data) => { |
|
|
|
this.$message.error(rspMsg); |
|
|
|
} |
|
|
|
); |
|
|
|
await this.$http({ |
|
|
|
method: 'POST', |
|
|
|
url: '/heart/policy/export-resiuser', |
|
|
|
responseType: 'blob', |
|
|
|
data: params |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
|
|
|
|
console.log('resllll', res) |
|
|
|
let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1]) |
|
|
|
console.log('filename', fileName) |
|
|
|
let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' }) |
|
|
|
var url = window.URL.createObjectURL(blob) |
|
|
|
var aLink = document.createElement('a') |
|
|
|
aLink.style.display = 'none' |
|
|
|
aLink.href = url |
|
|
|
aLink.setAttribute('download', fileName) |
|
|
|
document.body.appendChild(aLink) |
|
|
|
aLink.click() |
|
|
|
document.body.removeChild(aLink) //下载完成移除元素 |
|
|
|
window.URL.revokeObjectURL(url) //释放掉blob对象 |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log('获取导出情失败', err) |
|
|
|
this.$message.error('获取导出失败') |
|
|
|
}) |
|
|
|
this.exportBtnTitle = '导出' |
|
|
|
this.exportBtn = false |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|