Commit 5e145b08 authored by 黄奎's avatar 黄奎

111

parent a5a9eedf
...@@ -323,7 +323,7 @@ ...@@ -323,7 +323,7 @@
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
clearInterval(this.download_timer); clearInterval(this.download_timer);
this.checkedCities = []; this.checkedCities = [];
this.loadingText = "正在下载品牌文件,请勿关闭或刷新页面...";; this.loadingText = "正在下载品牌文件,请勿关闭或刷新页面...";
var fileUrl = res.data.data.fileUrl; var fileUrl = res.data.data.fileUrl;
var filepath = res.data.data.filePath; var filepath = res.data.data.filePath;
var key = res.data.message; var key = res.data.message;
...@@ -346,20 +346,40 @@ ...@@ -346,20 +346,40 @@
// linkObj.setAttribute("download", "品牌信息.xls"); // linkObj.setAttribute("download", "品牌信息.xls");
// linkObj.click(); // linkObj.click();
that.GetLocalFile("/api/Trade/GetFile", params, "品牌信息.xls", null, var apiurl = that.domainManager().DomainUrl + "/api/Trade/GetFile";
() => { var postData = that.GetPostData("", params, "");
that.downLoadLoading = false; that.$http.post(apiurl, postData, {
that.loadingText = ""; responseType: 'arraybuffer',
that.apipost("/api/Trade/DeleteKey", deleteparams, (res) => { onDownloadProgress: (progressEvent) => {
const progress = Math.round((progressEvent.loaded / progressEvent.total) * 100);
}) that.loadingText = `正在下载品牌文件` + progress + `%,请勿关闭或刷新页面...`;
that.dialogVisible = false; // 在这里处理下载进度, 如更新界面上的进度条
} }
); }).then((res) => {
let blob = new Blob([res.data], {
type: "application/vnd.ms-excel"
})
let url = URL.createObjectURL(blob);
let link = document.createElement('a');
link.href = url;
link.setAttribute("download", fileName);
document.body.appendChild(link);
link.click();
that.downLoadLoading = false;
that.loadingText = "";
that.apipost("/api/Trade/DeleteKey", deleteparams, (res) => {
})
that.dialogVisible = false;
}).catch(function (res) {});
} }
} }
); );
}, },
getDown() { getDown() {
this.cityOptions = []; this.cityOptions = [];
this.apipost("/api/Trade/GetBusinessExportEnumList", {}, (res) => { this.apipost("/api/Trade/GetBusinessExportEnumList", {}, (res) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment