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

111

parent a5a9eedf
......@@ -323,7 +323,7 @@
if (res.data.resultCode == 1) {
clearInterval(this.download_timer);
this.checkedCities = [];
this.loadingText = "正在下载品牌文件,请勿关闭或刷新页面...";;
this.loadingText = "正在下载品牌文件,请勿关闭或刷新页面...";
var fileUrl = res.data.data.fileUrl;
var filepath = res.data.data.filePath;
var key = res.data.message;
......@@ -346,20 +346,40 @@
// linkObj.setAttribute("download", "品牌信息.xls");
// linkObj.click();
that.GetLocalFile("/api/Trade/GetFile", params, "品牌信息.xls", null,
() => {
that.downLoadLoading = false;
that.loadingText = "";
that.apipost("/api/Trade/DeleteKey", deleteparams, (res) => {
})
that.dialogVisible = false;
var apiurl = that.domainManager().DomainUrl + "/api/Trade/GetFile";
var postData = that.GetPostData("", params, "");
that.$http.post(apiurl, postData, {
responseType: 'arraybuffer',
onDownloadProgress: (progressEvent) => {
const progress = Math.round((progressEvent.loaded / progressEvent.total) * 100);
that.loadingText = `正在下载品牌文件` + progress + `%,请勿关闭或刷新页面...`;
// 在这里处理下载进度, 如更新界面上的进度条
}
);
}).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() {
this.cityOptions = [];
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