Bläddra i källkod

Update detail.vue

lex-xin 6 månader sedan
förälder
incheckning
6c186a3e5e
1 ändrade filer med 9 tillägg och 23 borttagningar
  1. 9 23
      src/views/band-guidance-training/detail.vue

+ 9 - 23
src/views/band-guidance-training/detail.vue

@@ -305,15 +305,8 @@ export default {
       });
     },
     async onExport() {
-      
-      this.$confirm(`您确定导出${this.name}?`, "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(async () => {
-        try {
-          const { citys, ...more } = this.searchForm
-          const obj = {
+      const { citys, ...more } = this.searchForm
+      const obj = {
             tempDirectorTrainingCampId: this.$route.query.id,
             ...more
           }
@@ -322,20 +315,13 @@ export default {
             obj.cityCode = citys[1]
             obj.regionCode = citys[2]
           }
-          const { data } = await api_tempDirectorTrainingDetailCampExport(obj)
-          let link = document.createElement("a");
-          let fname = data.fileName || "导出文件.xls"; //下载文件的名字
-          link.href = data.downloadPath;
-          link.setAttribute("download", fname);
-          document.body.appendChild(link);
-          link.click();
-          document.body.removeChild(link)
-        } catch {
-          // 
-        }
-      }).catch(error => {
-        that.$message.error('下载失败,请联系管理员');
-      });
+      Export(this, {
+        url: '/api-web/tempDirectorTrainingDetailCamp/export',
+        fileName: '乐队指导特训营.xls',
+        method: 'post',
+        params: obj
+      }, `您确定导出${this.name}?`)
+      
     },
     onCancel() {
       this.$store.dispatch("delVisitedViews", this.$route);