gcz %!s(int64=4) %!d(string=hai) anos
pai
achega
4f9cd3fdc5
Modificáronse 2 ficheiros con 21 adicións e 3 borrados
  1. 1 1
      src/utils/exportexcel.js
  2. 20 2
      src/views/oms/order/index.vue

+ 1 - 1
src/utils/exportexcel.js

@@ -11,7 +11,7 @@ export function exportExcel(data, fileName) {
   const blobByExportExcel = new Blob([contentByExportExcel], { type: "application/vnd.ms-excel;charset=utf-8" });
   // console.log('blobByExportExcel',blobByExportExcel);
   // const filenameByExportExcel = fileName + "_" + parseTime(new Date(), "{y}-{m}-{d}") + "_" + new Date().getTime() + ".xlsx";
-  console.log(fileName + "_" + parseTime(new Date(), "{y}-{m}-{d}"));
+  // console.log(fileName + "_" + parseTime(new Date(), "{y}-{m}-{d}"));
   const filenameByExportExcel = fileName + Date.parse(new Date()) + ".xlsx";
   if ('download' in document.createElement('a')) {
     const elink = document.createElement('a');

+ 20 - 2
src/views/oms/order/index.vue

@@ -524,14 +524,32 @@
         }).then(() => {
           // this.exportFullscreenLoading = true;
           exportExcel(this.listQuery).then(response => {
+            console.log('response',response.type == 'application/json');
+            if(response.type == 'application/json'){
+              this.$message({
+                message: '请设置时间!',
+                type: 'none',
+                duration: 1000
+              });
+              return false;
+
+            };
             this.exportExcel(response, '订单');
             // this.exportFullscreenLoading = false;
           }).catch((error) => {
-            this.msgError('导出Excel异常!');
+            this.$message({
+                message: '导出Excel异常!',
+                type: 'none',
+                duration: 1000
+              });
             // this.exportFullscreenLoading = false;
           });
         }).catch(() => {
-          this.msgInfo('您已取消导出!');
+          this.$message({
+                message: '您已取消导出!',
+                type: 'none',
+                duration: 1000
+              });
           // this.exportFullscreenLoading = false;
         });