Browse Source

转换完毕 准备测试提交

1
mo 2 years ago
parent
commit
5c8caa5e2e

+ 8 - 0
src/views/teamDetail/api.js

@@ -63,3 +63,11 @@ export const getCourseScheduleConvert = data => request2({
   method: 'get',
   requestType: 'form'
 })
+
+
+//课程转换
+export const courseScheduleConvert = data => request2({
+  url: '/api-web/courseScheduleConvert/action',
+  data,
+  method: 'post'
+})

+ 1 - 1
src/views/teamDetail/components/courseList.vue

@@ -582,7 +582,7 @@
         @pagination="getCallName"
       />
     </el-dialog>
-    <transStart ref='transStart' :activeCourseList='activeCourseList'/>
+    <transStart ref='transStart' :activeCourseList='activeCourseList' @getList="getList"/>
   </div>
 </template>
 <script>

+ 159 - 68
src/views/teamDetail/components/courseTransModals/startPlanCourse.vue

@@ -6,39 +6,72 @@
       width="1050px"
       :visible.sync="transPlanVisible"
     >
-    <el-form :model="activeRow" :inline="true" ref="form"    label-suffix=": ">
-        <div v-if="activeRow.classs['HIGH_ONLINE']">
-          <p class="title">
-            <span style="font-weight: 600">线上基础技能课</span>
-            可排课时长:<span style="color: red">{{
-              form.courseConvertSum.courseMinute
-            }}</span
-            >分钟
-            <span style="color: #333"
-              >已排课时长:
-              <span style="color: red"> {{ this.alltime }}分钟</span></span
-            >
-          </p>
-
-          <courseItem
-            :form="activeRow.classs['HIGH_ONLINE']"
-            :teacherList="teacherList"
-            :surplustime="form.courseConvertSum.courseMinute"
-            :activeType="'HIGH_ONLINE'"
-            :coreid="activeRow.coreTeacher"
-            :type="'HIGH_ONLINE'"
-            :prices="prices"
-            :holidays="holidays"
-            @setUserTime="setUserTime"
-          />
+      <div v-if="myForm && myForm.classs && myForm.classs['HIGH_ONLINE']">
+        <el-form
+          :model="myForm"
+          :inline="true"
+          ref="planform"
+          label-suffix=": "
+        >
+          <div v-if="!isMoreClass">
+            <p class="title">
+              <span style="font-weight: 600">线上基础技能课</span>
+              可排课时长:<span style="color: red">{{
+                form.courseConvertSum.courseMinute
+              }}</span
+              >分钟
+              <span style="color: #333"
+                >已排课时长:
+                <span style="color: red"> {{ alltime }}分钟</span></span
+              >
+            </p>
 
+            <courseItem
+              :form="myForm.classs['HIGH_ONLINE']"
+              :teacherList="teacherList"
+              :surplustime="form.courseConvertSum.courseMinute"
+              :activeType="'HIGH_ONLINE'"
+              :coreid="myForm.coreTeacher"
+              :type="'HIGH_ONLINE'"
+              :prices="prices"
+              :holidays="holidays"
+              @setUserTime="setUserTime"
+            />
+          </div>
+          <div v-else>
+            <p class="title">
+              <span style="font-weight: 600">线上基础技能课</span>
+              可排课时:<span style="color: red">{{
+                form.courseConvertSum.courseNum
+              }}</span
+              >课时
+              <span style="color: #333"
+                >已排课时:
+                <span style="color: red"> {{ allNum }}课时</span></span
+              >
+            </p>
+            <courseItem
+              :form="myForm.classs['HIGH_ONLINE']"
+              :teacherList="teacherList"
+              :surplustime="form.courseConvertSum.courseMinute"
+              :surplusCourseNum="form.courseConvertSum.courseNum"
+              :activeType="'HIGH_ONLINE'"
+              :coreid="myForm.coreTeacher"
+              :type="'HIGH_ONLINE'"
+              :prices="prices"
+              :holidays="holidays"
+              @setUserCourse="setUserCourse"
+              :isCourseNumType="true"
+            />
+            <!-- setUserCourse -->
+          </div>
           <!--
           :cooperationList="teacherList" -->
