Selaa lähdekoodia

选科报名修复

shilipojs 3 vuotta sitten
vanhempi
commit
aaea84610a

+ 1 - 1
src/api/webApi/elective/selected-subject.js

@@ -38,7 +38,7 @@ export function getStudentSelected() {
 // 学生获取选科状态数据,得到是每个组合最终状态和结果
 export function getStudentElectiveModels(params) {
   return request({
-    url: '/mock/front/elective/studentElectiveModels',
+    url: '/mock/front/elective/enroll/getStudentElectiveModels',
     method: 'get',
     params
   })

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

@@ -153,7 +153,6 @@ export default {
       modelsWrapper: {},
       selectedList: [],
       singleList: [], // 单志愿列表
-      formatRows: []
     }
   },
   mounted() {
@@ -227,9 +226,34 @@ export default {
       return dynamicColumns
     },
     formatRows() {
-      if(!this.selectObj?.groupIds) return []
-      return this.selectObj.groupIds.split(',').map(item => {
-        groupId: item
+      if(!this.generation.status?.groupIds) return []
+      const generationModels = this.generation.activeModels.find(item => item.generation == this.generation.active).models
+      return this.generation.status.groupIds.split(',').map(groupId => {
+        console.log(groupId)
+        const row = generationModels.find(item => item.groupId== groupId)
+        console.log(row)
+        row.allowSelectTips = row.allowSelect ? '报名中' : row.disabledReason
+        row.subjects = this.optionalMajors.filter(college => {
+            if (college.matchedGroupIds.indexOf(item.groupId) != -1) return college.majorCategoryName
+        }).map(item => item.majorCategoryName)
+        row.colleges = this.optionalMajors.filter(college => {
+          if (college.matchedGroupIds.indexOf(item.groupId) != -1) return college.majorCategoryName
+        }).map(item => {
+          return {
+              college: item.collegeName,
+              major: item.majorCategoryName
+            }
+        })
+        return {
+          groupId: row.groupId,
+          groupName: row.groupName,
+          scoreSumGroup: row.scoreSumGroup,
+          classCount: row.classCount,
+          personCount: row.personCount,
+          allowSelectTips :row.allowSelectTips,
+          colleges :row.colleges,
+          subjects :row.subjects,
+        }
       })
     },
     formatCols() {

+ 3 - 3
src/views/system/user/profile/round-select.vue

@@ -116,7 +116,6 @@ import {
   getStudentElectiveModels,
   getOptionalMajors,
   getStudentSelected,
-  getPrimaryElectivesModels,
   getRecommendMajor
 } from '@/api/webApi/elective/selected-subject'
 export default {
@@ -210,7 +209,7 @@ export default {
   },
   mounted() {
     this.loadStudentSelected()
-    this.getModels()
+    this.getStudentElectiveModels()
     this.getOptionalMajors()
     // this.getReportList()
     this.getRecommendMajor()
@@ -245,7 +244,8 @@ export default {
         const selectStatus = res.data.selectResult
         selectStatus.currentGeneration = 7 // 当前所处的状态
         selectStatus.preferenceCount = 3 // 志愿数
-        selectStatus.groupIds = selectStatus.groupIds || '1,2,3,4,5,6'
+        // selectStatus.groupIds = selectStatus.groupIds || '1,2,3,4,5,6'
+        selectStatus.groupIds = '1,2,3,4,5,6'
         this.selectObj = selectStatus
         this.allowSelect = res.data.allowSelect
         this.form.groupId = this.selectObj?.groupId