a href="#" @click="templateDownload()"模板下载/a //模板下载 templateDownload() { this.$axios({ url: ‘/chenfan_refuse/otherRecord/otherRecordExcelDownload‘, method: ‘get‘, responseType: ‘blob‘ }).then((data) = { const blo
<a href="#" @click="templateDownload()">模板下载</a>
//模板下载
templateDownload() {
this.$axios({
url: ‘/chenfan_refuse/otherRecord/otherRecordExcelDownload‘,
method: ‘get‘,
responseType: ‘blob‘
}).then((data) => {
const blob = new Blob([data], { type: ‘text/plain;charset=utf-8‘ })
const url = window.URL.createObjectURL(blob)
const a = document.createElement(‘a‘)
a.href = url
a.download = ‘其它入库单新建.xlsx‘
document.body.appendChild(a)
a.click()
window.URL.revokeObjectURL(url)
document.body.removeChild(a)
this.$Loading.finish();//结束进度条
})
},