Browse Source

提交

分享
mo 2 years ago
parent
commit
84549f1143

+ 5 - 13
src/components/QrCode/index.vue

@@ -1,4 +1,3 @@
-
 <template>
   <div class="qrCode">
     <el-dialog
@@ -9,6 +8,7 @@
       width="321px"
     >
       <div class="left-code">
+        <slot></slot>
         <div id="preview">
           <!--   -->
           <!-- <vue-qr
@@ -22,18 +22,10 @@
           <copy-text>{{ codeUrl }}</copy-text>
         </p>
       </div>
-      <el-button
-        v-if="ispreLook"
-        type="primary"
-        style="width: 100%"
-        @click="preLook"
+      <el-button v-if="ispreLook" type="primary" style="width: 100%" @click="preLook"
         >预 览</el-button
       >
-      <el-button
-        v-if="isDown"
-        type="primary"
-        style="width: 100%"
-        @click="downImage"
+      <el-button v-if="isDown" type="primary" style="width: 100%" @click="downImage"
         >下载图片</el-button
       >
     </el-dialog>
@@ -171,8 +163,8 @@ export default {
 }
 #preview {
   canvas {
-    width: 281px!important;
-    height: 281px!important;
+    width: 281px !important;
+    height: 281px !important;
   }
 }
 </style>

+ 7 - 0
src/constant/index.js

@@ -590,3 +590,10 @@ export const problemType = {
   PROFESSIONAL_ABILITY: "专业能力",
   OTHER: "其他"
 };
+
+
+export const shareLiveType = {
+  NO_SHARE:'未分享',
+  OPEN:'公开',
+  PRIVATE:'私密'
+}

+ 12 - 0
src/store/modules/permission.js

