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/doctor/index.vue |   27 +++++++++++++++++++++++----
 1 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/ruoyi-ui/src/views/doctor/index.vue b/ruoyi-ui/src/views/doctor/index.vue
index 14420ea..0dd8e12 100644
--- a/ruoyi-ui/src/views/doctor/index.vue
+++ b/ruoyi-ui/src/views/doctor/index.vue
@@ -164,7 +164,7 @@
             plain
             icon="el-icon-download"
             size="mini"
-            @click="handleExport"
+            @click="handleExportTemplate"
             v-hasPermi="['family:note:export']"
           >瀵煎叆妯℃澘涓嬭浇</el-button>
         </el-col>
@@ -186,8 +186,8 @@
         <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
       </el-row>
     </div>
-    <el-table v-loading="loading" :data="doctorList" @selection-change="handleSelectionChange"  :row-class-name="tableRowClassName" style="background: #FFEFF2;  border-radius: 14px 14px 14px 14px;">
-      <el-table-column type="selection" width="25"  align="center" />
+    <el-table v-loading="loading" :data="doctorList" :row-key="getRowId" ref="multipleTable" @selection-change="handleSelectionChange"  :row-class-name="tableRowClassName" style="background: #FFEFF2;  border-radius: 14px 14px 14px 14px;">
+      <el-table-column type="selection" :reserve-selection="true" width="25"  align="center" />
       <el-table-column  label="搴忓彿" sortable type="index" align="center" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="60"/>
       <el-table-column label="绫诲瀷" prop="type" sortable width="80" align="center">
         <template slot-scope="scope">{{scope.row.type? scope.row.type: '鈥斺�斺�斺��'}}</template>
@@ -580,6 +580,10 @@
       this.open = false;
       this.reset();
     },
+    getRowId(row)
+    {
+      return row.id
+    },
     // 鍙栨秷鎸夐挳锛堟暟鎹潈闄愶級
     cancelDataScope() {
       this.openDataScope = false;
@@ -720,9 +724,24 @@
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      this.download('zfDoctor/export', {
+      const Ids = this.ids;
+      
+      if(Ids.length==0)
+      {
+      this.download('/zfDoctor/export', {
         ...this.queryParams
       }, `zfDoctor_${new Date().getTime()}.xlsx`)
+      }else{
+        this.download('/zfDoctor/export1/'+Ids, {
+ 
+        }, `zfDoctor_${new Date().getTime()}.xlsx`)
+      }
+    },
+
+    handleExportTemplate(){
+      this.download('/zfDoctor/model', {
+
+      }, `zfDoctor_${new Date().getTime()}.xlsx`)
     },
     /** 瀵煎叆鎿嶄綔*/
     handleEnport(params){

--
Gitblit v1.9.1