浏览代码

加导出

1
mo 3 年之前
父节点
当前提交
32d8094c13
共有 2 个文件被更改,包括 37 次插入2 次删除
  1. 0 1
      src/store/modules/selects.js
  2. 37 1
      src/views/smallStudentManager/components/tableList.vue

+ 0 - 1
src/store/modules/selects.js

@@ -197,7 +197,6 @@ export default {
               }
             }
           }
-          console.log(tempArr, 'tempArr')
           commit('commit_roles', tempArr)
         } catch (error) {}
         loadings.commit_roles = false

+ 37 - 1
src/views/smallStudentManager/components/tableList.vue

@@ -114,6 +114,12 @@
       <el-form-item>
         <el-button native-type="submit" type="danger">搜索</el-button>
         <el-button native-type="reset" type="primary">重置</el-button>
+               <el-button
+          type="primary"
+          v-if="tableList.length > 0"
+          v-permission="'studentStatistics/exportStudentSmallClassStatisticsSum'"
+          @click="smallStudentExport"
+          >导出</el-button>
       </el-form-item>
     </save-form>
 
@@ -350,7 +356,10 @@ import pagination from "@/components/Pagination/index";
 import { queryPage } from "../api";
 import { feedbackTypeList } from "@/utils/searchArray";
 import { getTimes } from "@/utils";
+import { Export } from "@/utils/downLoadFile";
+import cleanDeep from 'clean-deep'
 import visiList from './visiList.vue'
+import qs from 'qs'
 export default {
   name: "tableList",
   props: ["groupType"],
@@ -417,7 +426,6 @@ export default {
         });
         this.tableList = res.data.rows || [];
         this.pageInfo.total = res.data.total;
-        console.log(res);
       } catch {}
     },
     gotoStudent(search) {
@@ -435,6 +443,34 @@ export default {
     recordVisit(row){
       this.activeRow = row;
       this.visitVisiable = true
+    },
+    smallStudentExport(){
+         const { timer, ...rest } = this.searchForm;
+         let str = ''
+         if(this.groupType === 'PRACTICE'){
+           str='网管课'
+         }else if(this.groupType === 'VIP'){
+            str='VIP课'
+         }else{
+           str='乐理课'
+         }
+      Export(
+        this,
+        {
+          url: "/api-web/studentStatistics/exportStudentSmallClassStatisticsSum",
+          fileName: `${str}学员管理.xls`,
+          method: "post",
+          params: qs.stringify(cleanDeep({
+             groupType: this.groupType,
+          ...rest,
+          ...getTimes(timer, ["firstCourseStartTime", "firstCourseEndTime"]),
+          rows: this.pageInfo.limit,
+          page: this.pageInfo.page,
+          organId: this.searchForm.organId.join(","),
+          })),
+        },
+        `您确定导出${str}学员管理?`
+      );
     }
   },
 };