diff --git a/src/util/util.js b/src/util/util.js
index 85d74bf..fdc64e0 100644
--- a/src/util/util.js
+++ b/src/util/util.js
@@ -370,3 +370,38 @@ export function getQueryString(url, paraName) {
return ''
}
}
+// 导出.Excel公用方法
+export function exportMethodPost(url, name, data = {}) {
+ axios({
+ method: "get",
+ url: url,
+ params:data,
+ responseType: "blob",
+ })
+ .then((res) => {
+ let blob = new Blob([res], { type: "application/vnd.ms-excel" });
+ let date = new Date();
+ let time = date.toLocaleDateString();
+ // console.log(time, "时间");
+ if ("download" in document.createElement("a")) {
+ const link = document.createElement("a");
+ link.style.display = "none";
+ link.href = URL.createObjectURL(blob);
+ // link.download = res.headers['content-disposition'] //下载后文件名
+ link.download = (name || "导出文件") + time + ".xlsx"; //下载的文件名
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ } else {
+ // console.log("--------------------jingla")
+ let fileName = (name || "导出文件") + time + ".xlsx"; //下载的文件名
+ navigator.msSaveBlob(blob, fileName);
+ }
+ })
+ .catch((error) => {
+ // Message.error({
+ // message: '网络连接错误'
+ // })
+ console.log(error);
+ });
+}
diff --git a/src/views/Customer/index.vue b/src/views/Customer/index.vue
index b93275a..c01c371 100644
--- a/src/views/Customer/index.vue
+++ b/src/views/Customer/index.vue
@@ -213,6 +213,9 @@