|
@@ -883,7 +883,7 @@ export default {
|
|
},
|
|
},
|
|
data: qs.stringify(cleanDeep(data)),
|
|
data: qs.stringify(cleanDeep(data)),
|
|
url,
|
|
url,
|
|
- responseType: "blob",
|
|
|
|
|
|
+ responseType: "json",
|
|
};
|
|
};
|
|
this.$confirm("您确定导出报表", "提示", {
|
|
this.$confirm("您确定导出报表", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
@@ -893,30 +893,36 @@ export default {
|
|
.then(() => {
|
|
.then(() => {
|
|
load.startLoading();
|
|
load.startLoading();
|
|
axios(options).then((res) => {
|
|
axios(options).then((res) => {
|
|
- let blob = new Blob([res.data], {
|
|
|
|
- // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
|
|
|
|
- type: "application/vnd.ms-excel;charset=utf-8",
|
|
|
|
- //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
|
|
|
|
- });
|
|
|
|
- let objectUrl = URL.createObjectURL(blob);
|
|
|
|
- let link = document.createElement("a");
|
|
|
|
- let nowTime = new Date();
|
|
|
|
- let ymd =
|
|
|
|
- nowTime.getFullYear() +
|
|
|
|
- "" +
|
|
|
|
- (nowTime.getMonth() + 1) +
|
|
|
|
- "" +
|
|
|
|
- nowTime.getDate() +
|
|
|
|
- "" +
|
|
|
|
- nowTime.getHours() +
|
|
|
|
- "" +
|
|
|
|
- nowTime.getMinutes();
|
|
|
|
- let fname = "报表导出" + new Date().getTime() + ".xls"; //下载文件的名字
|
|
|
|
- link.href = objectUrl;
|
|
|
|
- link.setAttribute("download", fname);
|
|
|
|
- document.body.appendChild(link);
|
|
|
|
- link.click();
|
|
|
|
load.endLoading();
|
|
load.endLoading();
|
|
|
|
+ if(res.data.code == 200) {
|
|
|
|
+ this.$message.info(res.data.data);
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(res.data.msg);
|
|
|
|
+ }
|
|
|
|
+ // let blob = new Blob([res.data], {
|
|
|
|
+ // // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
|
|
|
|
+ // type: "application/vnd.ms-excel;charset=utf-8",
|
|
|
|
+ // //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
|
|
|
|
+ // });
|
|
|
|
+ // let objectUrl = URL.createObjectURL(blob);
|
|
|
|
+ // let link = document.createElement("a");
|
|
|
|
+ // let nowTime = new Date();
|
|
|
|
+ // let ymd =
|
|
|
|
+ // nowTime.getFullYear() +
|
|
|
|
+ // "" +
|
|
|
|
+ // (nowTime.getMonth() + 1) +
|
|
|
|
+ // "" +
|
|
|
|
+ // nowTime.getDate() +
|
|
|
|
+ // "" +
|
|
|
|
+ // nowTime.getHours() +
|
|
|
|
+ // "" +
|
|
|
|
+ // nowTime.getMinutes();
|
|
|
|
+ // let fname = "报表导出" + new Date().getTime() + ".xls"; //下载文件的名字
|
|
|
|
+ // link.href = objectUrl;
|
|
|
|
+ // link.setAttribute("download", fname);
|
|
|
|
+ // document.body.appendChild(link);
|
|
|
|
+ // link.click();
|
|
|
|
+ // load.endLoading();
|
|
});
|
|
});
|
|
})
|
|
})
|
|
.catch(() => {});
|
|
.catch(() => {});
|