Procházet zdrojové kódy

Merge branch '04/02-resetClass' into test

mo před 4 roky
rodič
revize
6d41d00217

+ 7 - 3
src/views/teamDetail/components/modals/classroom-setting-item.vue

@@ -40,10 +40,8 @@
             <el-form-item
               prop="assistant"
               v-if="
-                activeType != 'HIGH' &&
                 activeType != 'HIGH_ONLINE' &&
                 activeType != 'MUSIC_NETWORK' &&
-                type != 'HIGH' &&
                 type != 'HIGH_ONLINE' &&
                 type != 'MUSIC_NETWORK'
               "
@@ -283,6 +281,8 @@ export default {
     "teacherList",
     "activeType",
     "cooperationList",
+    "coreid",
+    "assistant",
   ],
   data() {
     return {
@@ -332,10 +332,14 @@ export default {
         this.$message.error("已排课时长使用完毕,请修改预计课时数");
         return;
       }
-      const initVal = {};
+      const initVal = {
+        coreTeacher: this.coreid,
+        assistant: this.assistant,
+      };
       if (this.selectPrice) {
         initVal.time = this.selectPrice;
       }
+      console.log(initVal)
       this.form.cycle.push(initVal);
       this.updateUseTime();
     },

+ 12 - 8
src/views/teamDetail/components/modals/classroom-setting.vue

@@ -101,6 +101,8 @@
           </template>
           <courseItem
             :surplustime="surplustime[key]"
+            :coreid="coreid"
+            :assistant="assistant"
             @setUserTime="setUserTime"
             :teacherList="teacherList"
             :activeType="activeType"
@@ -225,6 +227,8 @@ export default {
       previewVisible: false,
       previewList: [],
       holidays: [],
+      coreid: "",
+      assistant: [],
     };
   },
   watch: {
@@ -288,20 +292,20 @@ export default {
       this.courseTypeListByName = courseTypeListByName;
     },
     async formatClasss() {
-      let coreid = "";
-      const assistant = [];
+      this.coreid = "";
+      this.assistant = [];
       if (this.detail) {
         const { classGroupTeacherMapperList } = this.detail;
         for (const item of classGroupTeacherMapperList || []) {
           if (item.teacherRole === "BISHOP") {
-            coreid = String(item.userId);
+            this.coreid = String(item.userId);
           }
           if (item.teacherRole === "TEACHING") {
-            assistant.push(item.userId);
+            this.assistant.push(item.userId);
           }
         }
-        this.$set(this.form, "coreTeacher", String(coreid));
-        this.$set(this.form, "assistant", assistant);
+        this.$set(this.form, "coreTeacher", String(this.coreid));
+        this.$set(this.form, "assistant", this.assistant);
       }
       const studentIds = this.detail
         ? undefined
@@ -341,8 +345,8 @@ export default {
             cycle: [
               {
                 time: this.selectPrices ? this.selectPrices[key] : undefined,
-                coreTeacher: coreid,
-                assistant: assistant,
+                coreTeacher: this.coreid,
+                assistant: this.assistant,
               },
             ],
           };