浏览代码

老师调整结束

1
mo 4 年之前
父节点
当前提交
751d5a30f6

+ 10 - 0
src/api/buildTeam.js

@@ -1570,3 +1570,13 @@ export function sendWaitRenewMessage(data) {
   })
 }
 
+// 批量调整
+export function batchCourseAdjust(data) {
+  return request2({
+    url: api + `/courseSchedule/batchCourseAdjust`,
+    method: 'post',
+    params:{},
+    data
+  })
+}
+

+ 191 - 79
src/views/teamDetail/componentCourse/addCompound.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="fixedBox">
+  <div class="fixedBox" @click="isLook = true">
     <el-card>
       <div class="boxWrap">
         <p>
@@ -7,7 +7,7 @@
             {{ compoundList.length }}
           </span>
         </p>
-        <el-popover placement="top" v-model="isLook" trigger="click">
+        <el-popover placement="top" v-model="isLook" trigger="manual">
           <div>
             <p class="title">
               待处理课程列表<i
@@ -22,69 +22,67 @@
             >清空列表</el-button
           >
           <div>
-              <el-table
-                :data="dataList"
-                height="300px"
-                :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+            <el-table
+              :data="dataList"
+              height="300px"
+              :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+            >
+              <el-table-column align="center" label="课程编号" width="110">
+                <template slot-scope="scope">
+                  <div>{{ scope.row.id }}</div>
+                </template>
+              </el-table-column>
+              <el-table-column
+                align="center"
+                width="180px"
+                label="课程名称"
+                prop="name"
+              ></el-table-column>
+              <el-table-column align="center" label="课程类型">
+                <template slot-scope="scope">
+                  <div>{{ scope.row.type | coursesType }}</div>
+                </template>
+              </el-table-column>
+              <el-table-column
+                align="center"
+                width="180px"
+                prop="teacherName"
+                label="指导老师"
               >
-                <el-table-column align="center" label="课程编号" width="110">
-                  <template slot-scope="scope">
-                    <div>{{ scope.row.id }}</div>
-                  </template>
-                </el-table-column>
-                <el-table-column
-                  align="center"
-                  width="180px"
-                  label="课程名称"
-                  prop="name"
-                ></el-table-column>
-                <el-table-column align="center" label="课程类型">
-                  <template slot-scope="scope">
-                    <div>{{ scope.row.type | coursesType }}</div>
-                  </template>
-                </el-table-column>
-                <el-table-column
-                  align="center"
-                  width="180px"
-                  prop="teacherName"
-                  label="指导老师"
+                <template slot-scope="scope">
+                  <div>
+                    {{ scope.row.teacherName }}({{ scope.row.actualTeacherId }})
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column align="center" width="200px" label="上课时间">
+                <template slot-scope="scope"
+                  >{{
+                    scope.row.startClassTime
+                      ? scope.row.startClassTime.substr(0, 16)
+                      : ""
+                  }}-{{
+                    scope.row.endClassTime
+                      ? scope.row.endClassTime.substr(11, 5)
+                      : ""
+                  }}</template
                 >
-                  <template slot-scope="scope">
-                    <div>
-                      {{ scope.row.teacherName }}({{
-                        scope.row.actualTeacherId
-                      }})
-                    </div>
-                  </template>
-                </el-table-column>
-                <el-table-column align="center" width="200px" label="上课时间">
-                  <template slot-scope="scope"
-                    >{{
-                      scope.row.startClassTime
-                        ? scope.row.startClassTime.substr(0, 16)
-                        : ""
-                    }}-{{
-                      scope.row.endClassTime
-                        ? scope.row.endClassTime.substr(11, 5)
-                        : ""
-                    }}</template
+              </el-table-column>
+              <el-table-column align="center" width="100px" label="是否结算">
+                <template slot-scope="scope">
+                  <div>
+                    {{ scope.row.isSettlement ? "是" : "否" }}
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column align="center" label="操作">
+                <template slot-scope="scope">
+                  <el-button type="text" @click="cancleCom(scope.row)"
+                    >取消</el-button
                   >
