Browse Source

分班--班主任--学生

shilipojs 2 years ago
parent
commit
e326e280a1

+ 2 - 1
src/views/elective/dispatch/master/components/choose-master-teacher.vue

@@ -52,7 +52,8 @@ export default {
       //   return
       // }
       if (!this.selectedCode) {
-        this.dialogVisible = false
+        // this.dialogVisible = false
+        this.$message.warning(`未选择老师`)
         return
       }
       this.saveTeacherSettings()

+ 6 - 3
src/views/elective/dispatch/master/index.vue

@@ -31,7 +31,7 @@
         </mx-table>
       </div>
     </el-card>
-    <evaluation-empty v-else-if="!queryParams.roundId" shadow title="当前学年没有班主任班数据"></evaluation-empty>
+    <evaluation-empty v-else-if="!queryParams.roundId" shadow title="当前学年没有班主任班数据"></evaluation-empty>
     <choose-master-teacher ref="chooseMasterTeacher" :roundId="queryParams.roundId"
                            :headTeacherSettings="headteacherSettings" @completed="handleQuery"></choose-master-teacher>
     <choose-class :roundId="queryParams.roundId" ref="chooseClass" :year="queryParams.year"
@@ -169,11 +169,14 @@ export default {
       const headteacherSettings = Object.values(this.headteacherSettings).map(item => {
         return item.customerCode
       })
-      if (headteacherSettings.length < this.classList.length) {
+      const roundGroupsLength= this.round.roundGroups.reduce((cur,pre) => {
+        return cur += pre.classCount
+      },0)
+      console.log(roundGroupsLength)
+      if (headteacherSettings.length < roundGroupsLength.length) {
         this.$message.warning('还有班级未分配新班主任和新班级号')
         return
       }
-      console.log(headteacherSettings)
       // 验证重复
       if((new Set(headteacherSettings)).size != headteacherSettings.length) {
         this.$message.warning('有重复的班主任,请先校验好再发布')

+ 13 - 4
src/views/elective/dispatch/master/info/self.vue

@@ -34,26 +34,35 @@ export default {
         roundId: ''
       },
       propDefines: {
-        name: {
+        year: {
           label: '学年'
         },
         oldClass: {
           label: '原班级'
         },
-        group: {
+        oldTeacher: {
           label: ' 原班主任姓名'
         },
         newClass: {
           label: '新班级'
         },
-        tips: {
+        newTeacher: {
           label: ' 新班主任姓名'
         },
         time: {
           label: '是否更换'
         },
       },
-      rows: []
+      rows: [
+        {
+          year: 2021,
+          oldClass: 20001,
+          oldTeacher: '张老师',
+          newClass: 20002,
+          newTeacher: '周老师',
+          time: '是'
+        }
+      ]
     }
   },
   methods: {

+ 19 - 2
src/views/elective/dispatch/master/info/student.vue

@@ -47,7 +47,7 @@ export default {
         group: {
           label: '录取组合'
         },
-        tips: {
+        newTeacher: {
           label: '新班报班主任'
         },
         time: {
@@ -58,7 +58,24 @@ export default {
           slot: 'tmp'
         }
       },
-      rows: []
+      rows: [
+        {
+          name: '周同学',
+          oldClass: 20001,
+          newClass: 20001,
+          group: '物化生',
+          newTeacher: '张老师',
+          time: '2022-6-18',
+        },
+        {
+          name: '张同学',
+          oldClass: 20002,
+          newClass: 20003,
+          group: '物化生',
+          newTeacher: '刘老师',
+          time: '2022-6-18',
+        }
+      ]
     }
   },
   methods: {

+ 2 - 3
src/views/elective/dispatch/student/components/choose-class.vue

@@ -72,7 +72,6 @@ export default {
       if (!this.year) return []
       // 获取该年份下的年级
       const classTree = this.classTree[this.classTree.findIndex(i => i.year = this.year)]
-      console.log(classTree.gradeId)
       this.form.gradeId = classTree.grade
       this.form.year = classTree.year
       return this.classTree[this.classTree.findIndex(i => i.year = this.year)].classList.map(item => {
@@ -146,8 +145,8 @@ export default {
       });
       console.log(this.form)
     },
-    refreshClassTree() {
-      this.$store.dispatch('GetInfo') // 借机清除了用户缓存 // clear cache
+    async refreshClassTree() {
+      await this.$store.dispatch('GetInfo') // 借机清除了用户缓存 // clear cache
       this.loadTranslateClassTree()
     }
   }

+ 1 - 0
src/views/elective/dispatch/student/index.vue

@@ -77,6 +77,7 @@ export default {
       this.$Dialog('DispatchStudent',{
         settings: this.publishSettings
       },(val) => {
+        this.$message.success('发布成功')
         this.handleQuery()
       })
     },