@@ -672,6 +672,18 @@ function setDetailRoute(accessedRoutes) {
           }
         },
         {
+          name: "直播分享学员",
+          path: "liveShareStudentList",
+          component: () => import("@/views/liveClassManager/liveClassTwo/components/addShareStudentList"),
+          hidden: true,
+          meta: {
+            noCache: "1",
+            title: "直播分享学员",
+            belongTopMenu: "/business",
+            activeMenu: "/liveClassManager"
+          }
+        },
+        {
           name: "学员缴费设置",
           path: "studentPaySet",
           component: () =>

+ 3 - 1
src/utils/searchArray.js

@@ -31,7 +31,8 @@ import {
   levelStatus,
   evaluateStatus,
   problemType,
-  schoolUserType
+  schoolUserType,
+  shareLiveType
 } from "../constant";
 // 课程类型
 let tenantConfig = sessionStorage.getItem("tenantConfig");
@@ -902,6 +903,7 @@ export const levelStatusList = getValueForKey(levelStatus);
 export const evaluateStatusList = getValueForKey(evaluateStatus);
 export const problemTypeList = getValueForKey(problemType);
 export const schoolUserTypeList = getValueForKey(schoolUserType);
+export const shareLiveTypeList = getValueForKey(shareLiveType)
 //downListType
 function getValueForKey(obj) {
   let arr = [];

+ 2 - 0
src/utils/vueFilter.js

@@ -226,6 +226,8 @@ Vue.filter("feedbackTypeFilter", val => constant.feedbackTypeAll[val]);
 Vue.filter("feedbackTypeDescFilter", val => constant.feedbackTypeDesc[val]);
 // 小小训练营状态
 Vue.filter("campStateListFilter", val => constant.campState[val]);
+// 直播课分享
+Vue.filter("shareLiveTypeFilter", val => constant.shareLiveType[val]);
 
 // 时间处理
 Vue.filter("timer", value => {

+ 50 - 1
src/views/liveClassManager/api.js

@@ -346,4 +346,53 @@ export function delLiveGroup(data) {
   });
 }
 
-// vipGroupManage/delLiveGroup
+// 开始加权限
+// 创建直播课分享
+export function createLiveGroupShare(data) {
+  return request({
+    url: "/api-web/courseSchedule/updateCourseScheduleShareMode",
+    method: "POST",
+    data
+  });
+}
+
+
+// 查询已分享的学员
+export function getLiveGroupShareStudent(data) {
+  return request({
+    url: "/api-web/courseShare/queryCourseSharedStudent",
+    method: "get",
+    data,
+    params: data
+  });
+}
+
+// 添加分享学员  courseShare/saveCourseShare
+export function addShareStudent(data) {
+  return request({
+    url: "/api-web/courseShare/saveCourseShare",
+    method: "post",
+    data,
+  });
+}
+
+
+// 删除分享学员
+export function deleteShareStudent(data) {
+  return request({
+    url: "/api-web/courseShare/deleteShareStudent",
+    method: "post",
+    data,
+  });
+}
+
+
+// 直播课可分享的学员
+export function getWaitShareStudent(data) {
+  return request({
+    url: "/api-web/courseShare/queryAllCourseShareStudent",
+    method: "get",
+    data,
+    params: data
+  });
+}

+ 483 - 0
src/views/liveClassManager/liveClassTwo/components/addShareStudentList.vue

@@ -0,0 +1,483 @@
+<template>
+  <div class="m-container">
+    <!-- -->
+    <h2>
+      <el-page-header
+        @back="onCancel"
+        :content="$route.query.name + '分享名单'"
+      ></el-page-header>
+    </h2>
+    <div class="m-core">
+      <el-form :inline="true" :model="searchForm">
+        <el-form-item>
+          <el-input
+            v-model.trim="searchForm.search"
+            clearable
+            @keyup.enter.native="search"
+            placeholder="学员名/编号/手机号"
+          ></el-input>
+        </el-form-item>
+        <el-form-item prop="organIdList">
+          <select-all
+            class="multiple"
+            clearable
+            filterable
+            collapse-tags
+            multiple
+            v-model.trim="searchForm.organIdList"
+            placeholder="请选择分部"
+            @change="onBranchChange"
+          >
+            <el-option
+              v-for="(item, index) in selects.branchs"
+              :key="index"
+              :label="item.name"
+              :value="item.id"
+            ></el-option>
+          </select-all>
+        </el-form-item>
+        <el-form-item>
+          <el-select
+            multiple
+            collapse-tags
+            v-model.trim="searchForm.cooperationOrganId"
+            clearable
+            filterable
+            placeholder="请选择合作单位"
+            :disabled="searchForm.organIdList.length <= 0"
+          >
+            <el-option
+              v-for="(item, index) in cooperationList"
+              :key="index"
+              :value="item.id"
+              :label="item.name"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-select
+            multiple
+            collapse-tags
+            :disabled="searchForm.organIdList.length <= 0"
+            v-model.trim="searchForm.musicGroupId"
+            clearable
+            filterable
+            placeholder="请选择乐团"
+          >
+            <el-option
+              v-for="(item, index) in teamList"
+              :key="index"
+              :value="item.id"
+              :label="item.name"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item prop="subjectId">
+          <el-select
+            v-model="searchForm.subjectId"
+            clearable
+            filterable
+            placeholder="请选择声部"
+          >
+            <el-option
+              v-for="item in selects.subjects"
+              :value="item.id"
+              :label="item.name"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-select
+            multiple
+            collapse-tags
+            v-model.trim="searchForm.groupList"
+            clearable
+            filterable
+            placeholder="请选择群聊"
+          >
+            <el-option
+              v-for="(item, index) in groupList"
+              :key="index"
+              :value="item.id"
+              :label="item.name"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button @click="search" type="primary">搜索</el-button>
+          <el-button @click="onReSet" type="danger">重置</el-button>
+        </el-form-item>
+      </el-form>
+      <div class="btnWrap">
+        <auth auths="courseShare/saveCourseShare">
+          <el-button @click="addBlack" type="primary" style="margin-bottom: 10px"
+            >添加学员</el-button
+          >
+        </auth>
+        <auth auths="courseShare/importStudent">
+          <el-button type="primary" @click="() => (importVisible = true)">导入</el-button>
+        </auth>
+
+        <auth auths="courseShare/deleteShareStudent">
+          <el-button @click="removes" type="danger" style="margin-bottom: 10px"
+            >删除学员</el-button
+          >
+        </auth>
+      </div>
+
+      <div class="tableWrap">
+        <el-table
+          style="width: 100%"
+          :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+          :data="tableList"
+          @selection-change="handleSelectionChange"
+          @select="onTableSelect"
+          ref="multipleSelection"
+        >
+          <el-table-column type="selection" width="55"> </el-table-column>
+          <el-table-column align="center" prop="userId" label="编号"></el-table-column>
+          <el-table-column
+            align="center"
+            prop="username"
+            label="学员姓名"
+          ></el-table-column>
+          <el-table-column align="center" prop="organName" label="分部"></el-table-column>
+          <el-table-column
+            align="center"
+            prop="subjectName"
+            label="声部"
+          ></el-table-column>
+
+          <el-table-column align="center" prop="phone" label="手机号"></el-table-column>
+          <el-table-column align="center" prop="studentId" label="操作">
+            <template slot-scope="scope">
+              <div>
+                <auth auths="courseShare/deleteShareStudent">
+                  <el-button type="text" @click="deteleBlack(scope.row)">删除</el-button>
+                </auth>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+        <pagination
+          sync
+          :total.sync="rules.total"
+          :page.sync="rules.page"
+          :limit.sync="rules.limit"
+          :page-sizes="rules.page_size"
+          @pagination="getList"
+        />
+      </div>
+    </div>
+    <addShareStudentModel @getList="getList" ref="addStudentModel" />
+    <el-dialog title="导入" width="400px" :visible.sync="importVisible">
+      <div class="importWrap">
+        <el-button type="primary" @click="() => downImport()">下载模板</el-button>
+
+        <el-upload
+          v-permission="'courseShare/importStudent'"
+          action="/api-web/courseShare/importStudent"
+          :show-file-list="false"
+          :before-upload="beforeUpload"
+          accept=".xlsx,.xls"
+          :data="{
+            courseId: $route.query.courseId,
+          }"
+          :headers="headers"
+          :on-error="handleError"
+          :on-success="handleSuccess"
+        >
+          <el-button type="primary" style="margin-left: 20px"> 导入学员 </el-button>
+        </el-upload>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="importVisible = false">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { getLiveGroupShareStudent, deleteShareStudent } from "../../api";
+
+import pagination from "@/components/Pagination/index";
+import addShareStudentModel from "../../modals/addShareStudentModel";
+import { getGroupList } from "@/views/groupChatManager/api";
+import { queryByOrganId } from "@/api/systemManage";
+import { getTeamList } from "@/api/teamServer";
+import { getToken, getTenantId } from "@/utils/auth";
+import load from "@/utils/loading";
+export default {
+  name: "liveAddStudentList",
+  //
+  components: { pagination, addShareStudentModel },
+  data() {
+    return {
+      headers: { Authorization: getToken(), tenantId: getTenantId() },
+      searchForm: {
+        search: "",
+        organIdList: [],
+        cooperationOrganId: [],
+        musicGroupId: [],
+        groupList: [],
+      },
+      tableList: [],
+      organList: [],
+      cooperationList: [],
+      groupList: [],
+      teamList: [],
+      rules: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
+      },
+      addMuiscVisible: false,
+      multipleSelection: [],
+      chioseIdList: [],
+      isNewPage: false,
+      lookVisible: false,
+      activeRow: { sendFlag: false },
+      importVisible: false,
+    };
+  },
+
+  mounted() {
+    this.$store.dispatch("setSubjects");
+    this.$store.dispatch("setBranchs");
+    this.getGroupList();
+    this.getList();
+  },
+  methods: {
+    downImport() {
+      window.location.href =
+        "https://daya-docs.ks3-cn-beijing.ksyuncs.com/%E7%9B%B4%E6%92%AD%E8%AF%BE-%E5%88%86%E4%BA%AB%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx";
+    },
+    async getGroupList() {
+      const res = await getGroupList({ page: 1, rows: 9999 });
+      this.groupList = res.data.rows;
+    },
+    async getList() {
+      try {
+        const {
+          organIdList,
+          cooperationOrganId,
+          musicGroupId,
+          groupList,
+          ...rest
+        } = this.searchForm;
+        const res = await getLiveGroupShareStudent({
+          organIds: organIdList.join(","),
+          schoolIds: cooperationOrganId.join(","),
+          teamIds: musicGroupId.join(","),
+          groupIds: groupList.join(","),
+          ...rest,
+          page: this.rules.page,
+          rows: this.rules.limit,
+          courseId: this.$route.query.courseId,
+        });
+        this.tableList = res.data.rows;
+        this.rules.total = res.data.total;
+        let idList = this.chioseIdList.map((group) => {
+          return group.userId;
+        });
+        this.isNewPage = true;
+        this.$nextTick(() => {
+          this.tableList.forEach((course) => {
+            if (idList.indexOf(course.userId) != -1) {
+              this.$refs.multipleSelection.toggleRowSelection(course, true);
+            }
+          });
+          this.isNewPage = false;
+        });
+      } catch (e) {
+        console.log(e);
+      }
+    },
+    search() {
+      this.rules.page = 1;
+      this.getList();
+    },
+    onReSet() {
+      (this.searchForm = {
+        search: "",
+        organIdList: [],
+        cooperationOrganId: [],
+        musicGroupId: [],
+        groupList: [],
+      }),
+        this.clearCom();
+      this.search();
+    },
+    handleSelectionChange(val) {
+      if (val.length > 0) {
+        this.chioseIdList = this.chioseIdList.concat(val);
+        this.chioseIdList = this.$helpers.lodash.uniqBy(this.chioseIdList, "userId");
+      } else {
+        if (this.isNewPage) return;
+        let idList = this.chioseIdList.map((group) => {
+          return group.userId;
+        });
+        this.$nextTick(() => {
+          let tableIdList = [];
+          this.tableList.forEach((group) => {
+            tableIdList.push(group.userId);
+            if (idList.indexOf(group.userId) != -1) {
+              this.$refs.multipleSelection.toggleRowSelection(group, false);
+            }
+          });
+          this.chioseIdList = this.$helpers.lodash.remove(
+            this.chioseIdList,
+            function (item) {
+              return tableIdList.indexOf(item.userId) == -1;
+            }
+          );
+          if (this.chioseIdList.length <= 0) {
+            this.clearCom();
+          }
+        });
+      }
+    },
+    clearCom() {
+      this.chioseIdList = [];
+      this.$refs.multipleSelection.clearSelection();
+    },
+    onTableSelect(rows, row) {
+      let idList = this.chioseIdList.map((group) => {
+        return group.userId;
+      });
+      if (idList.indexOf(row.userId) != -1) {
+        this.chioseIdList.splice(idList.indexOf(row.userId), 1);
+        if (this.chioseIdList.length <= 0) {
+          this.clearCom();
+        }
+      }
+    },
+    onCancel() {
+      this.$router.push("/liveClassManager");
+      this.$store.dispatch("delVisitedViews", this.$route);
+    },
+    async deteleBlack(row) {
+      this.$confirm(`你确定将${row.username}移除分享列表?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          try {
+            const res = await deleteShareStudent({
+              courseId: this.$route.query.courseId,
+              userIds: [row.userId],
+            });
+            this.getList();
+            this.clearCom();
+          } catch (e) {
+            console.log(e);
+          }
+        })
+        .catch();
+    },
+    addBlack() {
+      this.$refs.addStudentModel.openDioag({
+        courseId: this.$route.query.courseId,
+      });
+    },
+    removes() {
+      if (!this.chioseIdList || this.chioseIdList.length <= 0) {
+        this.$message.error("请至少选择一名学员");
+        return;
+      }
+      let str = this.chioseIdList
+        .map((group) => {
+          return group.username;
+        })
+        .join(",");
+      this.$confirm(`你确定将${str}移除分享列表?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          let idList = this.chioseIdList.map((group) => {
+            return group.userId;
+          });
+          try {
+            const res = await deleteShareStudent({
+              courseId: this.$route.query.courseId,
+              userIds: idList,
+            });
+            this.$message.success("删除成功");
+            this.getList();
+            this.clearCom();
+          } catch (e) {
+            console.log(e);
+          }
+        })
+        .catch();
+    },
+    async onBranchChange(val) {
+      // this.searchForm.cooperationOrganId = [];
+      this.$set(this.searchForm, "cooperationOrganId", []);
+      if (val && val.length > 0) {
+        let organId = val.join(",");
+        try {
+          await queryByOrganId({ organId }).then((res) => {
+            if (res.code == 200) {
+              this.cooperationList = res.data;
+            }
+          });
+
+          await getTeamList({ organId, page: 1, rows: 9999 }).then((res) => {
+            if (res.code == 200) {
+              this.teamList = res.data.rows;
+            }
+          });
+        } catch (e) {
+          console.log(e);
+        }
+      }
+    },
+    beforeUpload(file) {
+      //  (file.type)
+      // const isJPG = file.type === '.xlsx' || file.type === '.xls';
+      // // const isLt2M = file.size / 1024 / 1024 < 2;
+      // if (!isJPG) {
+      //   this.$message.error('上传头像图片只能是 JPG 格式!');
+      // }
+      // return isJPG;
+      // this.goodsLoading = true
+      load.startLoading();
+    },
+    handleSuccess(response, file, fileList) {
+      // 导入商品
+      // 报表导出
+      load.endLoading();
+      if (response.code == 200) {
+        this.$message.success("导入成功");
+        this.importVisible = false;
+        this.getList();
+      } else {
+        this.$message.error(response.msg);
+      }
+    },
+    handleError(err, file, fileList) {
+      load.endLoading();
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.w100 {
+  width: 100%;
+}
+.btnWrap {
+  justify-content: flex-start;
+}
+.importWrap {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+}
+</style>

+ 330 - 98
src/views/liveClassManager/liveClassTwo/components/courseAdjust.vue

@@ -1,14 +1,53 @@
 <!--  -->
 <template>
   <div>
-    <el-button type="primary" style="margin-bottom: 12px;" @click="onAdjustment">批量调整</el-button>
+    <save-form
+      :inline="true"
+      class="searchForm"
+      save-key="liveClassManager-courseAdjust"
+      @submit="search"
+      @reset="onReSet"
+      :model="searchForm"
+      ref="searchForm"
+    >
+      <el-form-item prop="shareMode">
+        <el-select
+          v-model="searchForm.shareMode"
+          filterable
+          clearable
+          placeholder="请选择分享方式"
+        >
+          <el-option
+            v-for="(item, index) in shareModeList"
+            :key="index"
+            :label="item.label"
+            :value="item.value"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button @click="search" type="danger">搜索</el-button>
+        <el-button type="primary" native-type="reset">重置</el-button>
+      </el-form-item>
+    </save-form>
+    <el-button type="primary" style="margin-bottom: 12px" @click="onAdjustment"
+      >批量调整</el-button
+    >
     <div class="tableWrap">
-      <el-table style="width: 100%" :header-cell-style="{ background: '#EDEEF0', color: '#444' }" :data="tableList"
-        @selection-change="handleSelectionChange">
-        <el-table-column type="selection" :selectable="isDisabled" width="55"></el-table-column>
+      <el-table
+        style="width: 100%"
+        :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+        :data="tableList"
+        @selection-change="handleSelectionChange"
+      >
+        <el-table-column
+          type="selection"
+          :selectable="isDisabled"
+          width="55"
+        ></el-table-column>
         <el-table-column align="center" label="课程编号">
           <template slot-scope="scope">
-            <div>{{ scope.row.id || '' }}</div>
+            <div>{{ scope.row.id || "" }}</div>
           </template>
         </el-table-column>
         <el-table-column align="center" label="课程名称">
@@ -24,20 +63,66 @@
         <el-table-column align="center" prop="classDate" label="上课日期">
           <template slot-scope="scope">
             {{ scope.row.classDate | dayjsFormat }}
-            {{ scope.row.startClassTime | dayjsFormat('HH:mm') }}~{{ scope.row.endClassTime | dayjsFormat('HH:mm') }}
+            {{ scope.row.startClassTime | dayjsFormat("HH:mm") }}~{{
+              scope.row.endClassTime | dayjsFormat("HH:mm")
+            }}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="分享状态">
+          <template slot-scope="scope">
+            <div>{{ scope.row.shareMode | shareLiveTypeFilter }}</div>
           </template>
         </el-table-column>
         <!-- <el-table-column align="center" prop="startClassTime" label="开始时间"></el-table-column>
         <el-table-column align="center" prop="endClassTime" label="结束时间"></el-table-column> -->
-        <el-table-column label="操作" width="180" align="center">
+        <el-table-column label="操作" align="center">
           <template slot-scope="scope">
             <div>
-              <el-button type="text" v-if="scope.row.id &&
-                !scope.row.isSettlement &&
-                $helpers.permission(
-                  'courseSchedule/classStartDateAdjust/liveReset'
-                )
-                " @click="resetClass(scope.row)">调整</el-button>
+              <el-button
+                type="text"
+                v-if="
+                  scope.row.id &&
+                  !scope.row.isSettlement &&
+                  $helpers.permission('courseSchedule/classStartDateAdjust/liveReset')
+                "
+                @click="resetClass(scope.row)"
+                >调整</el-button
+              >
+
+              <el-button
+                type="text"
+                @click="startShare(scope.row)"
+                v-if="
+                  scope.row.id &&
+                  $helpers.permission('courseSchedule/updateCourseScheduleShareMode')
+                "
+                :disabled="scope.row.status == 'OVER'"
+                >分享</el-button
+              >
+              <el-button
+                type="text"
+                v-if="
+                  scope.row.id &&
+                  $helpers.permission('courseSchedule/classStartDateAdjust/liveReset')
+                "
+                :disabled="
+                  scope.row.status == 'OVER' || scope.row.shareMode == 'NO_SHARE'
+                "
+                @click="lookCode(scope.row)"
+                >二维码</el-button
+              >
+              <el-button
+                type="text"
+                v-if="
+                  scope.row.id &&
+                  $helpers.permission('courseShare/queryCourseSharedStudent')
+                "
+                :disabled="
+                  scope.row.status == 'OVER' || scope.row.shareMode !== 'PRIVATE'
+                "
+                @click="gotoShareList(scope.row)"
+                >分享列表</el-button
+              >
             </div>
           </template>
         </el-table-column>
@@ -45,8 +130,14 @@
     </div>
 
     <el-dialog :title="adjustmentName" width="800px" :visible.sync="adjustmentVisible">
-      <el-form :model="adjustmentForm" label-position="right" label-width="120px" ref="adjustmentForm"
-        :rules="adjustmentRules" :inline="true">
+      <el-form
+        :model="adjustmentForm"
+        label-position="right"
+        label-width="120px"
+        ref="adjustmentForm"
+        :rules="adjustmentRules"
+        :inline="true"
+      >
         <el-form-item label="已选择课时数">
           <el-input disabled v-model.trim="adjustmentForm.count"></el-input>
         </el-form-item>
@@ -64,36 +155,78 @@
         </el-form-item> -->
         <br />
         <el-form-item label="排课起始时间" prop="courseTime">
-          <el-date-picker v-model.trim="adjustmentForm.courseTime" :picker-options="pickerOptions()"
-            style="width:200px!important;" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
-          <el-checkbox style="margin-left:10px;" v-model.trim="adjustmentForm.checked">是否跳过节假日</el-checkbox>
+          <el-date-picker
+            v-model.trim="adjustmentForm.courseTime"
+            :picker-options="pickerOptions()"
+            style="width: 200px !important"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择日期"
+          ></el-date-picker>
+          <el-checkbox style="margin-left: 10px" v-model.trim="adjustmentForm.checked"
+            >是否跳过节假日</el-checkbox
+          >
         </el-form-item>
       </el-form>
       <div class="WeekWrap">
-        <h3 style="margin-bottom:20px;">
+        <h3 style="margin-bottom: 20px">
           循环次数
-          <el-button type="text" style="margin-left:10px;" @click="addWeek">添加</el-button>
+          <el-button type="text" style="margin-left: 10px" @click="addWeek"
+            >添加</el-button
+          >
         </h3>
-        <div class="countWrap" style="margin-bottom:10px;">
-          <div class="countItem" style="margin-bottom:20px;" v-for="(item, index) in weekList" :key="index">
+        <div class="countWrap" style="margin-bottom: 10px">
+          <div
+            class="countItem"
+            style="margin-bottom: 20px"
+            v-for="(item, index) in weekList"
+            :key="index"
+          >
             <span>循环周期:</span>
             <el-select v-model.trim="item.dayOfWeek" filterable clearable>
-              <el-option v-for="(item, index) in weekDateList" :key="index" :label="item.label"
-                :value="item.value"></el-option>
+              <el-option
+                v-for="(item, index) in weekDateList"
+                :key="index"
+                :label="item.label"
+                :value="item.value"
+              ></el-option>
             </el-select>
-            <span style="margin-left:10px;">开始时间</span>
-            <el-time-picker style="margin-left:10px;" placeholder v-model.trim="item.startClassTime" @change="val => {
-              changeStartTimes(val, item);
-            }" format="HH:mm" value-format="HH:mm" :picker-options="{
-  selectableRange: '06:00:00 - 21:00:00'
-}"></el-time-picker>
-            <span style="margin-left:10px;">结束时间</span>
-            <el-time-picker style="margin-left:10px;" placeholder v-model.trim="item.endClassTime" format="HH:mm"
-              value-format="HH:mm" disabled :picker-options="{
-                selectableRange: '06:00:00 - 21:00:00'
-              }"></el-time-picker>
-            <el-button style="margin-left:10px;" type="danger" :disabled="index < 1" @click="removeWeek(item)"
-              icon="el-icon-delete" circle></el-button>
+            <span style="margin-left: 10px">开始时间</span>
+            <el-time-picker
+              style="margin-left: 10px"
+              placeholder
+              v-model.trim="item.startClassTime"
+              @change="
+                (val) => {
+                  changeStartTimes(val, item);
+                }
+              "
+              format="HH:mm"
+              value-format="HH:mm"
+              :picker-options="{
+                selectableRange: '06:00:00 - 21:00:00',
+              }"
+            ></el-time-picker>
+            <span style="margin-left: 10px">结束时间</span>
+            <el-time-picker
+              style="margin-left: 10px"
+              placeholder
+              v-model.trim="item.endClassTime"
+              format="HH:mm"
+              value-format="HH:mm"
+              disabled
+              :picker-options="{
+                selectableRange: '06:00:00 - 21:00:00',
+              }"
+            ></el-time-picker>
+            <el-button
+              style="margin-left: 10px"
+              type="danger"
+              :disabled="index < 1"
+              @click="removeWeek(item)"
+              icon="el-icon-delete"
+              circle
+            ></el-button>
           </div>
         </div>
       </div>
