浏览代码

Merge branch 'master' of http://121.4.203.192:9000/mingxue/front

hare8999@163.com 2 年之前
父节点
当前提交
3861bb34c0

+ 2 - 1
src/views/elective/dispatch/master/index.vue

@@ -76,7 +76,7 @@ export default {
   },
   computed: {
     propDefines() {
-      if(!this.round) return {}
+      if(!Object.keys(this.round).length) return {}
       return  {
         year: {
           label: '学年'
@@ -125,6 +125,7 @@ export default {
     }
   },
   methods: {
+
     getPublish() {
       getPublish({
         roundId: this.queryParams.roundId

+ 45 - 10
src/views/elective/dispatch/master/info/self.vue

@@ -6,12 +6,14 @@
       ></mx-condition>
     </el-card>
     <!--   班主任查看  -->
-    <el-card class="box-card">
+    <el-card class="box-card" v-if="queryParams.roundId">
       <div slot="header" class="clearfix">
-        <p class="f20 text-center">凤凰中学2021级2101班分班信息 张兰老师</p>
+        <p class="f20 text-center">{{ title }}</p>
       </div>
       <div>
-        <p class="mb10 f14">备注:<span class="f-red">请通知学生按照学校规定到新班级报道</span></p>
+        <p class="mb10 f14">备注:<span class="f-red">请通知学生按照学校规定到新班级报道</span>
+        <span> ,在{{round.activeDate}} 生效</span>
+        </p>
         <mx-table :prop-defines="propDefines" :rows="rows">
           <template #tmp="{row}">
             <el-button type="primary">通知</el-button>
@@ -19,10 +21,12 @@
         </mx-table>
       </div>
     </el-card>
+    <evaluation-empty v-else-if="!queryParams.roundId" shadow title="当前学年没有分班数据"></evaluation-empty>
   </div>
 </template>
 <script>
 import MxCondition from '@/components/MxCondition/mx-condition'
+import { classesResult, getRound, getTeacherSettings } from '@/api/webApi/elective/dispatch'
 
 export default {
   components: { MxCondition },
@@ -53,20 +57,51 @@ export default {
           label: '是否更换'
         },
       },
-      rows: [
+      settings: {},
+      round: {}
+    }
+  },
+  computed: {
+    title() {
+      if(!Object.keys(this.round).length) return ''
+      return `${this.$store.getters.school.schoolName}${this.queryParams.year}学年${this.round.name}分班信息`
+    },
+    rows(){
+      const key = Object.keys(this.settings)[0]
+      if(!key) return []
+      return [
         {
-          year: 2021,
-          oldClass: 20001,
-          oldTeacher: '张老师',
-          newClass: 20002,
-          newTeacher: '周老师',
-          time: '是'
+          year: this.queryParams.year,
+          oldClass: '',
+          oldTeacher: '',
+          newClass: key,
+          newTeacher: this.settings[key].nickName,
+          time: ''
         }
       ]
     }
   },
   methods: {
     handleQuery() {
+      this.getRound()
+      this.getTeacherSettings()
+    },
+    getRound() {
+      getRound({
+        year: this.queryParams.year,
+        round:this.queryParams.roundId,
+      }).then(res => {
+        this.round = res.data
+        console.log(res)
+      })
+    },
+    getTeacherSettings() {
+      getTeacherSettings({
+        roundId: this.queryParams.roundId
+      }).then(res => {
+        // 新班级的settings
+        this.settings = res.data
+      })
     },
     handleInvalidQuery() {
       console.log('query取消')

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

@@ -6,10 +6,9 @@
       ></mx-condition>
     </el-card>
     <!--   班主任查看  -->
-    <el-card class="box-card">
+    <el-card class="box-card"  v-if="queryParams.roundId">
       <div slot="header" class="clearfix">
-        <span class="f20">凤凰中学2021级2101班分班信息</span>
-        <el-button style="float: right; padding: 3px 0" type="text">打印</el-button>
+        <p class="f20 text-center">{{ title }}  <el-button style="float: right; padding: 3px 0" type="text">打印</el-button></p>
       </div>
       <div>
         <p class="mb10 f14">备注:<span class="f-red">请通知学生按照学校规定到新班级报道</span></p>
@@ -20,10 +19,12 @@
         </mx-table>
       </div>
     </el-card>
+    <evaluation-empty v-else-if="!queryParams.roundId" shadow title="当前学年没有分班数据"></evaluation-empty>
   </div>
 </template>
 <script>
 import MxCondition from '@/components/MxCondition/mx-condition'
+import { classesResult, getPublish, getRound } from '@/api/webApi/elective/dispatch'
 
 export default {
   components: { MxCondition },
@@ -38,17 +39,17 @@ export default {
         name: {
           label: '姓名'
         },
-        oldClass: {
+        originalClassName: {
           label: '原班级'
         },
-        newClass: {
+        className: {
           label: '新班级'
         },
         group: {
           label: '录取组合'
         },
         newTeacher: {
-          label: '新班报班主任'
+          label: '新班主任'
         },
         time: {
           label: '分班信息生效时间'
@@ -58,28 +59,38 @@ export default {
           slot: 'tmp'
         }
       },
-      rows: [
-        {
-          name: '周同学',
-          oldClass: 20001,
-          newClass: 20001,
-          group: '物化生',
-          newTeacher: '张老师',
-          time: '2022-6-18',
-        },
-        {
-          name: '张同学',
-          oldClass: 20002,
-          newClass: 20001,
-          group: '物化生',
-          newTeacher: '张老师',
-          time: '2022-6-18',
-        }
-      ]
+      rows: [],
+      settings: {},
+      round:{}
+    }
+  },
+  computed: {
+    title() {
+      if(!Object.keys(this.round).length) return ''
+      return `${this.$store.getters.school.schoolName}${this.queryParams.year}学年${this.round.name}分班信息`
     }
   },
   methods: {
     handleQuery() {
+      this.getRound()
+      this.getClassesResult()
+    },
+    getClassesResult() {
+      classesResult({
+        roundId:this.queryParams.roundId
+      }).then(res => {
+        console.log(res)
+        this.rows = res.rows
+      })
+    },
+    getRound() {
+      getRound({
+        year: this.queryParams.year,
+        round:this.queryParams.roundId,
+      }).then(res => {
+        this.round = res.data
+        console.log(res)
+      })
     },
     handleInvalidQuery() {
       console.log('query取消')