From 4efd39b4696db81789d3d92a54d197f1e85ecdf2 Mon Sep 17 00:00:00 2001
From: feige <feige@qq.com>
Date: 星期三, 17 五月 2023 17:01:43 +0800
Subject: [PATCH] 把所有模块的导入模板和导出问题都解决了

---
 ruoyi-ui/src/views/economy/index.vue |   29 ++++++++++++++++++++++++-----
 1 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/ruoyi-ui/src/views/economy/index.vue b/ruoyi-ui/src/views/economy/index.vue
index 5c818e4..5a00a83 100644
--- a/ruoyi-ui/src/views/economy/index.vue
+++ b/ruoyi-ui/src/views/economy/index.vue
@@ -86,7 +86,7 @@
           plain
           icon="el-icon-download"
           size="mini"
-          @click="handleExport"
+          @click="handleExportTemplate"
           v-hasPermi="['family:note:export']"
         >瀵煎叆妯℃澘涓嬭浇</el-button>
       </el-col>
@@ -107,8 +107,8 @@
     </el-row>
     <!-- 搴忓彿銆佸熀閲�/鍙拌处銆佹椂闂淬�佹敹鍏�/鏀嚭銆佺敤閫斻�佷娇鐢ㄤ汉銆佺幇閲�/鑷姩鎵e垝銆佷綑棰濄�佺數瀛愭枃浠躲�佸娉� 鎿嶄綔-->
     <!-- 杩欓噷鏈変釜familyList鏁扮粍 鏄湪data()涓畾涔夌殑 -->
-    <el-table v-loading="loading" :data="economyList"  @selection-change="handleSelectionChange" @row-click="handleCheck" :row-class-name="tableRowClassName" style="background: #FFEFF2;  border-radius: 14px 14px 14px 14px;">
-      <el-table-column type="selection" width="55"  align="center" />
+    <el-table v-loading="loading" :data="economyList"  :row-key="getRowId" ref="multipleTable" @selection-change="handleSelectionChange" @row-click="handleCheck" :row-class-name="tableRowClassName" style="background: #FFEFF2;  border-radius: 14px 14px 14px 14px;">
+      <el-table-column type="selection"  :reserve-selection="true" width="55"  align="center" />
       <el-table-column  label="搴忓彿" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="120"/>
       <el-table-column label="鍩洪噾/鍙拌处" prop="type" sortable width="120" >
         <template slot-scope="scope">
@@ -118,7 +118,6 @@
       <el-table-column label="鍙戠敓鏃堕棿" prop="createTime" sortable width="100" align="center">
         <template slot-scope="scope">{{scope.row.createTime? scope.row.createTime: '鈥斺�斺�斺��'}}</template>
       </el-table-column>
-      <el-table-column label="鍙拌处" prop="type" sortable width="100" />
       <el-table-column label="鏀跺叆/鏀嚭" prop="price" sortable width="100" />
       <el-table-column label="鐢ㄩ��" prop="useFor" sortable width="100" />
 
@@ -129,6 +128,7 @@
         </template>
       </el-table-column>
       <el-table-column label="浣欓" prop="balance" sortable width="100" />
+            <el-table-column label="澶囨敞" prop="remark" sortable width="100" />
       <el-table-column label="鐢靛瓙鏂囦欢" prop="url" align="center" sortable  width="110" >
         <template slot-scope="scope" >
           <img
@@ -149,7 +149,7 @@
           >
         </template>
       </el-table-column>
-      <el-table-column label="澶囨敞" prop="remark" sortable width="100" />
+
       <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope" v-if="scope.row.roleId !== 1">
           <el-button
@@ -522,6 +522,10 @@
       this.open = false;
       this.reset();
     },
+    getRowId(row)
+    {
+      return row.id
+    },
     // 鍙栨秷鎸夐挳锛堟暟鎹潈闄愶級
     cancelDataScope() {
       this.openDataScope = false;
@@ -656,10 +660,24 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
+      const Ids = this.ids;
+
+      if(Ids.length==0)
+      {
       this.download('/zfEconomy/export', {
         ...this.queryParams
       }, `zfEconomy_${new Date().getTime()}.xlsx`)
+      }else
+      {
+        this.download('/zfEconomy/export1/'+Ids, {
+        }, `zfEconomy_${new Date().getTime()}.xlsx`)
+      }
     }
+  ,
+  handleExportTemplate(){
+      this.download('/zfEconomy/model', {
+
+      }, `zfEconomy_${new Date().getTime()}.xlsx`)
   },
   /** 瀵煎叆鎿嶄綔*/
   handleEnport(params){
@@ -678,6 +696,7 @@
     }
 
   }
+  }
 
 };
 </script>

--
Gitblit v1.9.1