@@ -103,21 +236,50 @@
       </div>
     </el-dialog>
 
-    <el-dialog title="课程调整" width="400px" :before-close="handleClose" :visible.sync="courseVisible">
-      <el-form :model="maskForm" class="maskForm" ref="maskForm" :rules="maskRules" label-position="right"
-        label-width="80px" :inline="true">
+    <el-dialog
+      title="课程调整"
+      width="400px"
+      :before-close="handleClose"
+      :visible.sync="courseVisible"
+    >
+      <el-form
+        :model="maskForm"
+        class="maskForm"
+        ref="maskForm"
+        :rules="maskRules"
+        label-position="right"
+        label-width="80px"
+        :inline="true"
+      >
         <el-form-item label="上课日期" prop="date">
-          <el-date-picker v-model.trim="maskForm.date" type="date" :picker-options="coursesDate()"
-            value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
+          <el-date-picker
+            v-model.trim="maskForm.date"
+            type="date"
+            :picker-options="coursesDate()"
+            value-format="yyyy-MM-dd"
+            placeholder="选择日期"
+          ></el-date-picker>
         </el-form-item>
         <el-form-item label="开始时间" prop="startTime">
-          <el-time-picker placeholder="起始时间" v-model.trim="startTime" @change="changeStartTime" format="HH:mm"
-            value-format="HH:mm" :picker-options="{
-              selectableRange: `${nowTime} - 23:30:00`
-            }"></el-time-picker>
+          <el-time-picker
+            placeholder="起始时间"
+            v-model.trim="startTime"
+            @change="changeStartTime"
+            format="HH:mm"
+            value-format="HH:mm"
+            :picker-options="{
+              selectableRange: `${nowTime} - 23:30:00`,
+            }"
+          ></el-time-picker>
         </el-form-item>
         <el-form-item label="结束时间" prop="endTime">
