mo 2 gadi atpakaļ
vecāks
revīzija
11864b4e9e

+ 149 - 0
src/views/teamDetail/components/courseTransModals/tranCourseItem.vue

@@ -0,0 +1,149 @@
+<template>
+  <div>
+    <el-table
+      :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+      :data="details"
+      max-height="300px"
+      style="width:100%!important;"
+    >
+      <el-table-column
+        label="主教老师"
+        prop="actualTeacherName"
+      ></el-table-column>
+      <el-table-column
+        label="助教老师"
+        prop="teachingTeacherNames"
+      ></el-table-column>
+      <!--       <!-- courseTypeListByName[scope.row.type] --> -->
+      <el-table-column label="课程类型" prop="type">
+        <span slot-scope="scope">{{
+          scope.row.type
+        }}</span>
+      </el-table-column>
+      <el-table-column label="周次" key="week">
+        <span slot-scope="scope">{{
+          weeks[$helpers.dayjs(scope.row.startClassTime).day()]
+        }}</span>
+      </el-table-column>
+      <el-table-column label="开始时间" prop="startClassTime">
+        <template slot-scope="scope">
+          <div>
+            {{ scope.row.startClassTime | dateForMinFormat }}
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column label="课程时长(分钟)" key="time">
+        <span slot-scope="scope">{{ getTimers(scope.row) }}</span>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+import { diffTimerFormMinute } from "@/utils/date";
+import dayjs from "dayjs";
+export default {
+  props: {
+    types: {
+      type: Object,
+      default: {},
+    },
+    details: {
+      type: Array,
+      default: [],
+    },
+    courseTypeListByName: {
+      type: Object,
+      default: {},
+    },
+    teacherList: {
+      type: Array,
+      default: [],
+    },
+    cooperationList: {
+      type: Array,
+      default: [],
+    },
+    coreTeacher: {
+      type: String,
+    },
+    assistant: {
+      type: Array,
+      default: [],
+    },
+  },
+  data() {
+    return {
+      weeks: {
+        0: "星期天",
+        1: "星期一",
+        2: "星期二",
+        3: "星期三",
+        4: "星期四",
+        5: "星期五",
+        6: "星期六",
+      },
+    };
+  },
+  computed: {
+    // coreTeacherName() {
+    //   let name = "";
+    //   for (const item of this.teacherList) {
+    //     if (this.coreTeacher == item.id) {
+    //       name = item.realName;
+    //       break;
+    //     }
+    //   }
+    //   return name;
+    // },
+    // assistantName() {
+    //   let names = [];
+    //   for (const item of this.cooperationList) {
+    //     if (this.assistant.includes(item.id)) {
+    //       names.push(item.realName);
+    //     }
+    //   }
+    //   return names.join(" ");
+    // },
+    typelist() {
+      const list = [];
+      for (const key in this.types) {
+        // if (Object.hasOwnProperty.call(this.types, key)) {
+        //   const item = this.types[key];
+        //   let surplusTime = 0;
+        //   let surplus = 0;
+        //   for (const ke of item.cycle) {
+        //     surplus += parseFloat(ke.expectCourseNum);
+        //     surplusTime += parseFloat(ke.expectCourseNum) * parseFloat(ke.time);
+        //   }
+        //   surplusTime = item.courseTotalMinuties - surplusTime;
+        //   list.push({
+        //     name: this.courseTypeListByName[key],
+        //     cycles: item.cycle.length,
+        //     courseTotalMinuties: item.courseTotalMinuties,
+        //     surplus,
+        //     surplusTime,
+        //   });
+        // }
+      }
+      return list;
+    },
+  },
+  mounted() {
+    console.log(this);
+  },
+  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>
+
+<style lang="less" scoped>
+</style>

+ 0 - 0
src/views/teamDetail/components/courseTransModals/tranCourseList.vue


+ 115 - 0
src/views/teamDetail/components/courseTransModals/tranPlanCourse.vue

@@ -0,0 +1,115 @@
+<template>
+  <div>
+    <el-dialog
+      title="班级排课"
+      append-to-body
+      width="800px"
+      :visible.sync="transPlanVisible"
+    >
+      <div v-if="transPlanVisible">
+        <el-collapse v-model="activeNames" class="statisticsCollapse" accordion>
+          <el-collapse-item
+            name="1"
+            v-for="(item, index) in form.classList"
+            :key="index"
+          >
+            <template slot="title">
+              <div class="titleWrap">
+                <div class="titleWrapText">
+                  <p>{{ item.name }}</p>
+                  <p class="secend">
+                    已拍课<span style="color: red">{{
+                      item.courseScheduleList.length
+                    }}</span
+                    >节
+                  </p>
+                </div>
+
+                 <el-button class="gotoPlan" type="text" @click.stop="gotoPlan(item)">排课</el-button>
+              </div>
+            </template>
+            <tranCourseItem
+              :details="item.courseScheduleList"
+              class="tranCourseItem"
+            />
+          </el-collapse-item>
+        </el-collapse>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="transClassVisible = false">取 消</el-button>
+        <el-button type="primary" @click="gotoNext">下一步</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import tranCourseItem from "./tranCourseItem";
+export default {
+  props: ["form"],
+  components: {
+    tranCourseItem,
+  },
+  data() {
+    return {
+      transPlanVisible: false,
+      activeNames: [],
+    };
+  },
+  mounted() {},
+  methods: {
+    async openDialog() {
+      // 获取列表
+      this.transPlanVisible = true;
+    },
+    gotoNext() {},
+    gotoPlan(){
+      // 判断一下 如果班级数大于1 就进入次数排课
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.statisticsCollapse {
+  margin-bottom: 20px;
+}
+::v-deep .el-collapse-item__header {
+  background: rgb(237, 238, 240);
+  border-bottom: none !important;
+}
+
+// ::v-deep .el-collapse {
+//   border-top:none!important;
+//   border-bottom:none!important
+// }
+
+// ::v-deep .el-collapse-item__arrow {
+//   display: none!important;
+// }
+.titleWrap{
+  padding-left: 20px;
+  font-weight: bold;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  width: 100%;
+  .titleWrapText {
+    padding-right: 20px;
+    font-weight: bold;
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    width: 100%;
+    .secend {
+      margin-left: 20px;
+      font-weight: 400;
+    }
+  }
+  .gotoPlan {
+    margin-right: 20px;
+  }
+}
+
+.tranCourseItem {
+  margin-top: 10px;
+}
+</style>

+ 8 - 1
src/views/teamDetail/components/courseTransModals/transClass.vue

@@ -165,6 +165,7 @@
           :activeListStudent="activeListStudent"
           activeType="HIGH_ONLINE"
         />
+        <tranPlanCourse ref='tranPlanCourse' :form="form"/>
       </div>
       <div slot="footer" class="dialog-footer">
         <el-button @click="transClassVisible = false">取 消</el-button>
@@ -177,6 +178,7 @@
 import { getCourseScheduleConvert } from "../../api";
 import { findSound, getTeacher } from "@/api/buildTeam";
 import transStudent from "./transStudent";
+import tranPlanCourse from './tranPlanCourse.vue'
 export default {
   props: {
     students: {
@@ -198,6 +200,7 @@ export default {
             studentList: [],
             coreTeacher: "",
             type: "HIGH_ONLINE",
+            courseScheduleList:[]
           },
         ],
       },
@@ -213,6 +216,7 @@ export default {
   },
   components: {
     transStudent,
+    tranPlanCourse
   },
   mounted() {
     this.init();
@@ -224,7 +228,9 @@ export default {
     },
     getList() {},
     gotoNext() {
-      this.$refs.form.validate((flag) => {});
+      this.$refs.form.validate((flag) => {
+        this.$refs.tranPlanCourse.openDialog()
+      });
     },
     remove(index) {
       this.form.classList.splice(index, 1);
@@ -256,6 +262,7 @@ export default {
         studentList: [],
         coreTeacher: "",
         type: "HIGH_ONLINE",
+        courseScheduleList:[]
       });
     },
     setStudent(student) {

+ 1 - 1
src/views/teamDetail/components/courseTransModals/transStart.vue

@@ -3,7 +3,7 @@
     <el-dialog title="课程转化" width="800px" :visible.sync="transVisible">
       <div v-if="transVisible">
         <p class="subtitle">已选择<span> {{courseConvertSum.courseNum}} </span>节<span>{{courseConvertSum.courseType | coursesType}} </span>进行转换,共 <span>{{courseConvertSum.studentNum}}</span>名学员</p>
-        <el-table :data="tableList"    :header-cell-style="{ background: '#EDEEF0', color: '#444' }">
+        <el-table :data="tableList"     max-height="400px"   :header-cell-style="{ background: '#EDEEF0', color: '#444' }">
         <el-table-column
           align="center"
           property="name"

+ 1 - 1
src/views/teamDetail/components/modals/classroom-setting-item-merge.vue

@@ -135,7 +135,7 @@
         <template slot-scope="scope">
           <i @click="remove(scope.$index)" v-if="form.cycle.length > 1" class="close-icon el-icon-circle-close"></i>
         </template>
-      </el-table-column>
+      </el-table-column> 
     </el-table>
     <el-button
       icon="el-icon-circle-plus-outline"