-                </el-table-column>
-                <el-table-column align="center" width="100px" label="是否结算">
-                  <template slot-scope="scope">
-                    <div>
-                      {{ scope.row.isSettlement ? "是" : "否" }}
-                    </div>
-                  </template>
-                </el-table-column>
-                <el-table-column align="center" label="操作">
-                  <template slot-scope="scope">
-                    <el-button type="text" @click="cancleCom(scope.row)"
-                      >取消</el-button
-                    >
-                  </template>
-                </el-table-column>
-              </el-table>
+                </template>
+              </el-table-column>
+            </el-table>
           </div>
           <div class="addBtnList">
             <el-button
@@ -95,10 +93,11 @@
               size="mini"
               >批量删除</el-button
             >
-            <el-button
-              type="primary"
-              @click="submitClass"
-              size="mini"
+
+            <el-button type="primary" @click="resetClass" size="mini"
+              >课程调整</el-button
+            >
+            <el-button type="primary" @click="submitClass" size="mini"
               >课程合并</el-button
             >
           </div>
@@ -109,27 +108,45 @@
     </el-card>
     <el-dialog
       :visible.sync="show"
+      v-if="show"
       title="临时合课信息"
       append-to-body
       width="800px"
     >
       <compoundClass
-        :show="show"
-        v-if="show"
         @closeReset="closeReset"
+        @cancaleMerge="cancaleMerge"
         :isDisabled="true"
         @getList="getList"
         :idList="idList"
-        :dataList='dataList'
+        :dataList="dataList"
+      />
+    </el-dialog>
+
+    <el-dialog
+      :visible.sync="resetCourseVisible"
+      v-if="resetCourseVisible"
+        @closeReset="closeReset"
+      title="课程调整"
+      append-to-body
+      width="800px"
+    >
+      <resetCourse
+        :idList="idList"
+        :dataList="dataList"
+        @getList="getList"
+        @cancaleMerge="cancaleMerge"
+        @closeReset="closeReset"
       />
     </el-dialog>
   </div>
 </template>
 <script>
 import compoundClass from "./compoundClass";