-          <el-time-picker placeholder="结束时间" format="HH:mm" value-format="HH:mm" v-model="maskForm.endTime" disabled>
+          <el-time-picker
+            placeholder="结束时间"
+            format="HH:mm"
+            value-format="HH:mm"
+            v-model="maskForm.endTime"
+            disabled
+          >
           </el-time-picker>
         </el-form-item>
         <!--v-if="maskForm.teachMode=='OFFLINE'"-->
@@ -138,19 +300,56 @@
         <el-button type="primary" @click="submitResetClass">确 定</el-button>
       </div>
     </el-dialog>
+
+    <el-dialog title="分享模式" width="400px" :visible.sync="shareModeVisible">
+      <el-form
+        :model="shareModeForm"
+        class="maskForm"
+        ref="shareModeForm"
+        label-position="right"
+        label-width="80px"
+        :inline="true"
+      >
+        <el-form-item label="分享模式" prop="shareMode">
+          <el-radio-group v-model="shareModeForm.shareMode">
+            <el-radio label="OPEN">公开</el-radio>
+            <el-radio label="PRIVATE">私密</el-radio>
+          </el-radio-group>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="shareModeVisible = false">取 消</el-button>
+        <el-button type="primary" @click="createShareCode">确 定</el-button>
+      </div>
+    </el-dialog>
+    <qr-code v-model="codeStatus" title="二维码" :codeUrl="qrCodeUrl">
+      <div class="codeType">
+        {{ actvieRow.shareMode == "OPEN" ? "公开二维码" : "私密二维码" }}
+      </div>
+    </qr-code>
   </div>
 </template>
 
 <script>
 import { resetCourse } from "@/api/buildTeam";
 import { vipCourseAdjust } from "@/api/vipSeting";
-import { liveCourseList } from '../../api'
+import { liveCourseList, createLiveGroupShare } from "../../api";
 import { diffTimerFormMinute, addTimerFormMinute } from "@/utils/date";
-import dayjs from 'dayjs';
+import { shareLiveTypeList } from "@/utils/searchArray";
+import { vaildStudentUrl } from "@/utils/validate";
+import dayjs from "dayjs";
+import qrCode from "@/components/QrCode/index";
 export default {
+  components: {
+    qrCode,
+  },
   data() {
     return {
-      id: this.$route.query.id,
+      shareModeList: shareLiveTypeList,
+      searchForm: {
+        id: this.$route.query.id,
+        shareMode: "",
+      },
       adjustmentName: "",
       tableList: [],
       rules: {
@@ -158,7 +357,7 @@ export default {
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 0, // 总条数
-        page_size: [10, 20, 40, 50] // 选择限制显示条数
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
       },
       chioseVipList: [],
       activeList: [],
@@ -170,14 +369,14 @@ export default {
         addCount: "",
         courseType: "ONLINE",
         fee: "",
-        address: ""
+        address: "",
       },
       adjustmentRules: {
         courseTime: [{ required: true, message: "请选择开始时间" }],
         addCount: [{ required: true, message: "请输入加课次数" }],
         courseType: [{ required: true, message: "请选择课程类型" }],
         fee: [{ required: true, message: "请输入费用" }],
-        address: [{ required: true, message: "请选择教学地点" }]
+        address: [{ required: true, message: "请选择教学地点" }],
       },
       weekDateList: [
         { value: "1", label: "星期一" },
@@ -186,15 +385,15 @@ export default {
         { value: "4", label: "星期四" },
         { value: "5", label: "星期五" },
         { value: "6", label: "星期六" },
-        { value: "7", label: "星期日" }
+        { value: "7", label: "星期日" },
       ],
       weekList: [
         {
           dayOfWeek: "",
           startTime: "",
           endTime: "",
-          moid: new Date().getTime()
-        }
+          moid: new Date().getTime(),
+        },
       ],
       courseVisible: false,
       maskForm: {
@@ -203,31 +402,58 @@ export default {
         endTime: "",
         id: "",
         address: "",
-        teachMode: ""
+        teachMode: "",
       },
       maskRules: {
-        date: [{ required: true, message: "请选择上课时间", trigger: "blur" }]
+        date: [{ required: true, message: "请选择上课时间", trigger: "blur" }],
       },
       startTime: "",
+      shareModeForm: {
+        shareMode: "",
+        courseId: "",
+      },
+      shareModeVisible: false,
+      codeStatus: false,
+      qrCodeUrl: "",
+      actvieRow: { shareMode: "" },
     };
   },
   mounted() {
     this.getList();
   },
   methods: {
+    lookCode(row) {
+      this.actvieRow = row;
+      this.qrCodeUrl =
+        vaildStudentUrl() + `/mlive/?courseId=${row.id}&isLogin=true#/login`;
+      this.codeStatus = true;
+    },
+    gotoShareList(row) {
+      this.$router.push({
+        path: "/business/liveShareStudentList",
+        query: { ...this.$route.query, courseId: row.id },
+      });
+    },
+    search() {
+      this.rules.page = 1;
+      this.getList();
+    },
+    onReSet() {
+      this.$refs.searchForm.resetFields();
+      (this.searchForm.id = this.$route.query.id), this.search();
+    },
     async getList() {
       try {
         const { data } = await liveCourseList({
-          liveGroupId: this.id,
+          liveGroupId: this.searchForm.id,
           rows: this.rules.limit,
           page: this.rules.page,
-        })
+          ...this.searchForm,
+        });
         this.tableList = data.list;
         // this.rules.total = data.pageInfo.total;
         this.courseTime = data.singleClassMinutes;
-
-      } catch {
-      }
+      } catch {}
     },
     isDisabled(row, index) {
       if (row.isSettlement || !row.id) {
@@ -242,7 +468,7 @@ export default {
         dayOfWeek: "",
         startClassTime: "",
         endClassTime: "",
-        id: new Date()
+        id: new Date(),
       });
     },
     // 删除循环周
@@ -270,9 +496,9 @@ export default {
       let self = this;
       return {
         firstDayOfWeek: 1,
-        disabledDate: time => {
+        disabledDate: (time) => {
           return time.getTime() + 86400000 <= new Date().getTime();
-        }
+        },
       };
     },
     pickerOptions(dateStr) {
@@ -280,7 +506,7 @@ export default {
         firstDayOfWeek: 1,
         disabledDate(time) {
           return time.getTime() + 86400000 <= new Date().getTime();
-        }
+        },
       };
     },
     resetClass(row) {
@@ -306,7 +532,7 @@ export default {
         endTime: "",
         id: "",
         address: "",
-        teachMode: ""
+        teachMode: "",
       };
       this.$refs["maskForm"].resetFields();
     },