-        </div>
-      </el-form>
+        </el-form>
+      </div>
 
       <div slot="footer" class="dialog-footer">
-        <el-button @click="transClassVisible = false">取 消</el-button>
+        <el-button @click="transPlanVisible = false">取 消</el-button>
         <el-button type="primary" @click="submit">确 定</el-button>
       </div>
     </el-dialog>
@@ -61,6 +94,7 @@ const formatClassGroupTeacherMapperList = (core, ass) => {
   }
   return list;
 };
+import { courseScheduleConvert } from "../../api";
 export default {
   props: ["form", "teacherList", "activeRow"],
   data() {
@@ -72,6 +106,8 @@ export default {
       courseTypeListByName: {},
       courseTypeList: [{ value: "HIGH_ONLINE", label: "线上基础技能课" }],
       alltime: 0,
+      myForm: null,
+      allNum: 0,
     };
   },
   components: {
@@ -111,12 +147,13 @@ export default {
     async openDialog() {
       // 获取列表
       this.init();
-      console.log(
-        this.activeRow,
-        this.form,
-        "初始化",
-        this.activeRow.classs["HIGH_ONLINE"]
-      );
+      // console.log(
+      //   this.activeRow,
+      //   this.form,
+      //   "初始化",
+      //   this.activeRow.classs["HIGH_ONLINE"]
+      // );
+      this.myForm = { ...this.activeRow };
       this.transPlanVisible = true;
     },
     setCourseTypeListByName() {
@@ -129,6 +166,9 @@ export default {
     setUserTime(time, type) {
       this.alltime = time;
     },
+    setUserCourse(courseNum, type) {
+      this.allNum = courseNum;
+    },
     formatTeacher(row) {
       let arr = [];
       if (row.coreTeacher) {
@@ -144,18 +184,53 @@ export default {
       }
       return arr;
     },
-    submit() {
+    async submit() {
+      try {
+        if (!this.isMoreClass) {
+          if (this.alltime > this.form.courseConvertSum.courseMinute) {
+            this.$message.error("课程时长不足");
+            return;
+          }
 
-      if (this.alltime > this.form.courseConvertSum.courseMinute) {
-        this.$message.error("课程时长不足");
+          if (this.alltime != this.form.courseConvertSum.courseMinute) {
+            await this.$alert(
+              `<b>该班级剩余  <span style="color:red">${parseInt(this.form.courseConvertSum.courseMinute-this.alltime)}</span> 分钟时长未排课</b><br />所有班级排课完成且确认后,剩余时长将被清除,不可再次排课`,
+              {
+                confirmButtonText: "确定",
+                dangerouslyUseHTMLString: true,
+              }
+            );
+          }
+        } else {
+          if (this.allNum > this.form.courseConvertSum.courseNum) {
+            this.$message.error("课程课时不足");
+            return;
+          }
+          if (this.allNum != this.form.courseConvertSum.courseNum) {
+        await  this.$alert(
+              `<b>该班级剩余  <span style="color:red">${parseInt(this.form.courseConvertSum.courseNum-this.allNum)}</span> 课时未排课</b><br />所有班级排课完成且确认后,剩余课时将被清除,不可再次排课`,
+              {
+                confirmButtonText: "确定",
+                dangerouslyUseHTMLString: true,
+
+              }
+            );
+          }
+        }
+      } catch (e) {
+        console.log(e);
         return;
       }
-      console.log(this.form)
-      this.$refs.form.validate(async (valid) => {
-        let key = 'HIGH_ONLINE'
+
+      this.$refs.planform.validate(async (valid) => {
+        let key = "HIGH_ONLINE";
         if (valid) {
           const item = this.activeRow.classs[key];
           const data = {
+            confirmGenerate: false,
+            classGroupTeacherMapperList: formatClassGroupTeacherMapperList(
+              this.myForm.coreTeacher
+            ),
             courseTimeDtoList: item.cycle.map((_) => ({
               classGroupTeacherMapperList: this.formatTeacher(_),
               courseType: key,
@@ -167,30 +242,43 @@ export default {
               holiday: _.holiday,
               expectCourseNum: _.expectCourseNum,
             })),
+            ...this.myForm,
+            userIds: this.myForm.studentList.join(","),
+            type: key,
           };
-          console.log(data)
+          try {
+            let arr = [data];
+            const res = await courseScheduleConvert(arr);
+            this.activeRow.submitDate = data;
+            this.activeRow.courseScheduleList = res.data;
+            this.$emit("submitCourse");
+            this.transPlanVisible = false;
+          } catch (e) {
+            console.log(e);
+          }
         } else {
           this.$message.error("请先填写所有表单");
         }
       });
     },
-    workOut (date, classCount, weekArr, id, startTime = '', endTime = '') {
+    workOut(date, classCount, weekArr, id, startTime = "", endTime = "") {
       // 这里是一天排一节课  现在要改成一天排多节
       while (classCount && classCount > 0) {
         for (let i in weekArr) {
           let date1 = new Date(date.getTime());
           let num; // 下次上课上几天后
           // 星期4 - 当前是星期几 =>
-          weekArr[i].weekNum - date.getDay() >= 0 ? num = weekArr[i].weekNum - date.getDay() : num = weekArr[i].weekNum - date.getDay() + 7
+          weekArr[i].weekNum - date.getDay() >= 0
+            ? (num = weekArr[i].weekNum - date.getDay())
+            : (num = weekArr[i].weekNum - date.getDay() + 7);
 
           let dataStr = this.getThinkDate(date, num);
-          let monthDay = this.getThinkDate(date1, num, 2)
-
+          let monthDay = this.getThinkDate(date1, num, 2);
 
           if (this.isholiday) {
             if (this.holidayList.indexOf(monthDay) != -1) {
               // 这里说明有节假日
-              continue
+              continue;
             }
           }
 
@@ -200,34 +288,34 @@ export default {
           let nowEndTime = this.week[i].endTime || endTime;
           //       date: this.getNowFormatDate(date),
           this.tableList.push({
-            'classDate': dataStr,
-            'week': this.weekDay[weekArr[i].weekNum],
-            'type': courseType,
-            'id': id,
-            'name': className,
-            'classTime': nowStartTime + '-' + nowEndTime,
-            'startClassTimeStr': nowStartTime,
-            'endClassTimeStr': nowEndTime,
-            'weekNum': weekArr[i].weekNum,
-          })
+            classDate: dataStr,
+            week: this.weekDay[weekArr[i].weekNum],
+            type: courseType,
+            id: id,
+            name: className,
+            classTime: nowStartTime + "-" + nowEndTime,
+            startClassTimeStr: nowStartTime,
+            endClassTimeStr: nowEndTime,
+            weekNum: weekArr[i].weekNum,
+          });
           // 这里我排声部课
           //               date: this.getNowFormatDate(date),
 
           for (let j in this.activeSingleList) {
             this.classCardList.push({
-              'classDate': dataStr,
-              'classGroupId': this.activeSingleList[j].id,
-              'startClassTimeStr': nowStartTime,
-              'endClassTimeStr': nowEndTime,
-              'type': courseType,
-              'mixid': this.activeSingleList[j].mixid,
-              'weekNum': weekArr[i].weekNum,
-              'name': this.activeSingleList[j].name,
-              'option': 1
-            })
+              classDate: dataStr,
+              classGroupId: this.activeSingleList[j].id,
+              startClassTimeStr: nowStartTime,
+              endClassTimeStr: nowEndTime,
+              type: courseType,
+              mixid: this.activeSingleList[j].mixid,
+              weekNum: weekArr[i].weekNum,
+              name: this.activeSingleList[j].name,
+              option: 1,
+            });
           }
-          classCount--
-          if (classCount == 0) break
+          classCount--;
+          if (classCount == 0) break;
         }
         date.setDate(date.getDate() + 7);
       }
@@ -243,6 +331,9 @@ export default {
     isEmpty() {
       return isEmpty(this.form.classs);
     },
+    isMoreClass() {
+      return this.form.classList.length > 1;
+    },
   },
 };
 </script>

+ 3 - 4
src/views/teamDetail/components/courseTransModals/tranCourseItem.vue

@@ -10,14 +10,14 @@
         label="主教老师"
         prop="actualTeacherName"
       ></el-table-column>
-      <el-table-column
+      <!-- <el-table-column
         label="助教老师"
         prop="teachingTeacherNames"
-      ></el-table-column>
+      ></el-table-column> -->
       <!-- courseTypeListByName[scope.row.type] -->
       <el-table-column label="课程类型" prop="type">
         <span slot-scope="scope">{{
-          scope.row.type
+          scope.row.type | coursesType
         }}</span>
       </el-table-column>
       <el-table-column label="周次" key="week">
@@ -130,7 +130,6 @@ export default {
     // },
   },
   mounted() {
-    console.log(this);
   },
   methods: {
     getTimers(item) {

+ 42 - 14
src/views/teamDetail/components/courseTransModals/tranPlanCourse.vue

@@ -9,7 +9,7 @@
       <div v-if="transPlanVisible">
         <el-collapse v-model="activeNames" class="statisticsCollapse" accordion>
           <el-collapse-item
-            name="1"
+            :name="index"
             v-for="(item, index) in form.classList"
             :key="index"
           >
@@ -39,18 +39,18 @@
             />
           </el-collapse-item>
         </el-collapse>
-        <div v-if="activeRow">
-          <startPlanCourse
-            ref="startPlanCourse"
-            :form="form"
-            :teacherList="teacherList"
-            :activeRow="activeRow"
-          />
-        </div>
+
+        <startPlanCourse
+          ref="startPlanCourse"
+          :form="form"
+          :teacherList="teacherList"
+          :activeRow="activeRow"
+          @submitCourse="submitCourse"
+        />
       </div>
       <div slot="footer" class="dialog-footer">
-        <el-button @click="transClassVisible = false">取 消</el-button>
-        <el-button type="primary" @click="gotoNext">下一步</el-button>
+        <el-button @click="transPlanVisible = false">取 消</el-button>
+        <el-button type="primary" @click="gotoNext">确 定</el-button>
       </div>
     </el-dialog>
   </div>
@@ -58,7 +58,7 @@
 <script>
 import tranCourseItem from "./tranCourseItem";
 import startPlanCourse from "./startPlanCourse";
-
+import { courseScheduleConvert } from "../../api";
 export default {
   props: ["form", "teacherList"],
   components: {
@@ -79,11 +79,35 @@ export default {
       this.transPlanVisible = true;
     },
 
-    gotoNext() {},
+    async gotoNext() {
+      let arr = []
+      let flag = true
+      console.log( this.form)
+      this.form.classList.forEach(item=>{
+        if(item.submitDate){
+          item.submitDate.confirmGenerate = true;
+          arr.push(item.submitDate)
+
+        }else{
+          flag = false
+        }
+
+      })
+      if(!flag){
+        this.$message.error('请给每个班级排课')
+        return
+      }
+      try{
+        const res = await courseScheduleConvert(arr)
+        this.$message.success('转化成功')
+        this.$bus.$emit("closeTrans");
+      }catch(e){
+        console.log(e)
+      }
+    },
     gotoPlan(item) {
       // 判断一下 如果班级数大于1 就进入次数排课
       this.activeRow = item;
-      console.log(item, "item");
       this.$nextTick(() => {
         if (!item.classs) {
           item.classs = {
@@ -101,6 +125,10 @@ export default {
         this.$refs.startPlanCourse.openDialog();
       });
     },
+    submitCourse(){
+      console.log('到这里来了')
+      console.log(this.form)
+    }
   },
 };
 </script>

+ 72 - 10
src/views/teamDetail/components/courseTransModals/transClass.vue

@@ -14,7 +14,7 @@
             若转换后仅创建1个线上基础技能班,转换后班级将根据转换前课程总时长排课
           </p>
           <p class="descript">
-            若转后创建多个线上基础技能班,则转换后班级按转换前课时数排课
+            若转后创建多个线上基础技能班,则转换后班级按转换前课时数排课
           </p>
         </el-alert>
         <el-form :model="form" ref="form">
@@ -165,7 +165,11 @@
           :activeListStudent="activeListStudent"
           activeType="HIGH_ONLINE"
         />
-        <tranPlanCourse ref="tranPlanCourse" :teacherList="teacherList" :form="form" />
+        <tranPlanCourse
+          ref="tranPlanCourse"
+          :teacherList="teacherList"
+          :form="form"
+        />
       </div>
       <div slot="footer" class="dialog-footer">
         <el-button @click="transClassVisible = false">取 消</el-button>
@@ -194,13 +198,17 @@ export default {
         studentNum: 0,
       },
     },
+    courseIds: {
+      type: String,
+      default: "",
+    },
   },
   data() {
     return {
       transClassVisible: false,
       getStudentList: [],
       form: {
-        courseConvertSum:this.courseConvertSum,
+        courseConvertSum: this.courseConvertSum,
         classList: [
           {
             expectStudentNum: 6,
@@ -211,8 +219,9 @@ export default {
             coreTeacher: "",
             type: "HIGH_ONLINE",
             courseScheduleList: [],
-            courseTotalMinuties:'',
-
+            courseTotalMinuties: "",
+            id: new Date().getTime(),
+            courseIds: this.courseIds,
           },
         ],
       },
@@ -240,12 +249,28 @@ export default {
     },
     getList() {},
     gotoNext() {
+      console.log(this.waitStudentList.length,'this.waitStudentList')
+      if(this.waitStudentList.length>0){
+        this.$message.error(`当前有${this.waitStudentList.length}名学员未加入班级`)
+        return
+      }
       this.$refs.form.validate((flag) => {
-        this.$refs.tranPlanCourse.openDialog();
+        if(flag){
+          this.$refs.tranPlanCourse.openDialog();
+        }
+
       });
     },
-    remove(index) {
+   async remove(index) {
+      let flag = this.checkisPlan();
+      if (flag) {
+        let isReset = await this.openMessageBox();
+        if (!isReset) {
+          return;
+        }
+      }
       this.form.classList.splice(index, 1);
+      this.$forceUpdate()
     },
     init() {
       this.teamid = this.$route.query.id;
@@ -265,7 +290,14 @@ export default {
         }
       });
     },
-    addClass() {
+    async addClass() {
+      let flag = this.checkisPlan();
+      if (flag) {
+        let isReset = await this.openMessageBox();
+        if (!isReset) {
+          return;
+        }
+      }
       this.form.classList.push({
         expectStudentNum: 6,
         groupType: "MUSIC",
@@ -275,7 +307,10 @@ export default {
         coreTeacher: "",
         type: "HIGH_ONLINE",
         courseScheduleList: [],
+        id: new Date().getTime(),
+        courseIds: this.courseIds,
       });
+      this.$forceUpdate()
     },
     setStudent(student) {
       this.form.classList[this.activeStudentIndex].studentList = [...student];
@@ -291,7 +326,6 @@ export default {
           this.activeListStudent.push(item);
         }
       });
-      console.log(this.waitStudentList, this.waitStudentList.length);
       this.studentList = this.waitStudentList;
       this.showStudentVisible = true;
 
@@ -300,6 +334,35 @@ export default {
         this.$refs.transStudent.openDialog();
       });
     },
+    checkisPlan() {
+      let flag = false;
+      this.form.classList.forEach((item) => {
+        /**
+         *       this.activeRow.submitDate = data
+            this.activeRow.courseScheduleList = res.data;
+         */
+        if (item&&item.submitDate) {
+          flag = true;
+        }
+      });
+      return flag;
+    },
+    async openMessageBox() {
+      try {
+        await this.$confirm("修改班级数量会重置排课信息", "提示", {
+          type: "warning",
+        });
+        this.form.classList = this.form.classList.map((item) => {
+          item.courseScheduleList = [];
+          item.submitDate = null;
+          item.classs = null;
+          return item
+        });
+        return true;
+      } catch (e) {
+        return false;
+      }
+    },
   },
   computed: {
     chioseCourse() {
@@ -312,7 +375,6 @@ export default {
           chioseIdList.push(stu);
         });
       });
-      console.log(chioseIdList);
       let arr = this.students.filter((item) => {
         console.log(chioseIdList.indexOf(item.userId) != -1);
         return chioseIdList.indexOf(item.userId) == -1;

+ 15 - 4
src/views/teamDetail/components/courseTransModals/transStart.vue

@@ -20,7 +20,7 @@
           label="学员声部"
         ></el-table-column>
       </el-table>
-      <transClass ref='transClass' :students="tableList" :courseConvertSum='courseConvertSum'/>
+      <transClass ref='transClass' :students="tableList" :courseConvertSum='courseConvertSum' :courseIds="courseIds"/>
       </div>
       <div slot="footer" class="dialog-footer">
         <el-button @click="transVisible = false">取 消</el-button>
@@ -60,19 +60,30 @@ export default {
         courseType: "",
         studentNum: 0,
       },
+      courseIds:''
     };
   },
-  mounted() {},
+  mounted() {
+    this.$bus.$on("closeTrans", obj => {
+      this.transVisible = false;
+      this.$emit('getList')
+    });
+  },
+  beforeDestroy(){
+    this.$bus.$off("closeTrans", obj => {
+
+});
+  },
   methods: {
     async openDialog() {
       // 获取列表
       try {
-        let courseIds = this.chioseCourse
+         this.courseIds = this.chioseCourse
           .map((item) => {
             return item.courseScheduleId;
           })
           .join(",");
-        const res = await getCourseScheduleConvert({ courseIds });
+        const res = await getCourseScheduleConvert({ courseIds:this.courseIds });
         this.tableList = res.data.students;
         this.courseConvertSum = { ...res.data.courseConvertSum };
         this.transVisible = true;

+ 47 - 28
src/views/teamDetail/components/modals/classroom-setting-item.vue

@@ -11,7 +11,11 @@
       </el-radio-group>
     </el-form-item> -->
 
-    <el-table v-if="form && form.cycle&&form.cycle.length>0" :data="form.cycle" :show-header="false">
+    <el-table
+      v-if="form && form.cycle && form.cycle.length > 0"
+      :data="form.cycle"
+      :show-header="false"
+    >
       <el-table-column>
         <template slot-scope="scope">
           <div>
@@ -28,7 +32,6 @@
                 clearable
                 filterable
               >
-
                 <el-option
                   v-for="(item, index) in teacherList"
                   :key="index"
@@ -41,7 +44,6 @@
                   }}</span>
                 </el-option>
               </el-select>
-
             </el-form-item>
             <el-form-item
               prop="assistant"
@@ -54,7 +56,6 @@
                 type != 'MUSIC_NETWORK'
               "
             >
-
               <el-select
                 v-model.trim="scope.row.assistant"
                 placeholder="请选择助教老师"
@@ -78,7 +79,9 @@
             </el-form-item>
             <el-form-item
               :prop="'classs.' + type + '.cycle.' + scope.$index + '.time'"
-              :rules="[{ required: true, message: '请选择课程时长' }]"
+              :rules="[
+                { required: true, message: '请选择课程时长', trigger: 'blur' },
+              ]"
               inline-message
             >
               <el-select
@@ -105,7 +108,6 @@
                 >
                 </el-option>
               </el-select>
-
             </el-form-item>
             <el-form-item
               :prop="
@@ -118,7 +120,6 @@
               ]"
               inline-message
             >
-
               <el-input
                 style="width: 180px !important"
                 type="number"
@@ -176,7 +177,6 @@
                   selectableRange: ['04:30:00 - 23:59:59'],
                 }"
               >
-
               </el-time-picker>
             </el-form-item>
             <el-form-item
@@ -268,7 +268,6 @@
     <el-button
       icon="el-icon-circle-plus-outline"
       type="info"
-
       plain
       :disabled="surplustime < (selectPrice || 0 || Math.min(...pricesArray))"
       @click="create"
@@ -284,8 +283,7 @@ import dayjs from "dayjs";
 
 const classTimeListByType = {};
 for (const item of classTimeList) {
-   classTimeListByType[item.value] = item.label;
-
+  classTimeListByType[item.value] = item.label;
 }
 
 export default {
@@ -303,6 +301,8 @@ export default {
     "assistant",
     "endSchoolTerm",
     "startCourseDate",
+    "surplusCourseNum",
+    "isCourseNumType"
   ],
   data() {
     const validatePass = (rule, value, callback) => {
@@ -329,11 +329,11 @@ export default {
       validatePass,
       validateNum,
       pickerOptions: this.getPickerOptions(),
+      useCourseNum: 0,
     };
   },
   mounted() {
-
-    this.updateUseTime()
+    this.updateUseTime();
   },
   computed: {
     weekDateList() {
@@ -359,6 +359,15 @@ export default {
       }
       this.useTime = time;
       this.$emit("setUserTime", time, this.type);
+      this.updateUseNumber();
+    },
+    updateUseNumber() {
+      let courseNum = 0;
+      for (const item of this.form.cycle) {
+        courseNum += (item.expectCourseNum || 0) * 1;
+      }
+      this.useCourseNum = courseNum;
+      this.$emit("setUserCourse", this.useCourseNum, this.type);
     },
     create() {
       if (this.endSchoolTerm) {
@@ -398,21 +407,32 @@ export default {
         this.$set(item.row, "endClassTime", "");
       }
       if (val) {
-        let activeTime = val * Math.max(item.row.expectCourseNum || 0, 0);
-        if (this.endSchoolTerm) {
-          this.$set(
-            item.row,
-            "expectCourseNum",
-            parseInt((this.surplustime + activeTime) / val)
-          );
-        } else {
+        console.log('isCourseNumType',this.isCourseNumType)
+        if (!this.isCourseNumType) {
+          let activeTime = val * Math.max(item.row.expectCourseNum || 0, 0);
+          if (this.endSchoolTerm) {
+            this.$set(
+              item.row,
+              "expectCourseNum",
+              parseInt((this.surplustime + activeTime) / val)
+            );
+          } else {
+            this.$set(
+              item.row,
+              "expectCourseNum",
+              parseInt((this.surplustime - this.useTime + activeTime) / val)
+            );
+          }
+        }else{
+          console.log('课时排课')
+          let num =  parseInt((this.surplusCourseNum -  this.useCourseNum))>0? parseInt((this.surplusCourseNum -  this.useCourseNum)):0
           this.$set(
-            item.row,
-            "expectCourseNum",
-            parseInt((this.surplustime - this.useTime + activeTime) / val)
-          );
-        }
+              item.row,
+              "expectCourseNum",
+              parseInt(num)
+            );
 
+        }
         // this.surplusTime
       } else {
         this.$set(item.row, "expectCourseNum", 0);
@@ -490,7 +510,6 @@ export default {
           }
         }
         const enumd = this.addData(end.format("YYYY-MM-DD"), row.dayOfWeek);
-        console.log(enumd);
         // end = end.add(enumd, 'day')
         this.$set(row, "endDate", end.format("YYYY-MM-DD"));
       } else {
@@ -558,7 +577,7 @@ export default {
 };
 </script>
 <style lang="less" scoped>
-::v-deep  .close-icon {
+::v-deep .close-icon {
   cursor: pointer;
   font-size: 16px;
   margin-bottom: 24px;

+ 2 - 0
src/views/teamDetail/components/modals/classroom-setting.vue

@@ -215,6 +215,7 @@ export default {
     "classCouresTimeList",
     "teacherList",
     "cooperationList",
+    "isCourseNumType"
   ],
   components: {
     courseItem,
@@ -426,6 +427,7 @@ export default {
           for (const key in this.form.classs) {
             if (this.form.classs.hasOwnProperty(key)) {
               const item = this.form.classs[key];
+
               const data = {
                 type: this.detail ? undefined : this.activeType,
                 courseType: key,

+ 2 - 2
vue.config.js

@@ -17,11 +17,11 @@ const name = defaultSettings.title || "管乐迷后台管理系统"; // page tit
 // //  https://online.dayaedu.com
 // let target = 'https://online.dayaedu.com' //线上
 // let target = 'http://192.168.3.251:8000' // 何国威
-// let target = 'http://192.168.3.20:8000' //邹璇
+let target = 'http://192.168.3.20:8000' //邹璇
 // let target = 'http://192.168.3.119:8000' //勇哥
 // let target = 'http://192.168.3.146:8000' //王昭
 // let target = 'http://dev.dayaedu.com' // 开发环境
-let target = "https://test.dayaedu.com"; //测试环境
+// let target = "https://test.dayaedu.com"; //测试环境
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {
   /**