Browse Source

elective student - release list table is ok.

hare8999@163.com 2 years ago
parent
commit
4087169373

+ 10 - 0
src/api/webApi/elective/generation.js

@@ -123,3 +123,13 @@ export function searchElectiveGenerationDetails(params) {
     params
   })
 }
+
+// 班级放榜查询
+// 重用getElectiveGenerationDetails, query=active=传入generation
+export function getClassGenerationDetails(params) {
+  return request({
+    url: '/front/elective/generation/getClassGenerationDetails',
+    method: 'get',
+    params
+  })
+}

+ 0 - 9
src/api/webApi/elective/selected-subject.js

@@ -73,15 +73,6 @@ export function rejectRecommend(data) {
   })
 }
 
-// 班级放榜查询
-export function getClassGenerationDetails(params) {
-  return request({
-    url: '/front/elective/enroll/getClassGenerationDetails',
-    method: 'get',
-    params
-  })
-}
-
 
 
 

+ 4 - 0
src/common/mx-config.js

@@ -105,6 +105,7 @@ export default {
       decisionMaking: true,
       stepsVisible: true,
       title: '初录结果',
+      enrollName: '初录录取',
       description: '',
       icon: ''
     },
@@ -125,6 +126,7 @@ export default {
       decisionMaking: true,
       stepsVisible: true,
       title: '补录结果',
+      enrollName: '补录录取',
       description: '',
       icon: ''
     },
@@ -145,6 +147,7 @@ export default {
       decisionMaking: true,
       stepsVisible: true,
       title: '二次补录结果',
+      enrollName: '二次补录录取',
       description: '',
       icon: ''
     },
@@ -155,6 +158,7 @@ export default {
       decisionMaking: true,
       stepsVisible: true,
       title: '调剂结果',
+      enrollName: '调剂录取',
       description: '',
       icon: ''
     },

+ 51 - 7
src/views/elective/select/release-list.vue

@@ -1,11 +1,14 @@
 <template>
   <div class="app-container" v-loading="loading">
     <el-card>
-      <mx-condition :query-params="queryParams" :require-fields="requireFields" @query="handleQuery"
+      <mx-condition ref="condition" :query-params="queryParams" :require-fields="requireFields" @query="handleQuery"
                     @invalid="handleInvalid" label-width="80px"></mx-condition>
     </el-card>
     <evaluation-empty v-if="emptyTitle" :title="emptyTitle" class="mt20"></evaluation-empty>
-    <dynamic-table v-else class="mt20"></dynamic-table>
+    <template v-else>
+      <el-button circle class="el-icon-refresh mt20 mb10" @click="handleQuery"></el-button>
+      <dynamic-table :columns="tableData.columns" :rows="tableData.rows"></dynamic-table>
+    </template>
   </div>
 </template>
 
@@ -15,6 +18,7 @@ import { getStudentSelected } from '@/api/webApi/elective/selected-subject'
 import config from '@/common/mx-config'
 import { mapGetters } from 'vuex'
 import DynamicTable from '@/components/dynamic-table/index'
+import { getClassGenerationDetails } from '@/api/webApi/elective/generation'
 
 export default {
   name: 'ElectiveReleaseList',
@@ -50,21 +54,61 @@ export default {
     releaseOpt() {
       return Object.values(config.electiveGenerationOptions).find(opt => opt.value == this.queryParams.releaseGeneration)
     },
+    queryCodeOpt() {
+      return config.studentReleaseQueryCodes.find(opt => opt.id == this.queryParams.releaseQueryCode)
+    },
     emptyTitle() {
       if (!this.electiveStatus) return '暂无数据'
       if (this.electiveStatus.currentGeneration <= config.electiveGenerationOptions.init.value) return '选科未开启'
       if (this.queryParams.releaseGeneration > this.electiveStatus.currentGeneration) return '选科还未进行至' + this.releaseOpt.title
       return ''
+    },
+    roundName() {
+      return this.$refs.condition.getConditionLabel('studentRoundId', this.queryParams.studentRoundId)
+    },
+    tableData() {
+      const rows = this.releaseSummary?.details || []
+      const columns = [
+        { prop: 'localRoundName', label: '选科次数' },
+        { prop: 'className', label: '班级' },
+        { prop: 'studentName', label: '姓名' },
+        { prop: 'localApplyGroupNames', label: '报名组合', hidden: this.queryCodeOpt.isEnroll },
+        { prop: 'rankInAppliedGroup', label: '报名排名', hidden: this.queryCodeOpt.isEnroll },
+        { prop: 'enrollGroupName', label: '录取组合', hidden: !this.queryCodeOpt.isEnroll },
+        { prop: 'rankInEnrolledGroup', label: '录取排名', hidden: !this.queryCodeOpt.isEnroll },
+        { prop: 'localEnrollGeneration', label: '录取情况' },
+        { prop: 'action', label: '操作', slotBody: 'history' }
+      ]
+      rows.forEach(row => {
+        row.localRoundName = this.roundName
+        if (this.queryCodeOpt.isEnroll) {
+          const enrollGenOpt = Object.values(config.electiveGenerationOptions).find(opt => opt.value == row['enrollGeneration'])
+          row.localEnrollGeneration = enrollGenOpt.enrollName
+        } else {
+          row.localApplyGroupNames = Array.isArray(row['applyGroupNames'])
+            ? row['applyGroupNames'].join('/')
+            : row['applyGroupNames']
+        }
+      })
+      return {
+        rows,
+        columns
+      }
     }
   },
   methods: {
     async handleQuery() {
-      if (this.queryParams.studentRoundId != this.electiveStatus?.selectResult?.roundId) {
-        const resStatus = await getStudentSelected(this.mappedParams)
-        this.electiveStatus = resStatus.data
-        this.electiveStatus.currentGeneration = 3
+      this.loading = true
+      try {
+        if (this.queryParams.studentRoundId != this.electiveStatus?.selectResult?.roundId) {
+          const resStatus = await getStudentSelected(this.mappedParams)
+          this.electiveStatus = resStatus.data
+        }
+        const resSummary = await getClassGenerationDetails(this.mappedParams)
+        this.releaseSummary = resSummary.data
+      } finally {
+        this.loading = false
       }
-      // const summary = await getClass
     },
     handleInvalid() {
       this.electiveStatus = null