浏览代码

乐团列表导出

1
mo 3 年之前
父节点
当前提交
0a61a895a5
共有 1 个文件被更改,包括 36 次插入5 次删除
  1. 36 5
      src/views/teamDetail/teamList.vue

+ 36 - 5
src/views/teamDetail/teamList.vue

@@ -17,9 +17,6 @@
           @click="createNewTeam"
           >新建乐团</el-button
         >
-        <!-- <div class='newBand'
-             v-permission="'/teamBuild/trimming'"
-             @click="resetTeam">乐团调整</div> -->
       </div>
 
       <save-form
@@ -135,6 +132,14 @@
         <el-form-item>
           <el-button type="primary" native-type="reset">重置</el-button>
         </el-form-item>
+        <el-form-item>
+          <el-button
+            type="primary"
+            v-permission="'export/musicGroup'"
+            @click="onExport"
+            >导出</el-button
+          >
+        </el-form-item>
       </save-form>
       <div class="tableWrap">
         <el-table
@@ -423,6 +428,8 @@
 <script>
 import pagination from "@/components/Pagination/index";
 import { getTeamList, getPayType } from "@/api/teamServer";
+import qs from "qs";
+import cleanDeep from "clean-deep";
 import {
   getCooperation,
   cancelMusicGroup,
@@ -438,6 +445,7 @@ import { permission } from "@/utils/directivePage";
 import teamSteam from "./teamListComponent/teamSteam";
 import closeStudens from "../teamBuild/modals/close-studens";
 import { getTimes } from "@/utils";
+import { Export } from "@/utils/downLoadFile";
 export default {
   name: "teamList",
   data() {
@@ -1076,6 +1084,29 @@ export default {
         }
       );
     },
+    async onExport() {
+      let { createTimer, billTimer, ...reset } = this.topForm;
+      let obj = {
+        ...reset,
+        organId: this.topForm.orgin || null,
+        ...getTimes(
+          createTimer,
+          ["createStartDate", "createEndDate"],
+          "YYYY-MM-DD"
+        ),
+        ...getTimes(billTimer, ["billStartDate", "billEndDate"], "YYYY-MM-DD"),
+      };
+      await Export(
+        this,
+        {
+          url: "/api-web/export/musicGroup",
+          fileName: "乐团列表.xls",
+          method: "post",
+          params: qs.stringify(cleanDeep(obj)),
+        },
+        "您确定导出乐团列表?"
+      );
+    },
   },
   watch: {
     showSteam(val) {
@@ -1098,8 +1129,8 @@ export default {
   flex-direction: row;
   justify-content: flex-start;
   align-items: center;
-  div {
-    margin-right: 15px;
+  .exportBtn {
+    margin-left: 15px;
   }
 }
 </style>