@@ -316,9 +542,7 @@ export default {
         this.$message.error("请填写修改时间");
         return;
       }
-      let classTime = this.maskForm.date
-        ? new Date(this.maskForm.date)
-        : new Date();
+      let classTime = this.maskForm.date ? new Date(this.maskForm.date) : new Date();
       let ymd =
         classTime.getFullYear() +
         "-" +
@@ -336,9 +560,9 @@ export default {
         classDate: this.maskForm.date,
         schoolId: this.maskForm.address || null,
         teachMode: this.maskForm.teachMode || null,
-        groupType: "LIVE"
+        groupType: "LIVE",
       };
-      resetCourse(obj).then(res => {
+      resetCourse(obj).then((res) => {
         if (res.code == 200) {
           this.$message.success("修改成功");
           this.courseVisible = false;
@@ -349,7 +573,7 @@ export default {
       });
     },
     submitAdjustment() {
-      this.$refs["adjustmentForm"].validate(item => {
+      this.$refs["adjustmentForm"].validate((item) => {
         if (item) {
           let week = this.weekList;
           if (!week[0] || !week[0].startClassTime || !week[0].dayOfWeek) {
@@ -359,7 +583,7 @@ export default {
           // 开始
           let obj = {};
           obj.courseCreateStartTime = this.adjustmentForm.courseTime;
-          let idArr = this.activeList.map(item => {
+          let idArr = this.activeList.map((item) => {
             return item.id;
           });
 
@@ -369,9 +593,9 @@ export default {
           obj.holiday = this.adjustmentForm.checked;
           obj.teachMode = this.adjustmentForm.courseType || null;
           obj.groupType = "LIVE";
-          obj.vipGroupId = this.id;
+          obj.vipGroupId = this.searchForm.id;
           obj.schoolId = this.adjustmentForm.address || null;
-          vipCourseAdjust(obj).then(res => {
+          vipCourseAdjust(obj).then((res) => {
             if (res.code == 200) {
               this.$message.success("恭喜您修改成功");
               this.adjustmentVisible = false;
@@ -382,7 +606,7 @@ export default {
       });
     },
     changeStartTime(val) {
-      this.$nextTick(res => {
+      this.$nextTick((res) => {
         if (val) {
           this.$set(
             this.maskForm,
@@ -398,14 +622,10 @@ export default {
       });
     },
     changeStartTimes(val, item) {
-      this.$nextTick(res => {
+      this.$nextTick((res) => {
         if (val) {
           let str = dayjs(new Date()).format("YYYY-MM-DD");
-          this.$set(
-            item,
-            "endClassTime",
-            addTimerFormMinute(str, val, this.courseTime)
-          );
+          this.$set(item, "endClassTime", addTimerFormMinute(str, val, this.courseTime));
         } else {
           this.$set(item, "endClassTime", "");
         }
@@ -415,6 +635,22 @@ export default {
         }
       });
     },
+    startShare(row) {
+      this.shareModeForm.courseId = row.id;
+      this.shareModeForm.shareMode = row.shareMode || "";
+      this.shareModeVisible = true;
+    },
+    async createShareCode() {
+      try {
+        const res = await createLiveGroupShare({
+          ...this.shareModeForm,
+          shareMode: this.shareModeForm.shareMode,
+        });
+        this.shareModeVisible = false;
+        this.$message.success("创建成功");
+        this.getList();
+      } catch (e) {}
+    },
   },
   computed: {
     nowTime() {
@@ -425,7 +661,7 @@ export default {
       }
 
       return str;
-    }
+    },
   },
   filters: {
     formatterTime(val) {
@@ -438,21 +674,19 @@ export default {
       return result;
     },
     formatterStatus(val) {
-      let arr = [
-        "未开始",
-        "报名中",
-        "进行中",
-        "取消",
-        "已结束",
-        "报名结束",
-        "暂停"
-      ];
+      let arr = ["未开始", "报名中", "进行中", "取消", "已结束", "报名结束", "暂停"];
       return arr[val];
-    }
-  }
+    },
+  },
 };
 </script>
 <style lang="scss" scoped>
+.codeType {
+  text-align: center;
+  font-weight: 600;
+  font-size: 16px;
+  margin-bottom: 10px;
+}
 ::v-deep .el-dropdown-link {
   cursor: pointer;
   color: var(--color-primary);
@@ -473,7 +707,6 @@ export default {
 }
 
 .resetClassForm {
-
   ::v-deep .el-date-editor.el-input,
   ::v-deep .el-date-editor.el-input__inner {
     width: 180px !important;
@@ -481,7 +714,6 @@ export default {
 }
 
 .countWrap {
-
   ::v-deep .el-date-editor.el-input,
   ::v-deep .el-date-editor.el-input__inner {
     width: 100px !important;

+ 414 - 0
src/views/liveClassManager/modals/addShareStudentModel.vue

@@ -0,0 +1,414 @@
+<template>
+  <div>
+    <el-dialog
+      width="1000px"
+      title="添加学员"
+      :visible.sync="lookVisible"
+      :before-close="onClose"
+      append-to-body
+    >
+      <div>
+        <el-form :inline="true" :model="searchForm">
+          <el-form :inline="true" :model="searchForm">
+            <el-form-item>
+              <el-input
+                v-model.trim="searchForm.search"
+                clearable
+                @keyup.enter.native="search"
+                placeholder="学员名/编号/手机号"
+              ></el-input>
+            </el-form-item>
+            <el-form-item prop="organIdList">
+              <select-all
+                class="multiple"
+                clearable
+                filterable
+                collapse-tags
+                multiple
+                v-model.trim="searchForm.organIdList"
+                placeholder="请选择分部"
+                @change="onBranchChange"
+              >
+                <el-option
+                  v-for="(item, index) in selects.branchs"
+                  :key="index"
+                  :label="item.name"
+                  :value="item.id"
+                ></el-option>
+              </select-all>
+            </el-form-item>
+            <el-form-item>
+              <el-select
+                multiple
+                collapse-tags
+                v-model.trim="searchForm.cooperationOrganId"
+                clearable
+                filterable
+                placeholder="请选择合作单位"
+                :disabled="searchForm.organIdList.length <= 0"
+              >
+                <el-option
+                  v-for="(item, index) in cooperationList"
+                  :key="index"
+                  :value="item.id"
+                  :label="item.name"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item>
+              <el-select
+                multiple
+                collapse-tags
+                :disabled="searchForm.organIdList.length <= 0"
+                v-model.trim="searchForm.musicGroupId"
+                clearable
+                filterable
+                placeholder="请选择乐团"
+              >
+                <el-option
+                  v-for="(item, index) in teamList"
+                  :key="index"
+                  :value="item.id"
+                  :label="item.name"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+
+            <el-form-item prop="subjectId">
+              <el-select
+                v-model="searchForm.subjectId"
+                clearable
+                filterable
+                placeholder="请选择声部"
+              >
+                <el-option
+                  v-for="item in selects.subjects"
+                  :value="item.id"
+                  :label="item.name"
+                  :key="item.id"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item>
+              <el-select
+                multiple
+                collapse-tags
+                v-model.trim="searchForm.groupList"
+                clearable
+                filterable
+                placeholder="请选择群聊"
+              >
+                <el-option
+                  v-for="(item, index) in groupList"
+                  :key="index"
+                  :value="item.id"
+                  :label="item.name"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item>
+              <el-button @click="search" type="primary">搜索</el-button>
+              <el-button @click="onReSet" type="danger">重置</el-button>
+            </el-form-item>
+          </el-form>
+        </el-form>
+        <auth auths="imLiveRoomPurview/addByCondition">
+          <el-button @click="addAllStudent" type="primary" style="margin-bottom: 10px"
+            >一键添加</el-button
+          >
+        </auth>
+        <div class="tableWrap">
+          <el-table
+            style="width: 100%"
+            :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+            :data="tableList"
+            @selection-change="handleSelectionChange"
+            @select="onTableSelect"
+            ref="multipleSelection"
+          >
+            <el-table-column type="selection" width="55"> </el-table-column>
+            <el-table-column
+              align="center"
+              prop="userId"
+              label="学员编号"
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              prop="username"
+              label="学员姓名"
+            ></el-table-column>
+            <el-table-column align="center" prop="parentsPhone" label="手机号">
+            </el-table-column>
+            <el-table-column align="center" prop="subjectName" label="声部">
+            </el-table-column>
+          </el-table>
+          <pagination
+            sync
+            :total.sync="rules.total"
+            :page.sync="rules.page"
+            :limit.sync="rules.limit"
+            :page-sizes="rules.page_size"
+            @pagination="getList"
+          />
+        </div>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submit">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { addShareStudent, getWaitShareStudent, addByCondition } from "../api";
+import pagination from "@/components/Pagination/index";
+import { getGroupList } from "@/views/groupChatManager/api";
+import { queryByOrganId } from "@/api/systemManage";
+import { getTeamList } from "@/api/teamServer";
+export default {
+  name: "eidtPostMsg",
+  components: { pagination },
+  data() {
+    return {
+      searchForm: {
+        search: "",
+        organIdList: [],
+        cooperationOrganId: [],
+        musicGroupId: [],
+        groupList: [],
+      },
+      tableList: [],
+      organList: [],
+      cooperationList: [],
+      groupList: [],
+      teamList: [],
+      rules: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
+      },
+      addMuiscVisible: false,
+      multipleSelection: [],
+      chioseIdList: [],
+      isNewPage: false,
+      lookVisible: false,
+      activeRow: { sendFlag: false },
+    };
+  },
+
+  mounted() {
+    this.$store.dispatch("setSubjects");
+    this.$store.dispatch("setBranchs");
+    this.getGroupList();
+  },
+  methods: {
+    async getGroupList() {
+      const res = await getGroupList({ page: 1, rows: 9999 });
+      this.groupList = res.data.rows;
+    },
+    async getList() {
+      try {
+        const {
+          organIdList,
+          cooperationOrganId,
+          musicGroupId,
+          groupList,
+          ...rest
+        } = this.searchForm;
+        const res = await getWaitShareStudent({
+          organIds: organIdList.join(","),
+          schoolIds: cooperationOrganId.join(","),
+          teamIds: musicGroupId.join(","),
+          groupIds: groupList.join(","),
+          ...rest,
+          page: this.rules.page,
+          rows: this.rules.limit,
+          courseId: this.activeRow.courseId,
+        });
+        this.tableList = res.data.rows;
+        this.rules.total = res.data.total;
+        let idList = this.chioseIdList.map((group) => {
+          return group.userId;
+        });
+        this.isNewPage = true;
+        this.$nextTick(() => {
+          this.tableList.forEach((course) => {
+            if (idList.indexOf(course.userId) != -1) {
+              this.$refs.multipleSelection.toggleRowSelection(course, true);
+            }
+          });
+          this.isNewPage = false;
+        });
+      } catch (e) {
+        console.log(e);
+      }
+    },
+    search() {
+      this.rules.page = 1;
+      this.getList();
+    },
+    onReSet() {
+      (this.searchForm = {
+        search: "",
+        organIdList: [],
+        cooperationOrganId: [],
+        musicGroupId: [],
+        groupList: [],
+      }),
+        this.clearCom();
+      this.search();
+      this.clearCom();
+      this.search();
+    },
+    async submit() {
+      if (!this.chioseIdList || this.chioseIdList.length <= 0) {
+        this.$message.error("请至少选择一名学生");
+        return;
+      }
+
+      try {
+        let idList = this.chioseIdList.map((group) => {
+          return group.userId;
+        });
+        const res = await addShareStudent({
+          userIds: idList,
+          courseId: this.activeRow.courseId,
+        });
+        this.$message.success("添加成功");
+        this.$emit("getList");
+        this.onClose();
+      } catch (e) {
+        console.log(e);
+      }
+
+      // 开始  addGroupMessageList
+      /**
+       *
+
+       */
+      console.log(this.chioseIdList);
+    },
+    handleSelectionChange(val) {
+      if (val.length > 0) {
+        this.chioseIdList = this.chioseIdList.concat(val);
+        this.chioseIdList = this.$helpers.lodash.uniqBy(this.chioseIdList, "userId");
+      } else {
+        if (this.isNewPage) return;
+        let idList = this.chioseIdList.map((group) => {
+          return group.userId;
+        });
+        this.$nextTick(() => {
+          let tableIdList = [];
+          this.tableList.forEach((group) => {
+            tableIdList.push(group.userId);
+            if (idList.indexOf(group.userId) != -1) {
+              this.$refs.multipleSelection.toggleRowSelection(group, false);
+            }
+          });
+          this.chioseIdList = this.$helpers.lodash.remove(
+            this.chioseIdList,
+            function (item) {
+              return tableIdList.indexOf(item.userId) == -1;
+            }
+          );
+          if (this.chioseIdList.length <= 0) {
+            this.clearCom();
+          }
+        });
+      }
+    },
+    clearCom() {
+      this.chioseIdList = [];
+      this.$refs.multipleSelection.clearSelection();
+    },
+    onTableSelect(rows, row) {
+      let idList = this.chioseIdList.map((group) => {
+        return group.userId;
+      });
+      if (idList.indexOf(row.userId) != -1) {
+        this.chioseIdList.splice(idList.indexOf(row.userId), 1);
+        if (this.chioseIdList.length <= 0) {
+          this.clearCom();
+        }
+      }
+    },
+    onClose() {
+      this.clearCom();
+      this.searchForm.search = "";
+      this.lookVisible = false;
+    },
+    openDioag(row) {
+      this.activeRow = row;
+      this.lookVisible = true;
+      this.getList();
+    },
+    async onBranchChange(val) {
+      // this.searchForm.cooperationOrganId = [];
+      this.$set(this.searchForm, "cooperationOrganId", []);
+      if (val && val.length > 0) {
+        let organId = val.join(",");
+        try {
+          await queryByOrganId({ organId }).then((res) => {
+            if (res.code == 200) {
+              this.cooperationList = res.data;
+            }
+          });
+
+          await getTeamList({ organId, page: 1, rows: 9999 }).then((res) => {
+            if (res.code == 200) {
+              this.teamList = res.data.rows;
+            }
+          });
+        } catch (e) {
+          console.log(e);
+        }
+      }
+    },
+    async addAllStudent() {
+      const {
+        organIdList,
+        cooperationOrganId,
+        musicGroupId,
+        groupList,
+        ...rest
+      } = this.searchForm;
+      if (
+        !organIdList.join(",") &&
+        !cooperationOrganId.join(",") &&
+        !musicGroupId.join(",") &&
+        !groupList.join(",") &&
+        !this.searchForm.search
+      ) {
+        this.$message.error("请至少选择一个搜索条件");
+        return;
+      }
+      try {
+        await this.$confirm("确认后当前所选条件下所有学生都可观看直播", "提示", {
+          type: "warning",
+        });
+
+        const res = await addByCondition({
+          organIds: organIdList.join(","),
+          schoolIds: cooperationOrganId.join(","),
+          teamIds: musicGroupId.join(","),
+          groupIds: groupList.join(","),
+          ...rest,
+          roomUid: this.activeRow.roomUid,
+        });
+        this.$message.success("添加成功");
+        this.$emit("getList");
+        this.onClose();
+      } catch (e) {}
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.w100 {
+  width: 100%;
+}
+.btnWrap {
+  justify-content: flex-start;
+}
+</style>

+ 53 - 163
src/views/teamBuild/signupList.vue

@@ -4,12 +4,7 @@
       <div>
         <div style="display: flex; justify-content: space-between">
           <div
-            style="
-              display: flex;
-              margin-bottom: 15px;
-              font-size: 18px;
-              font-weight: 400;
-            "
+            style="display: flex; margin-bottom: 15px; font-size: 18px; font-weight: 400"
           >
             <p style="margin-right: 10px" v-if="applyExpireDate">
               报名截止时间:{{ applyExpireDate | formatTimer }}
@@ -70,10 +65,7 @@
           </div>
 
           <!-- 家长会 -->
-          <auth
-            :auths="['musicGroup/sendParentMeetingNotice']"
-            v-if="status == 'PAY'"
-          >
+          <auth :auths="['musicGroup/sendParentMeetingNotice']" v-if="status == 'PAY'">
             <div class="newBand" @click="meetingStatus = true">家长会通知</div>
           </auth>
           <div
@@ -106,11 +98,7 @@
           </div>
           <div class="newBand" @click="onCreateQRCode('detail')">缴费详情</div>
           <auth :auths="'studentRegistration/queryPreApplyList/4263'">
-            <div
-              class="newBand"
-              style="margin-right: 0"
-              @click="forecastVisible = true"
-            >
+            <div class="newBand" style="margin-right: 0" @click="forecastVisible = true">
               预报名名单
             </div>
           </auth>
@@ -153,11 +141,7 @@
                 :data="leftList"
                 :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
               >
-                <el-table-column
-                  label="乐团声部"
-                  prop="subjectName"
-                  align="center"
-                >
+                <el-table-column label="乐团声部" prop="subjectName" align="center">
                 </el-table-column>
                 <el-table-column
                   label="计划招生"
@@ -175,11 +159,7 @@
                     </div>
                   </template>
                 </el-table-column>
-                <el-table-column
-                  label="已报名"
-                  prop="applyStudentNum"
-                  align="center"
-                >
+                <el-table-column label="已报名" prop="applyStudentNum" align="center">
                 </el-table-column>
                 <el-table-column label="已缴费" prop="payNum" align="center">
                   <template slot-scope="scope">
@@ -243,9 +223,7 @@
                     <p>
                       购买云教练人数
                       <el-tooltip placement="top" popper-class="mTooltip">
-                        <div slot="content">
-                          已缴费学员中购买了云教练系统的学员总数
-                        </div>
+                        <div slot="content">已缴费学员中购买了云教练系统的学员总数</div>
                         <i
                           class="el-icon-question"
                           style="font-size: 18px; color: #f56c6c"
@@ -284,21 +262,13 @@
                   </template>
                   <template slot-scope="scope">
                     <div>
-                      <el-button
-                        type="text"
-                        @click="getCheckNum(scope.row, 'noCloud')"
-                        >{{
-                          scope.row.noCloudTeacherStudentNumOfNormal
-                        }}</el-button
-                      >
+                      <el-button type="text" @click="getCheckNum(scope.row, 'noCloud')">{{
+                        scope.row.noCloudTeacherStudentNumOfNormal
+                      }}</el-button>
                     </div>
                   </template>
                 </el-table-column>
-                <el-table-column
-                  label="收费金额"
-                  prop="totalAmount"
-                  align="center"
-                >
+                <el-table-column label="收费金额" prop="totalAmount" align="center">
                   <template slot-scope="scope">
                     <div>{{ scope.row.totalAmount | moneyFormat }}元</div>
                   </template>
@@ -332,9 +302,7 @@
                 v-permission="'musicGroup/updateExpectedStudentNum'"
                 style="margin-right: 20px; margin-top: 20px"
               >
-                <p style="color: red">
-                  收费总额:{{ allSubjectTotal | moneyFormat }}元
-                </p>
+                <p style="color: red">收费总额:{{ allSubjectTotal | moneyFormat }}元</p>
                 <el-button
                   v-show="
                     !isEdit &&
@@ -353,11 +321,7 @@
           </auth>
         </div>
       </div>
-      <el-dialog
-        title="选择合并乐团"
-        :visible.sync="mergeVisible"
-        width="950px"
-      >
+      <el-dialog title="选择合并乐团" :visible.sync="mergeVisible" width="950px">
         <mergeMusic
           v-if="mergeVisible"
           style="padding: 0 20px"
@@ -366,21 +330,10 @@
           @submited="getList"
         />
       </el-dialog>
-      <el-dialog
-        title="时间数据统计"
-        :visible.sync="newForecastVisible"
-        width="1100px"
-      >
-        <newForecastList
-          v-if="newForecastVisible"
-          @close="newForecastVisible = false"
-        />
+      <el-dialog title="时间数据统计" :visible.sync="newForecastVisible" width="1100px">
+        <newForecastList v-if="newForecastVisible" @close="newForecastVisible = false" />
       </el-dialog>
-      <el-dialog
-        title="预报名名单"
-        :visible.sync="forecastVisible"
-        width="1150px"
-      >
+      <el-dialog title="预报名名单" :visible.sync="forecastVisible" width="1150px">
         <forecastList v-if="forecastVisible" @close="forecastVisible = false" />
       </el-dialog>
       <!--  stepImgs: {
@@ -389,12 +342,7 @@
       }, -->
     </div>
     <div class="searchList">
-      <save-form
-        :inline="true"
-        :model="searchFrom"
-        @submit="search"
-        @reset="onReset"
-      >
+      <save-form :inline="true" :model="searchFrom" @submit="search" @reset="onReset">
         <el-form-item>
           <el-select
             v-model.trim="searchFrom.subject"
@@ -520,8 +468,13 @@
         </el-form-item>
       </save-form>
     </div>
-    <div class="btnList" style="margin-bottom: 20px"   v-if="status == 'PAY'">
-      <el-button type="primary" @click="onDownload" v-permission="'import/downloadTemplate4907'">下载模板</el-button>
+    <div class="btnList" style="margin-bottom: 20px" v-if="status == 'PAY'">
+      <el-button
+        type="primary"
+        @click="onDownload"
+        v-permission="'import/downloadTemplate4907'"
+        >下载模板</el-button
+      >
       <el-upload
         v-permission="'import/studentToMusicGroup'"
         style="display: inline-block; margin-left: 10px"
@@ -543,11 +496,7 @@
         :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
         @selection-change="handleSelectionChange"
       >
-        <el-table-column
-          type="selection"
-          width="55"
-          :selectable="checkboxSelect"
-        >
+        <el-table-column type="selection" width="55" :selectable="checkboxSelect">
         </el-table-column>
         <el-table-column type="expand">
           <template slot-scope="props">
@@ -555,9 +504,7 @@
               <el-row style="margin-left: 64px">
                 <el-col :span="4">
                   <el-form-item label="入团年份">
-                    <span>
-                      {{ props.row.createTime | dayjsFormat("YYYY年") }}</span
-                    >
+                    <span> {{ props.row.createTime | dayjsFormat("YYYY年") }}</span>
                   </el-form-item>
                 </el-col>
                 <el-col :span="4">
@@ -582,18 +529,10 @@
                   <!-- <el-form-item> -->
                   <!-- <template slot="label"> -->
                   <div class="hiddenwrap">
-                    <p
-                      style="
-                        position: relative;
-                        display: flex;
-                        align-items: center;
-                      "
-                    >
+                    <p style="position: relative; display: flex; align-items: center">
                       解除限制
                       <el-tooltip placement="top" popper-class="mTooltip">
-                        <div slot="content">
-                          学员是否受到不购买团练宝的缴费限制
-                        </div>
+                        <div slot="content">学员是否受到不购买团练宝的缴费限制</div>
                         <i
                           class="el-icon-question"
                           style="font-size: 18px; color: #f56c6c"
@@ -619,12 +558,7 @@
             </el-form>
           </template>
         </el-table-column>
-        <el-table-column
-          label="姓名"
-          prop="studentName"
-          align="center"
-          width="150px"
-        >
+        <el-table-column label="姓名" prop="studentName" align="center" width="150px">
           <template slot-scope="scope">
             <div>
               <p class="courseYellow left">
@@ -661,9 +595,7 @@
         <el-table-column label="年级班级" align="center">
           <template slot-scope="scope">
             <div v-if="gradeListObj[scope.row.currentGrade]">
-              {{
-                gradeListObj[scope.row.currentGrade] + scope.row.currentClass
-              }}
+              {{ gradeListObj[scope.row.currentGrade] + scope.row.currentClass }}
             </div>
           </template>
         </el-table-column>
@@ -683,11 +615,7 @@
         </el-table-column> -->
         <!-- <el-table-column label="报名专业" prop="subjectName" align="center">
         </el-table-column> -->
-        <el-table-column
-          label="调剂专业"
-          prop="actualSubjectName"
-          align="center"
-        >
+        <el-table-column label="调剂专业" prop="actualSubjectName" align="center">
           <template slot-scope="scope">
             <div>
               <p>
@@ -707,11 +635,7 @@
         </el-table-column>
         <!-- visited -->
         <!-- v-show='status == "PAY"' -->
-        <el-table-column
-          label="报名缴费/订单状态"
-          prop="paymentStatus"
-          align="center"
-        >
+        <el-table-column label="报名缴费/订单状态" prop="paymentStatus" align="center">
           <template slot-scope="scope">
             <div>
               <p>{{ scope.row.paymentStatus | paymentStatus }}</p>
@@ -727,11 +651,7 @@
             </div>
           </template>
         </el-table-column> -->
-        <el-table-column
-          label="是否购买会员"
-          prop="hasCloudTeacher"
-          align="center"
-        >
+        <el-table-column label="是否购买会员" prop="hasCloudTeacher" align="center">
           <template slot-scope="scope">
             <div>
               {{ scope.row.hasCloudTeacher == 1 ? "是" : "否" }}
@@ -812,17 +732,13 @@
                 :auths="'studentRegistration/queryFeeDetail'"
                 v-show="scope.row.paymentStatus == 2"
               >
-                <el-button type="text" @click="lookdetail(scope.row)"
-                  >查看</el-button
-                >
+                <el-button type="text" @click="lookdetail(scope.row)">查看</el-button>
               </auth>
               <auth
                 :auths="'musicGroupQuit/apply2'"
                 v-show="scope.row.paymentStatus == 2 && isManage"
               >
-                <el-button type="text" @click="quitTeam(scope.row)"
-                  >退团</el-button
-                >
+                <el-button type="text" @click="quitTeam(scope.row)">退团</el-button>
               </auth>
               <!-- <auth
                 :auths="'musicGroupQuit/directQuitMusicGroup3'"
@@ -832,13 +748,8 @@
                   >退团</el-button
                 >
               </auth> -->
-              <auth
-                :auths="'visit/add/teamSignupList'"
-                v-if="scope.row.visitNum <= 0"
-              >
-                <el-button type="text" @click="addVisit(scope.row)"
-                  >新增回访</el-button
-                >
+              <auth :auths="'visit/add/teamSignupList'" v-if="scope.row.visitNum <= 0">
+                <el-button type="text" @click="addVisit(scope.row)">新增回访</el-button>
               </auth>
               <auth
                 :auths="'subjectChange/getStudentOriginal'"
@@ -852,8 +763,7 @@
               <!--  -->
               <auth
                 v-show="
-                  scope.row.payingStatus == 2 &&
-                  scope.row.noneNeedCloudTeacher == 0
+                  scope.row.payingStatus == 2 && scope.row.noneNeedCloudTeacher == 0
                 "
                 :auths="'studentRegistration/setNoneCloudTeacher'"
               >
@@ -875,9 +785,7 @@
       </el-table>
       <div
         style="margin-top: 10px; margin-bottom: 10px"
-        v-show="
-          status == 'APPLY' || status == 'PROGRESS' || status == 'PREPARE'
-        "
+        v-show="status == 'APPLY' || status == 'PROGRESS' || status == 'PREPARE'"
       >
         <el-button @click="onSelectAll">全选/取消</el-button>
         <auth :auths="'studentRegistration/openPayment'">
@@ -949,10 +857,7 @@
           @click="onExtendPayment('extendForm', isPay)"
           >确 定</el-button
         >
-        <el-button
-          v-else
-          type="primary"
-          @click="onExtendPayment('extendForm', isPay)"
+        <el-button v-else type="primary" @click="onExtendPayment('extendForm', isPay)"
           >确 定</el-button
         >
       </div>
@@ -977,9 +882,7 @@
         </el-col>
       </el-row>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="orderVisible = false"
-          >确 定</el-button
-        >
+        <el-button type="primary" @click="orderVisible = false">确 定</el-button>
       </div>
     </el-dialog>
 
@@ -1010,9 +913,7 @@
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button @click="paymentStatus = false">取 消</el-button>
-        <el-button type="primary" @click="onStartPayment('paymentForm')"
-          >确 定</el-button
-        >
+        <el-button type="primary" @click="onStartPayment('paymentForm')">确 定</el-button>
       </div>
     </el-dialog>
 
@@ -1037,9 +938,7 @@
               <p>退还课程费用:缴费总额-已结束课时单价之和</p>
               <p>退还乐器费用:报名缴费时缴纳的乐器费用(团购、租金)</p>
               <p>退还教辅费用:报名缴费时缴费的教辅费用</p>
-              <p v-if="$helpers.tenantId == 1">
-                退还乐保费用:报名缴费时缴费的乐保费用
-              </p>
+              <p v-if="$helpers.tenantId == 1">退还乐保费用:报名缴费时缴费的乐保费用</p>
             </div>
             <el-button
               type="text"
@@ -1263,21 +1162,15 @@ export default {
         expireDate: null,
       },
       extendRule: {
-        expireDate: [
-          { required: true, message: "请选择延长时间", trigger: "change" },
-        ],
+        expireDate: [{ required: true, message: "请选择延长时间", trigger: "change" }],
       },
       quitRules: {
         isCloudTeacherAmount: [{ required: true, message: "请输入云教练费用" }],
         cloudTeacherAmount: [
           { required: true, message: "请输入云教练金额", trigger: "blur" },
         ],
-        isRefundCourseFee: [
-          { required: true, message: "请选择是否退还课程费用" },
-        ],
-        isRefundInstrumentFee: [
-          { required: true, message: "选择是否退还乐器费用" },
-        ],
+        isRefundCourseFee: [{ required: true, message: "请选择是否退还课程费用" }],
+        isRefundInstrumentFee: [{ required: true, message: "选择是否退还乐器费用" }],
         isRefundTeachingAssistantsFee: [
           { required: true, message: "选择是否退还教辅费用" },
         ],
@@ -1378,9 +1271,7 @@ export default {
       this.pickerOptions = this.beginDate(new Date());
       // checkCanReg
       try {
-        this.ischeckCanReg = await (
-          await checkCanReg({ musicGroupId: this.id })
-        ).data;
+        this.ischeckCanReg = await (await checkCanReg({ musicGroupId: this.id })).data;
       } catch (e) {
         console.log(e);
       }
@@ -1439,18 +1330,18 @@ export default {
       load.endLoading();
       if (response.code == 200) {
         this.$message.success("导入成功");
-        this.getList()
+        this.getList();
       } else if (response.code == 0) {
         let str = this.fomatStr(response.msg);
         this.$alert(str, "导入结果", {
           confirmButtonText: "确定",
           dangerouslyUseHTMLString: true,
           callback: (action) => {
-            this.getList()
+            this.getList();
           },
         });
       } else {
-        console.log('response',response)
+        console.log("response", response);
         this.$message.error(response.msg);
       }
     },
@@ -1862,8 +1753,7 @@ export default {
                 this.extendPaymentStatus = false;
                 getTeamBaseInfo({ musicGroupId: this.id }).then((res) => {
                   if (res.code == 200) {
-                    this.paymentExpireDate =
-                      res.data.musicGroup.paymentExpireDate;
+                    this.paymentExpireDate = res.data.musicGroup.paymentExpireDate;
                   }
                 });
               } else {
@@ -1891,7 +1781,7 @@ export default {
               item.name = "云教练";
             } else if (item.type == "COURSE") {
               item.name = "课程";
-            }else if(item.type == "ORGAN_SHARE_PROFIT"){
+            } else if (item.type == "ORGAN_SHARE_PROFIT") {
               item.name = "乐器分润";
             }
             if (courseType[item.type]) {
@@ -1992,8 +1882,8 @@ export default {
                 reason: this.quitForm.reason,
                 isRefundCourseFee: this.quitForm.isRefundCourseFee,
                 isRefundInstrumentFee: this.quitForm.isRefundInstrumentFee,
-                isRefundTeachingAssistantsFee:
-                  this.quitForm.isRefundTeachingAssistantsFee,
+                isRefundTeachingAssistantsFee: this.quitForm
+                  .isRefundTeachingAssistantsFee,
                 maintenanceFee: this.quitForm.maintenanceFee,
                 isRefundMemberFee: this.quitForm.isRefundMemberFee,
               };