Forráskód Böngészése

班主任分班---校长

shilipojs 2 éve
szülő
commit
232e4af2ef

+ 32 - 11
src/views/elective/dispatch/master/index.vue

@@ -108,17 +108,38 @@ export default {
     formatRows() {
       if (!this.classTree.length) return []
       if (!this.headteacherSettings) return []
-      return this.classTree.find(item => item.year == this.queryParams.year)
-        ?.classList.map(item => {
-          const copy = { ...item }
-          const setting = this.headteacherSettings[copy.classId]
-          copy.year = this.queryParams.year
-          copy.newClassId = setting ? copy.classId : ''    // 新班级Id
-          copy.newClassName = setting ? copy.className : ''    // 新班级名称
-          copy.newHeadteacherName = setting ? setting.nickName : ''    // 新班主任名称
-          copy.newHeadteacherCode = setting ? setting.customerCode : ''    // 新班主任code
-          return copy
-        }) || []
+
+      if(this.round.dispatchCompleted) {
+        const values = Object.keys(this.headteacherSettings)
+        const arr = []
+        for (const key in this.headteacherSettings) {
+          const value = this.headteacherSettings[key]
+          arr.push({
+            year: this.queryParams.year,
+            classId:value.oldClassId,
+            className: this.getClassName(value.oldClassId),
+            newHeadteacherCode: value.customerCode,
+            newHeadteacherName: value.nickName,
+            headteacherCode: value.oldCustomerCode,
+            headteacherName: value.oldNickName,
+            newClassId: key,
+            newClassName: this.getClassName(key)
+          })
+        }
+        return arr
+      }else  {
+        return this.classTree.find(item => item.year == this.queryParams.year)
+          ?.classList.map(item => {
+            const copy = { ...item }
+            const setting = this.headteacherSettings[copy.classId]
+            copy.year = this.queryParams.year
+            copy.newClassId = setting ? copy.classId : ''    // 新班级Id
+            copy.newClassName = setting ? copy.className : ''    // 新班级名称
+            copy.newHeadteacherName = setting ? setting.nickName : ''    // 新班主任名称
+            copy.newHeadteacherCode = setting ? setting.customerCode : ''    // 新班主任code
+            return copy
+          }) || []
+      }
     },
     classList() {
       return this.classTree.find(item => item.year == this.queryParams.year).classList

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

@@ -1,5 +1,5 @@
 <template>
-  <div class="app-container">
+  <div class="app-container" v-loading="loading">
     <el-card class="box-card mb10">
       <mx-condition ref="condition" :query-params="queryParams" :require-fields="requireFields" @query="handleQuery"
                     @invalid="handleInvalidQuery"
@@ -26,10 +26,12 @@
 </template>
 <script>
 import MxCondition from '@/components/MxCondition/mx-condition'
-import { classesResult, getRound, getTeacherSettings } from '@/api/webApi/elective/dispatch'
+import {  getRound, getTeacherSettings } from '@/api/webApi/elective/dispatch'
+import classTreeMixin from '@/components/Cache/modules/mx-classTree-translate-mixin'
 
 export default {
   components: { MxCondition },
+  mixins: [classTreeMixin],
   data() {
     return {
       requireFields: ['year', 'roundId'],
@@ -53,12 +55,13 @@ export default {
         newTeacher: {
           label: ' 新班主任姓名'
         },
-        time: {
+        isToggle: {
           label: '是否更换'
         },
       },
       settings: {},
-      round: {}
+      round: {},
+      loading: false
     }
   },
   computed: {
@@ -72,11 +75,11 @@ export default {
       return [
         {
           year: this.queryParams.year,
-          oldClass: '',
-          oldTeacher: '',
-          newClass: key,
+          oldClass: this.getClassName(this.settings[key].oldClassId),
+          oldTeacher: this.settings[key].oldNickName,
+          newClass: this.getClassName(key),
           newTeacher: this.settings[key].nickName,
-          time: '否'
+          isToggle: this.settings[key].oldNickName == this.settings[key].nickName ? '否' : '是'
         }
       ]
     }
@@ -87,11 +90,13 @@ export default {
       this.getTeacherSettings()
     },
     getRound() {
+      this.loading = true
       getRound({
         year: this.queryParams.year,
         round:this.queryParams.roundId,
       }).then(res => {
         this.round = res.data
+        this.loading  = false
         console.log(res)
       })
     },

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

@@ -8,7 +8,7 @@
     <!--   班主任查看  -->
     <el-card class="box-card"  v-if="queryParams.roundId">
       <div slot="header" class="clearfix">
-        <p class="f20 text-center">{{ title }}  <el-button style="float: right; padding: 3px 0" type="text">打印</el-button></p>
+        <p class="f20 text-center">{{ title }}  <el-button style="float: right;" type="primary">打印</el-button></p>
       </div>
       <div>
         <p class="mb10 f14">备注:<span class="f-red">请通知学生按照学校规定到新班级报道</span></p>
@@ -24,7 +24,7 @@
 </template>
 <script>
 import MxCondition from '@/components/MxCondition/mx-condition'
-import { classesResult, getPublish, getRound } from '@/api/webApi/elective/dispatch'
+import { classesResult, getRound } from '@/api/webApi/elective/dispatch'
 
 export default {
   components: { MxCondition },