|
|
@@ -441,17 +441,7 @@ export default {
|
|
|
this.$message.error(res.msg)
|
|
|
return
|
|
|
}
|
|
|
- const url = window.URL.createObjectURL(new Blob([res], { type: 'application/vnd.ms-excel' }))
|
|
|
- const link = document.createElement('a')
|
|
|
- link.style.display = 'none'
|
|
|
- link.href = url
|
|
|
- const excelName = new Date().getTime() + '.xlsx'
|
|
|
- link.setAttribute('download', excelName)
|
|
|
- document.body.appendChild(link)
|
|
|
- link.click()
|
|
|
- link.remove()
|
|
|
- this.diaType = -1
|
|
|
- this.$message.success('导出成功')
|
|
|
+ this.download(res)
|
|
|
})
|
|
|
},
|
|
|
exportExcelTotal (item) {
|
|
|
@@ -462,18 +452,21 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
console.log(res)
|
|
|
- const url = window.URL.createObjectURL(new Blob([res], { type: 'application/vnd.ms-excel' }))
|
|
|
- const link = document.createElement('a')
|
|
|
- link.style.display = 'none'
|
|
|
- link.href = url
|
|
|
- const excelName = new Date().getTime() + '.xlsx'
|
|
|
- link.setAttribute('download', excelName)
|
|
|
- document.body.appendChild(link)
|
|
|
- link.click()
|
|
|
- link.remove()
|
|
|
- this.diaType = -1
|
|
|
- this.$message.success('导出成功')
|
|
|
+ this.download(res)
|
|
|
})
|
|
|
+ },
|
|
|
+ download (res) {
|
|
|
+ const url = window.URL.createObjectURL(new Blob([res], { type: 'application/vnd.ms-excel' }))
|
|
|
+ const link = document.createElement('a')
|
|
|
+ link.style.display = 'none'
|
|
|
+ link.href = url
|
|
|
+ const excelName = new Date().getTime() + '.xlsx'
|
|
|
+ link.setAttribute('download', excelName)
|
|
|
+ document.body.appendChild(link)
|
|
|
+ link.click()
|
|
|
+ link.remove()
|
|
|
+ this.diaType = -1
|
|
|
+ this.$message.success('导出成功')
|
|
|
}
|
|
|
}
|
|
|
}
|