|
@@ -47,9 +47,7 @@ const checkSMonth = (time) => {
|
|
|
}
|
|
|
|
|
|
const refreshTableData = (month) => {
|
|
|
- console.log(month);
|
|
|
postForReportInfoBySMonth(month).then(res => {
|
|
|
- console.log(res);
|
|
|
if (res.success) {
|
|
|
tableData.value = res.data
|
|
|
} else {
|
|
@@ -58,10 +56,17 @@ const refreshTableData = (month) => {
|
|
|
}).catch(() => ElMessage.error("出错了"))
|
|
|
}
|
|
|
|
|
|
-// TODO download还未实现
|
|
|
const handleDownload = (scope) => {
|
|
|
postForDownload(scope.row)
|
|
|
- .then(res => console.log(res))
|
|
|
+ .then(res => {
|
|
|
+ let blob = new Blob([res])
|
|
|
+ let url = window.URL.createObjectURL(blob)
|
|
|
+ let a = document.createElement('a')
|
|
|
+ a.href = url
|
|
|
+ a.download = scope.row.displayName
|
|
|
+ a.click()
|
|
|
+ window.URL.revokeObjectURL(url)
|
|
|
+ })
|
|
|
.catch(() => ElMessage.error("出错了"))
|
|
|
}
|
|
|
|