|
@@ -145,23 +145,23 @@ export default {
|
|
handleDownload() {
|
|
handleDownload() {
|
|
this.$http({
|
|
this.$http({
|
|
url: "/market/CMKIssued/exportCMKIssuedReplyStatistics",
|
|
url: "/market/CMKIssued/exportCMKIssuedReplyStatistics",
|
|
- method: "get",
|
|
|
|
|
|
+ method: "post",
|
|
headers: {
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
"Content-Type": "application/json",
|
|
},
|
|
},
|
|
responseType: "blob",
|
|
responseType: "blob",
|
|
data: {
|
|
data: {
|
|
...this.table_search,
|
|
...this.table_search,
|
|
- time: this.table_search.time ? this.table_search.time : "",
|
|
|
|
|
|
+ time: this.table_search.time ? this.$formatDate(this.table_search.time, "YYYY-MM") : '',
|
|
},
|
|
},
|
|
}).then((response) => {
|
|
}).then((response) => {
|
|
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
|
|
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
|
|
let blob = new Blob([response.data], {
|
|
let blob = new Blob([response.data], {
|
|
type: "application/vnd.ms-excel",
|
|
type: "application/vnd.ms-excel",
|
|
});
|
|
});
|
|
|
|
+ let month = this.table_search.time ? this.$formatDate(this.table_search.time, "YYYY年MM月") : ''
|
|
window.navigator.msSaveOrOpenBlob(
|
|
window.navigator.msSaveOrOpenBlob(
|
|
- blob,
|
|
|
|
- this.dataBody.table.tabName + ".xlsx"
|
|
|
|
|
|
+ blob,`${month}回复统计.xlsx`
|
|
);
|
|
);
|
|
} else {
|
|
} else {
|
|
/* 火狐谷歌的文件下载方式 */
|
|
/* 火狐谷歌的文件下载方式 */
|
|
@@ -169,42 +169,43 @@ export default {
|
|
var downloadElement = document.createElement("a");
|
|
var downloadElement = document.createElement("a");
|
|
var href = window.URL.createObjectURL(blob);
|
|
var href = window.URL.createObjectURL(blob);
|
|
downloadElement.href = href;
|
|
downloadElement.href = href;
|
|
- downloadElement.download = this.dataBody.table.tabName + ".xlsx";
|
|
|
|
|
|
+ let month = this.table_search.time ? this.$formatDate(this.table_search.time, "YYYY年MM月") : ''
|
|
|
|
+ downloadElement.download = `${month}回复统计.xlsx`;
|
|
document.body.appendChild(downloadElement);
|
|
document.body.appendChild(downloadElement);
|
|
downloadElement.click();
|
|
downloadElement.click();
|
|
document.body.removeChild(downloadElement);
|
|
document.body.removeChild(downloadElement);
|
|
window.URL.revokeObjectURL(href);
|
|
window.URL.revokeObjectURL(href);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
- // this.$http({
|
|
|
|
- // url: "/CMKIssued/exportCMKIssuedReplyStatistics",
|
|
|
|
- // method: "post",
|
|
|
|
- // headers: {
|
|
|
|
- // "Content-Type": "application/json",
|
|
|
|
- // },
|
|
|
|
- // data: {
|
|
|
|
- // ...this.table_search,
|
|
|
|
- // time: this.table_search.time ? this.table_search.time : "",
|
|
|
|
- // },
|
|
|
|
- // responseType: "blob", // 解决下载的文件乱码空白等问题
|
|
|
|
- // }).then(({ data }) => {
|
|
|
|
- // console.log(data,'data');
|
|
|
|
- // let url = window.URL.createObjectURL(new Blob([data]));
|
|
|
|
- // let a = document.createElement("a");
|
|
|
|
- // a.setAttribute("href", url);
|
|
|
|
- // // a.setAttribute('download', scope.row.fileName)
|
|
|
|
- // a.click();
|
|
|
|
- // });
|
|
|
|
|
|
+ // this.$http({
|
|
|
|
+ // url: "/CMKIssued/exportCMKIssuedReplyStatistics",
|
|
|
|
+ // method: "post",
|
|
|
|
+ // headers: {
|
|
|
|
+ // "Content-Type": "application/json",
|
|
|
|
+ // },
|
|
|
|
+ // data: {
|
|
|
|
+ // ...this.table_search,
|
|
|
|
+ // time: this.table_search.time ? this.table_search.time : "",
|
|
|
|
+ // },
|
|
|
|
+ // responseType: "blob", // 解决下载的文件乱码空白等问题
|
|
|
|
+ // }).then(({ data }) => {
|
|
|
|
+ // console.log(data,'data');
|
|
|
|
+ // let url = window.URL.createObjectURL(new Blob([data]));
|
|
|
|
+ // let a = document.createElement("a");
|
|
|
|
+ // a.setAttribute("href", url);
|
|
|
|
+ // // a.setAttribute('download', scope.row.fileName)
|
|
|
|
+ // a.click();
|
|
|
|
+ // });
|
|
console.log("我下载了");
|
|
console.log("我下载了");
|
|
},
|
|
},
|
|
handleSearch(data) {
|
|
handleSearch(data) {
|
|
let obj = {
|
|
let obj = {
|
|
...data,
|
|
...data,
|
|
time: data.time
|
|
time: data.time
|
|
- ? this.$formatDate(this.table_search.time, "YYYY-MM")
|
|
|
|
|
|
+ ? this.$formatDate(data.time, "YYYY-MM")
|
|
: "",
|
|
: "",
|
|
};
|
|
};
|
|
|
|
+ console.log(obj,'obj');
|
|
this.table_search = data;
|
|
this.table_search = data;
|
|
this.handleReset();
|
|
this.handleReset();
|
|
this.handleInit({ ...obj });
|
|
this.handleInit({ ...obj });
|