+import resetCourse from "./resetCourse";
 export default {
   props: ["compoundList"],
-  components: { compoundClass },
+  components: { compoundClass, resetCourse },
   data() {
     return {
       radio: "",
@@ -137,6 +154,8 @@ export default {
       isLook: false,
       show: false,
       idList: "",
+      courseTime: 0,
+      resetCourseVisible: false,
     };
   },
   methods: {
@@ -151,17 +170,55 @@ export default {
       //   this.$message.error("请选择一节主课");
       //   return;
       // }
-      // let arr = []
+      let arr = [];
       let idList = [];
+      let isFlage = false;
       this.dataList.forEach((com) => {
-        // arr.push(com.type)
+        arr.push(com.type);
         idList.push(com.id);
+        if (
+          com.groupType != "MUSIC" ||
+          com.type == "MUSIC_NETWORK" ||
+          com.type == "HIGH_ONLINE"
+        ) {
+          this.$message.error("只有乐团课的下线课可以合并");
+          isFlage = true;
+          return;
+        }
+        if (com.status != "NOT_START") {
+          this.$message.error("只有未开始的课可以合并");
+          isFlage = true;
+          return;
+        }
+        if (com.newCourseId > 0 || com.beMerged) {
+          this.$message.error("已经合并课程不可再次合并");
+          isFlage = true;
+          return;
+        }
+        if (com.isLock) {
+          this.$message.error("已锁定的课程不能合并");
+          isFlage = true;
+          return;
+        }
       });
-      // arr = [... new Set(arr)]
-      // if (arr.length != 1) {
-      //   this.$message.error('请选择相同的课程类型')
-      //   return
-      // }
+      if (isFlage) return;
+      /**
+       *  scope.row.groupType == 'MUSIC' &&
+                    scope.row.type != 'MUSIC_NETWORK' &&
+                    scope.row.type != 'HIGH_ONLINE' &&
+                    scope.row.status == 'NOT_START' &&
+                     scope.row.newCourseId <= 0
+                     !scope.row.beMerged &&
+                    !scope.row.isLock
+       */
+      if (arr.indexOf("HIGH") != -1) {
+        arr = [...new Set(arr)];
+        if (arr.length != 1) {
+          this.$message.error("基础技能课只能和基础技能课合并");
+          return;
+        }
+      }
+
       if (this.dataList.length <= 1) {
         this.$message.error("请至少选择2节课程");
         return;
@@ -169,23 +226,78 @@ export default {
       // 做判断
       this.idList = idList.join(",");
       this.show = true;
-      this.isLook = false;
+      // this.isLook = false;
     },
     getList() {},
     closeReset() {
       this.clearCom();
       this.show = false;
+      this.isLook = false;
+      this.resetCourseVisible = false
       this.$emit("getList");
     },
+    cancaleMerge() {
+      this.show = false;
+      this.resetCourseVisible = false;
+      this.isLook = true;
+    },
     removeCourse() {
       this.$emit("removeCourse");
     },
+    resetClass() {
+      // 判断条件
+      console.log(this.dataList);
+      if (!this.checkCourseTimer()) {
+        this.$message.error("请选择相同的课程时长");
+      }
+      let isclassGroup;
+      let isNotStart = false;
+      let arr = [];
+      let  idList =[];
+      this.dataList.forEach((course) => {
+        idList.push(course.id)
+        arr.push(course.classGroupId);
+        if (course.status != "NOT_START") {
+          isNotStart = true;
+        }
+      });
+      if (isNotStart) {
+        this.$message.error("请选择未开始的课程");
+        return;
+      }
+      if ((arr = [...new Set(arr)].length != 1)) {
+        this.$message.error("请选择相同的课程组");
+        return;
+      }
+       this.idList = idList;
+      //  开始选择课程
+      this.resetCourseVisible = true;
+    },
+    checkCourseTimer() {
+      let arr = [];
+      this.dataList.forEach((course) => {
+        let dayjs = this.$helpers.dayjs;
+        arr.push(
+          Math.abs(
+            dayjs(course.startClassTime).diff(course.endClassTime, "Minute")
+          )
+        );
+      });
+      if ((arr = [...new Set(arr)].length != 1)) {
+        return false;
+      } else {
+        this.courseTime = arr[0];
+        return true;
+      }
+    },
   },
   watch: {
     compoundList(val) {
-      console.log(val);
       this.dataList = val;
     },
+    isLook(val) {
+      console.log(val);
+    },
   },
 };
 </script>

+ 27 - 14
src/views/teamDetail/componentCourse/compoundClass.vue

@@ -32,7 +32,7 @@
       </el-row>
       <el-row>
         <el-col :span="12">
-          <el-form-item label="课程名称" prop="teacher">
+          <el-form-item label="课程名称" prop="name">
             <el-input
               v-model.trim="maskForm.name"
               style="width: 220px !important"
@@ -53,7 +53,7 @@
       <el-row>
         <el-col :span="12">
           <el-form-item label="主教老师" prop="teacher">
-            <el-select
+            <!-- <el-select
               v-model.trim="maskForm.teacher"
               style="width: 220px !important"
               @change="changeTeacher"
@@ -71,7 +71,12 @@
                   String(item.id)
                 }}</span>
               </el-option>
-            </el-select>
+            </el-select> -->
+            <remote-search
+              :commit="'setTeachers'"
+              v-model="maskForm.teacher"
+              :width="220"
+            />
           </el-form-item>
         </el-col>
         <el-col :span="12">
@@ -84,7 +89,14 @@
             "
             prop="assistant"
           >
-            <el-select
+            <!-- :multiple="true" -->
+            <remote-search
+              :commit="'setTeachers'"
+              v-model="maskForm.assistant"
+              :multiple="true"
+              :width="220"
+            />
+            <!-- <el-select
               v-model.trim="maskForm.assistant"
               style="width: 220px !important"
               clearable
@@ -103,7 +115,7 @@
                   String(item.id)
                 }}</span>
               </el-option>
-            </el-select>
+            </el-select> -->
           </el-form-item>
         </el-col>
       </el-row>
@@ -205,7 +217,7 @@
       </el-row>
     </el-form>
     <div slot="footer" class="dialog-footer">
-      <el-button @click="$listeners.closeReset">取 消</el-button>
+      <el-button @click="cancaleMerge">取 消</el-button>
       <el-button type="primary" @click="submitResetClass">确 定</el-button>
     </div>
     <el-dialog
@@ -263,9 +275,7 @@ export default {
         endTime: [
           { required: true, message: "请选择上课结束时间", trigger: "blur" },
         ],
-        id:[
-           { required: true, message: "请选择一节主课", trigger: "blur" },
-        ]
+        id: [{ required: true, message: "请选择一节主课", trigger: "blur" }],
       },
       teacherList: [],
       schoolList: [],
