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

generation detail - master - add student table

hare8999@163.com 2 éve
szülő
commit
34741b4890

+ 29 - 4
src/views/elective/generation/detail.vue

@@ -51,7 +51,9 @@
       <elective-generation-flow-log :groups="prevData.groups" :histories="logRow.histories"
                                     :matched-majors="this.majorsMap[logRow['studentId']]"/>
     </el-dialog>
-    <el-dialog title="查看详情" :visible.sync="studentTableVisible" :width="logDialogWidth"></el-dialog>
+    <el-dialog title="查看详情" :visible.sync="studentTableVisible" :width="logDialogWidth">
+      <report-table :generation="studentGeneration" :optional-majors="studentMajors" readonly></report-table>
+    </el-dialog>
   </div>
 </template>
 
@@ -70,9 +72,11 @@ import {
 import ElectiveGenerationFlowLog from '@/views/elective/generation/components/elective-generation-flow-log'
 import ElectiveFlowMajor from '@/views/elective/generation/components/elective-flow-major'
 import ElectiveFlowRankDescriptor from '@/views/elective/generation/components/elective-flow-rank-descriptor'
+import ReportTable from '@/views/system/user/profile/components/report-table'
+import { getPrimaryElectivesModels, getStudentElectiveModels } from '@/api/webApi/elective/selected-subject'
 
 export default {
-  components: { ElectiveFlowRankDescriptor, ElectiveFlowMajor, ElectiveGenerationFlowLog, MxCondition },
+  components: { ReportTable, ElectiveFlowRankDescriptor, ElectiveFlowMajor, ElectiveGenerationFlowLog, MxCondition },
   mixins: [transferMixin, groupTranslateMixin, ElectiveColorMap],
   name: 'generation-detail',
   computed: {
@@ -175,7 +179,9 @@ export default {
       // log
       logVisible: false,
       logRow: {},
-      studentTableVisible: false
+      studentTableVisible: false,
+      studentGeneration: {},
+      studentMajors: []
     }
   },
   methods: {
@@ -250,7 +256,26 @@ export default {
       this.logVisible = true
     },
     handleStudentTable(row) {
-      this.$alert('待填充')
+      this.loading = true
+      const query = {
+        generation: this.activeOpt.value,
+        studentId: row.studentId
+      }
+      const majors = this.majorsMap[query.studentId]?.majors || []
+      getStudentElectiveModels(query).then(res => {
+        this.studentMajors = majors
+        this.studentGeneration = {
+          options: config.electiveGenerationOptions,
+          current: query.generation,
+          currentOpt: this.activeOpt,
+          active: query.generation,
+          activeOpt: this.activeOpt,
+          roundGroups: this.prevData.groups,
+          models: res.data,
+          activeModels: res.data
+        }
+        this.studentTableVisible = true
+      }).finally(() => this.loading = false)
     },
     handleForceAdjust(group, row) {
       let message = `确认将'${row.studentName}'调剂至'${group.groupName}'?!`

+ 1 - 1
src/views/system/user/profile/components/report-table.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <div class="mb10 fx-row fx-end-base">
-      <div>
+      <div v-if="!readonly">
         <el-button v-if="aiButtonShow" type="primary" @click="toAiAnalysis">AI分析</el-button>
         <el-button>选科历史记录</el-button>
       </div>

+ 1 - 1
src/views/system/user/profile/components/round-select-resolvers/backTracking-resolver-mixins.js

@@ -5,7 +5,7 @@ export default {
       const generation = this.generation.activeModels.find(item => item.generation == gen).generation
 
       this.formatRows.forEach(item => {
-        const currentGroup = models.find(group => group.groupId == item.groupId)
+        const currentGroup = models.find(group => group.groupId == item.groupId) || {}
         item.rankInIndicator = currentGroup.rankInIndicator
         item.rankInDisenroll = currentGroup.rankInDisenroll
       })

+ 1 - 1
src/views/system/user/profile/components/round-select-resolvers/backTrackingDM-resolver-mixins.js

@@ -6,7 +6,7 @@ export default {
 
 
       this.formatRows.forEach(item => {
-        const currentGroup = models.find(group => group.groupId == item.groupId)
+        const currentGroup = models.find(group => group.groupId == item.groupId) || {}
         console.log(currentGroup.groupApprovedCount)
         console.log(currentGroup.groupIndicator)
         item.supplyIndicator =  currentGroup.groupIndicator

+ 1 - 1
src/views/system/user/profile/components/round-select-resolvers/finalAdjustDM-resolver-mixins.js

@@ -5,7 +5,7 @@ export default {
       const generation = this.generation.activeModels.find(item => item.generation == gen).generation
 
       this.formatRows.forEach(item => {
-        const currentGroup = models.find(group => group.groupId == item.groupId)
+        const currentGroup = models.find(group => group.groupId == item.groupId) || {}
 
         item.towSupplyIndicator = currentGroup.groupIndicator
         if(currentGroup.groupIndicator >= 0) {

+ 1 - 1
src/views/system/user/profile/components/round-select-resolvers/forceAdjust-resolver-mixins.js

@@ -6,7 +6,7 @@ export default {
 
 
       this.formatRows.forEach(item => {
-        const currentGroup = models.find(group => group.groupId == item.groupId)
+        const currentGroup = models.find(group => group.groupId == item.groupId) || {}
 
         item.adjustIndicator = currentGroup.groupIndicator
         if(currentGroup.groupIndicator >= 0) {

+ 2 - 2
src/views/system/user/profile/components/round-select-resolvers/primary-resolver-mixins.js

@@ -1,13 +1,13 @@
 export default {
   methods: {
-    primaryResolver(gen,active) {
+    primaryResolver(gen, active) {
       const models = this.generation.activeModels.find(item => item.generation == gen).models
       const generation = this.generation.activeModels.find(item => item.generation == gen).generation
 
       this.formatRows.forEach(item => {
         // item.applyCount = `${item.actualCount}/${item.personCount}`
         // item.rankInGroup = item.rankInGroup
-        const currentGroup = models.find(group => group.groupId == item.groupId)
+        const currentGroup = models.find(group => group.groupId == item.groupId) || {}
 
         item.applyCount = `${currentGroup.actualCount} /${currentGroup.personCount}`
         item.rankInGroup = currentGroup.rankInGroup

+ 1 - 1
src/views/system/user/profile/components/round-select-resolvers/primaryDM-resolver-mixins.js

@@ -8,7 +8,7 @@ export default {
       this.formatRows.forEach(item => {
         // item.applyCount = `${item.actualCount}/${item.personCount}`
         // item.rankInGroup = item.rankInGroup
-        const currentGroup = models.find(group => group.groupId == item.groupId)
+        const currentGroup = models.find(group => group.groupId == item.groupId) || {}
         item.prmarySituation = currentGroup.groupIndicator
         // 录取人数加指标/ 设置人数
         if(currentGroup.groupIndicator >= 0) {