Commit 32738dac authored by 罗超's avatar 罗超

1

parent c9f04e15
...@@ -20,13 +20,13 @@ export default { ...@@ -20,13 +20,13 @@ export default {
if (res.data.data) { if (res.data.data) {
localStorage.removeItem("fujianTag"); localStorage.removeItem("fujianTag");
clearInterval(this.timer); clearInterval(this.timer);
localStorage.setItem("fujianUrl", res.data.data);
this.$confirm("有下载文件准备完成, 前往下载?", "提示", { this.$confirm("有下载文件准备完成, 前往下载?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "info", type: "info",
}).then(() => { }).then(() => {
this.$router.push("/billboardList"); this.$router.push("/billboardList");
this.downloadFujian(res.data.data);
}); });
} }
} else { } else {
...@@ -35,30 +35,6 @@ export default { ...@@ -35,30 +35,6 @@ export default {
} }
); );
}, },
downloadFujian(url) {
let a = document.createElement("a");
a.href = this.domainManager().DomainUrl + url;
a.download = "榜单附件.zip";
a.click();
setTimeout(() => {
this.delDownloadMultiplefujian(url);
}, 2000);
},
//删除附件
delDownloadMultiplefujian(url) {
this.apipost(
"/api/Trade/DelFirstShopEnrollZipExport",
{
Url: url,
},
(res) => {
if (res.data.resultCode == 1) {
} else {
this.$message.error(res.data.message);
}
}
);
},
}, },
mounted() { mounted() {
let tag = localStorage.getItem("fujianTag"); let tag = localStorage.getItem("fujianTag");
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
style="float: right; margin-top: -5px; margin-right: 10px" style="float: right; margin-top: -5px; margin-right: 10px"
size="small" size="small"
type="primary" type="primary"
@click="downloadFujian(fujianUrl)" @click="downloadFujian"
v-if="showfujianbtn" v-if="showfujianbtn"
>下载附件 >下载附件
</el-button> </el-button>
...@@ -544,14 +544,18 @@ export default { ...@@ -544,14 +544,18 @@ export default {
(res) => { (res) => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
if (res.data.data) { if (res.data.data) {
this.fujianLoading = false; this.fujianText = "附件准备完成";
this.fujianText = "榜单附件导出";
localStorage.removeItem("fujianTag"); localStorage.removeItem("fujianTag");
clearInterval(this.timer); clearInterval(this.timer);
this.fujianUrl = res.data.data;
localStorage.setItem("fujianUrl", res.data.data);
this.fujianUrl = res.data.data;
this.showfujianbtn = true;
if (this.$route.path == "/billboardList") { if (this.$route.path == "/billboardList") {
this.downloadFujian(res.data.data); this.$alert("下载文件准备完成", {
confirmButtonText: "确定",
callback: (action) => {},
});
} else { } else {
this.$confirm("有下载文件准备完成, 前往下载?", "提示", { this.$confirm("有下载文件准备完成, 前往下载?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
...@@ -559,7 +563,7 @@ export default { ...@@ -559,7 +563,7 @@ export default {
type: "info", type: "info",
}).then(() => { }).then(() => {
this.$router.push("/billboardList"); this.$router.push("/billboardList");
this.downloadFujian(this.fujianUrl); // this.downloadFujian(this.fujianUrl);
}); });
} }
} }
...@@ -569,14 +573,15 @@ export default { ...@@ -569,14 +573,15 @@ export default {
} }
); );
}, },
downloadFujian(url) { downloadFujian() {
let url = localStorage.getItem("fujianUrl");
let a = document.createElement("a"); let a = document.createElement("a");
a.href = this.domainManager().DomainUrl + url; a.href = this.domainManager().DomainUrl + "/" + url;
a.download = "榜单附件.zip"; a.download = "榜单附件.zip";
a.click(); a.click();
setTimeout(() => { setTimeout(() => {
this.delDownloadMultiplefujian(url); this.delDownloadMultiplefujian(url);
}, 2000); }, 10000);
}, },
//删除附件 //删除附件
delDownloadMultiplefujian(url) { delDownloadMultiplefujian(url) {
...@@ -587,6 +592,10 @@ export default { ...@@ -587,6 +592,10 @@ export default {
}, },
(res) => { (res) => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
localStorage.removeItem("fujianUrl");
this.fujianLoading = false;
this.fujianText = "榜单附件导出";
this.showfujianbtn = false;
} else { } else {
this.$message.error(res.data.message); this.$message.error(res.data.message);
} }
...@@ -594,7 +603,14 @@ export default { ...@@ -594,7 +603,14 @@ export default {
); );
}, },
}, },
mounted() {}, mounted() {
let url = localStorage.getItem("fujianUrl");
if (url) {
this.fujianLoading = true;
this.fujianText = "附件准备完成";
this.showfujianbtn = true;
}
},
}; };
</script> </script>
<style> <style>
......
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