@@ -376,11 +386,11 @@ export default {
         this.maskForm.address = "";
       }
     },
-    changeId(val){
-      if(val){
-        this.getDetail(val)
-      }else{
-        this.$refs.maskForm.resetFields()
+    changeId(val) {
+      if (val) {
+        this.getDetail(val);
+      } else {
+        this.$refs.maskForm.resetFields();
       }
     },
     getDetail(id) {
@@ -433,6 +443,9 @@ export default {
         }
       });
     },
+    cancaleMerge() {
+      this.$emit("cancaleMerge");
+    },
   },
 
   watch: {

+ 12 - 0
src/views/teamDetail/componentCourse/modals/coursePostpone.vue

@@ -0,0 +1,12 @@
+<template>
+  <div>
+
+  </div>
+</template>
+<script>
+export default {
+  data(){
+    return
+  }
+}
+</script>

+ 79 - 0
src/views/teamDetail/componentCourse/modals/resetCoursePreview.vue

@@ -0,0 +1,79 @@
+<template>
+  <div>
+    <el-table
+      :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+      :data="details"
+    >
+      <el-table-column
+        label="乐团/课程组编号"
+        width="130px"
+        prop="musicGroupId"
+      >
+      </el-table-column>
+      <el-table-column prop="id" width="100px" label="课程编号">
+      </el-table-column>
+      <el-table-column align="center" width="150px" label="课程类型">
+        <template slot-scope="scope">
+          <div>{{ scope.row.type | coursesType }}</div>
+        </template>
+      </el-table-column>
+      <el-table-column prop="subjectName" label="声部"></el-table-column>
+      <el-table-column
+        label="课程名称"
+        prop="name"
+        width="150px"
+      ></el-table-column>
+      <el-table-column label="课程时长(分钟)" key="time">
+        <span slot-scope="scope">{{ getTimers(scope.row) }}</span>
+      </el-table-column>
+      <el-table-column
+        align="center"
+        prop="teacherName"
+        width="110"
+        label="主教老师"
+      ></el-table-column>
+      <el-table-column label="助教老师" prop="teachingTeacherNames"></el-table-column>
+      <el-table-column align="center" width="200px" label="上课时间">
+        <template slot-scope="scope"
+          >{{
+            scope.row.startClassTime
+              ? scope.row.startClassTime.substr(0, 16)
+              : ""
+          }}-{{
+            scope.row.endClassTime ? scope.row.endClassTime.substr(11, 5) : ""
+          }}</template
+        >
+      </el-table-column>
+      <el-table-column label="教学点">
+         <template slot-scope="scope">
+              <div>
+                {{ scope.row.schoolName ? scope.row.schoolName : "网络教室" }}
+              </div>
+            </template>
+      </el-table-column>
+      <el-table-column label="上课模式" prop="teachMode">
+          <template slot-scope="scope">
+              <div>
+                {{ scope.row.teachMode | paymentType}}课
+              </div>
+            </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+<script>
+import { diffTimerFormMinute } from '@/utils/date'
+import dayjs from 'dayjs';
+export default {
+  props: ["details"],
+  data() {
+    return {};
+  },
+  methods:{
+     getTimers (item) {
+      const time = diffTimerFormMinute(dayjs(item.classDate).format('YYYY-MM-DD'), dayjs(item.startClassTime).format('HH:mm'), dayjs(item.endClassTime).format('HH:mm'))
+      return time
+    }
+  }
+};
+</script>

+ 101 - 0
src/views/teamDetail/componentCourse/modals/resetTeacher.vue

@@ -0,0 +1,101 @@
+<template>
+  <div>
+    <el-form
+      :model="maskForm"
+      class="maskForm"
+      ref="maskForm"
+      :rules="maskRules"
+      label-position="right"
+      :inline="true"
+    >
+      <!--  label-width="120px" -->
+      <el-row>
+        <el-col :span="12">
+          <el-form-item label="主教老师" prop="teacher">
+            <remote-search
+              :commit="'setTeachers'"
+              v-model="maskForm.teacher"
+              :width="220"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="助教老师" prop="assistant">
+            <!-- :multiple="true" -->
+            <remote-search
+              :commit="'setTeachers'"
+              v-model="maskForm.assistant"
+              :multiple="true"
+              :width="220"
+            />
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <div class="buttonWrap">
+      <el-button @click="gotoNext" type="primary">下一步</el-button>
+    </div>
+  </div>
+</template>
+<script>
+export default {
+  props:['idList','dataList'],
+  data() {
+    return {
+      maskForm: {
+        teacher: "",
+        assistant: [],
+      },
+      maskRules: {
+        teacher: [
+          { required: true, message: "请选择主教老师名称", trigger: "blur" },
+        ],
+      },
+    };
+  },
+  methods: {
+    cancaleMerge() {
+      this.$emit("cancaleMerge");
+    },
+    gotoNext() {
+      this.$refs.maskForm.validate((reset) => {
+        if (reset) {
+          let classGroupTeacherMapperList = [
+            { userId: this.maskForm.teacher, teacherRole: "BISHOP" },
+          ];
+          for (let i in this.maskForm.assistant) {
+            classGroupTeacherMapperList.push({
+              userId: this.maskForm.assistant[i],
+              teacherRole: "TEACHING",
+            });
+          }
+          let obj = {
+            courseScheduleIds: this.idList,
+            changeMainTeacher: true,
+            changeTeachingTeacher: this.maskForm?.assistant?.length>0?true:false,
+            startDate: null,
+            startTime: "",
+            pauseDate: "",
+            recoveryDate: "",
+            classGroupTeacherMapperList:classGroupTeacherMapperList,
+            teachMode: null,
+            allowZeroSalary: false,
+            schoolId: null,
+            confirmGenerate: false,
+            holiday: false,
+          };
+          this.$emit("submit", obj);
+        }
+      });
+    },
+  },
+};
+</script>
+<style  lang="scss" scoped>
+  .buttonWrap{
+    width: 100%;
+    display: flex;
+    flex-direction: row;
+    justify-content: flex-end;
+  }
+</style>

+ 102 - 0
src/views/teamDetail/componentCourse/resetCourse.vue

@@ -0,0 +1,102 @@
+<template>
+  <div>
+    <!-- @tab-click="handleClick" -->
+    <el-tabs v-model="activeName">
+      <el-tab-pane label="老师调整" name="first">
+        <resetTeacher
+          v-if="activeName == 'first'"
+          @cancaleMerge="cancaleMerge"
+          :idList="idList"
+          :dataList="dataList"
+          @submit="submit"
+        />
+      </el-tab-pane>
+      <el-tab-pane label="课程顺延" name="second"> </el-tab-pane>
+      <el-tab-pane label="课程调整" name="third"> </el-tab-pane>
+    </el-tabs>
+    <el-dialog
+      title="班级预览"
+      :visible.sync="previewVisible"
+      append-to-body
+      width="900px"
+    >
+      <preview :details="previewList" />
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="previewVisible = false">上一步</el-button>
+        <el-button type="primary" @click="resetsubmit">确认调整</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import resetTeacher from "./modals/resetTeacher";
+import { batchCourseAdjust } from "@/api/buildTeam";
+import preview from "./modals/resetCoursePreview";
+export default {
+  components: { resetTeacher, preview },
+  props: ["dataList", "idList"],
+  data() {
+    return {
+      activeName: "first",
+      previewVisible: false,
+      previewList: [],
+      obj: {},
+    };
+  },
+  methods: {
+    handleClick(val) {
+      // console.log(val)
+      // this.activeName = val
+    },
+    cancaleMerge() {
+      this.$emit("cancaleMerge");
+    },
+    async submit(form) {
+      console.log(form);
+      try {
+        const res = await batchCourseAdjust(form);
+        if (res.code == 206) {
+          this.previewList = res.data;
+          this.previewVisible = true;
+          this.obj = form;
+        }
+        if(res.code == 200){
+            this.$message.success('调整成功')
+             this.$emit("closeReset");
+        }
+      } catch (e) {
+        console.log(e);
+      }
+    },
+    async resetsubmit() {
+      try {
+        this.obj.confirmGenerate = true;
+        const res = await batchCourseAdjust(this.obj);
+        if (res.code == 200) {
+           this.$message.success('调整成功')
+          this.$emit("closeReset");
+        }
+        if(res.code == 207){
+          console.log(207)
+           await this.$confirm(
+          res.msg || `当前课程课酬预计为0,是否继续`,
+          "提示",
+          {
+            type: "warning",
+          }
+        );
+        this.obj.allowZeroSalary = true;
+        await batchCourseAdjust(this.obj);
+        this.$message.success('调整成功')
+          this.$emit("closeReset");
+        }
+      } catch (e) {
+        console.log(e);
+      }
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 38 - 20
src/views/teamDetail/teamCourseList.vue

@@ -221,6 +221,7 @@
           ref="tableList"
           :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
           @selection-change="handleSelectionChange"
+           @select='onTableSelect'
           row-key="id"
         >
           >
@@ -624,8 +625,10 @@
       />
     </el-dialog>
     <addCompound
+    ref='addCompound'
       :compoundList="deleteList"
       v-if="permission('courseSchedule/courseMerge')"
+      v-show="deleteList.length>0"
       @clearCom="clearCom"
       @getList="getList"
       @removeCourse="removeCourse"
@@ -796,7 +799,6 @@ export default {
       }
       let flag = false;
       let arr = this.deleteList.map((course) => {
-        console.log(course.status, course.isSettlement);
         if (course.isSettlement || course.status == "UNDERWAY") {
           flag = true;
         }
@@ -807,17 +809,22 @@ export default {
         return;
       }
       let courseScheduleIds = arr.join(",") || row.id;
-      try {
-        await this.$confirm("是否确认删除此数据?", "提示", {
-          type: "warning",
-        });
+
+      this.$confirm("是否确认删除此数据?", "提示", {
+        type: "warning",
+      }).then(() => {
         bathDelete({ courseScheduleIds: courseScheduleIds }).then((res) => {
           if (res.code == 200) {
             this.$message.success("删除成功");
             this.getList();
+            this.deleteList = [];
           }
+        }).catch((e)=>{
+            this.$refs.addCompound.isLook = true
         });
-      } catch (error) {}
+      }).catch((e) => {
+        this.$refs.addCompound.isLook = true
+      });;
     },
     reset() {
       this.searchForm = { ...initSearch };
@@ -948,7 +955,7 @@ export default {
                 this.$refs.tableList.toggleRowSelection(course, true);
               }
             });
-              this.isDetele = false;
+            this.isDetele = false;
           });
 
           // let arr = this.$helpers.lodash.differenceWith( this.tableList, this.deleteList,'id')
@@ -1017,22 +1024,23 @@ export default {
     //   return flag;
     // },
     cancleCompound(row) {
-      // let indexNum = null;
-      // this.deleteList.forEach((com, index) => {
-      //   if (com.id == row.id) {
-      //     indexNum = index;
-      //   }
-      // });
-      // if (indexNum + "") {
-      //   this.deleteList.splice(indexNum, 1);
-      // }
+      let indexNum = null;
+      this.deleteList.forEach((com, index) => {
+        if (com.id == row.id) {
+          indexNum = index;
+        }
+      });
+      if (indexNum + "") {
+        this.deleteList.splice(indexNum, 1);
+      }
       console.log(row);
       this.$refs.tableList.toggleRowSelection(row);
     },
     clearCom() {
       // this.deleteList = [];
-      // this.$set(this,'deleteList',[])
+      this.$set(this,'deleteList',[])
       this.$refs.tableList.clearSelection();
+      this.$refs.addCompound.isLook = false
     },
     resetCompound(row) {
       this.$confirm("您确定取消合并该课程?", "提示", {
@@ -1053,11 +1061,13 @@ export default {
     handleSelectionChange(arr) {
       // this.deleteList = arr;
       if (arr.length > 0) {
-        console.log("添加");
-
+        // 有可能加 有可能减
         this.deleteList = this.deleteList.concat(arr);
+        // 去重
         this.deleteList = this.$helpers.lodash.uniqBy(this.deleteList, "id");
-      } else {
+      }
+      // else if(){}
+      else {
         if (this.isDetele) return;
         // 有2种 1是新页
         // 2是点击反选
@@ -1082,6 +1092,14 @@ export default {
         });
       }
     },
+   onTableSelect(rows,row){
+       let idList = this.deleteList.map((course) => {
+          return course.id;
+        });
+        if(idList.indexOf(row.id)!= -1){
+          this.deleteList.splice(idList.indexOf(row.id),1)
+        }
+   }
   },
   filters: {
     isCall(val) {