Przeglądaj źródła

修复课程调整

1
mo 3 lat temu
rodzic
commit
f2b2797fc3

+ 29 - 14
src/views/teamDetail/componentCourse/addCompound.vue

@@ -90,17 +90,19 @@
               @click="removeCourse"
               :disabled="!dataList.length > 0"
               type="primary"
-              
               >批量删除</el-button
             >
 
-            <el-button type="primary" @click="resetClass" 
+            <el-button
+              type="primary"
+              @click="resetClass"
               v-permission="'courseSchedule/batchCourseAdjust'"
-
               >课程调整</el-button
             >
-            <el-button type="primary" @click="submitClass" 
-            v-permission="'courseSchedule/courseMerge'"
+            <el-button
+              type="primary"
+              @click="submitClass"
+              v-permission="'courseSchedule/courseMerge'"
               >课程合并</el-button
             >
           </div>
@@ -129,7 +131,7 @@
     <el-dialog
       :visible.sync="resetCourseVisible"
       v-if="resetCourseVisible"
-        @closeReset="closeReset"
+      @closeReset="closeReset"
       title="课程调整"
       append-to-body
       width="800px"
@@ -236,7 +238,7 @@ export default {
       this.clearCom();
       this.show = false;
       this.isLook = false;
-      this.resetCourseVisible = false
+      this.resetCourseVisible = false;
       this.$emit("getList");
     },
     cancaleMerge() {
@@ -251,29 +253,42 @@ export default {
       // 判断条件
       if (!this.checkCourseTimer()) {
         this.$message.error("请选择相同的课程时长");
-        return
+        return;
       }
       let isNotStart = false;
-      let  idList =[];
+      let idList = [];
       this.dataList.forEach((course) => {
-        idList.push(course.id)
+        idList.push(course.id);
         if (course.status != "NOT_START") {
           isNotStart = true;
         }
+        if (course.newCourseId > 0 || course.beMerged) {
+          this.$message.error("已经合并课程不能调整");
+          isFlage = true;
+          return;
+        }
+        if (course.isLock) {
+          this.$message.error("已锁定的课程不能调整");
+          isFlage = true;
+          return;
+        }
       });
       if (isNotStart) {
         this.$message.error("请选择未开始的课程");
         return;
       }
-      let isEqual = this.dataList.every(coures=>{
-        return coures.musicGroupId==this.dataList[0].musicGroupId&&coures.groupType==this.dataList[0].groupType
-      })
+      let isEqual = this.dataList.every((coures) => {
+        return (
+          coures.musicGroupId == this.dataList[0].musicGroupId &&
+          coures.groupType == this.dataList[0].groupType
+        );
+      });
       if (!isEqual) {
         this.$message.error("请选择相同的课程组");
         return;
       }
 
-       this.idList = idList;
+      this.idList = idList;
       //  开始选择课程
       this.resetCourseVisible = true;
     },

+ 7 - 3
src/views/teamDetail/teamCourseList.vue

@@ -139,7 +139,7 @@
                           </span>
                           <el-button
                             type="text"
-                            @click="common(scope.row)"
+                            @click="common(props.row)"
                             v-if="
                               props.row.newCourseId > 0 &&
                               props.row.newCourseId != props.row.id
@@ -340,12 +340,16 @@
                   <el-button v-if='"/teamCourseListDetail"' type="text" @click="lookDetail(scope.row)"
                     >详情</el-button
                   >
-                <!-- </auth> -->
+                <!-- </auth>  v-if="
+                              props.row.newCourseId > 0 &&
+                              props.row.newCourseId != props.row.id
+                            "-->
                 <el-button
                   type="text"
                   v-if="
                     permission('courseSchedule/classStartDateAdjust?hight') &&
-                    (!scope.row.isLock || scope.row.newCourseId > 0)
+                    (!scope.row.isLock && !(scope.row.newCourseId > 0&&
+                              scope.row.newCourseId != scope.row.id))
                   "
                   @click="resetClass(scope.row)"
                   >调整</el-button