Browse Source

选科报名步骤操作动态

shilipojs 2 years ago
parent
commit
b3b2f58cda

+ 3 - 2
src/views/system/user/profile/components/groups-match.vue

@@ -26,10 +26,11 @@ export default {
   },
   computed: {
     formatList() {
+      console.log()
       if (!this.reports.length) return []
       return this.reports.map(item => {
         let tempProp = {}
-        this.majors.map(major => {
+        this.majors.map((major) => {
           if(major.matchedGroupIds.findIndex(gi => item.groupId == gi) != -1) {
             tempProp[`a${major.majorCategoryCode}`] = `符合${major.collegeName ? `(${major.collegeName})` : '' }`
           }
@@ -45,7 +46,7 @@ export default {
         if(!this.majors.length) return {}
         console.log(this.majors)
         const props = {}
-        this.majors.map(item => {
+        this.majors.map((item) => {
           props[`a${item.majorCategoryCode}`] = {label:item.majorCategoryName }
         })
         return {

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

@@ -19,7 +19,7 @@
       <template #signUp="{row}">
         <span class="f-red" v-if="!row.allowSelect">无法报名</span>
         <div v-else>
-          <span v-if="generation > 0">可报名</span>
+          <span v-if="generation.current > 1">可报名</span>
           <div v-else>
             <span class="f-red btn-red" v-if="row.selected" @click="toUnSelect(row)">取消报名</span>
             <span class="btn-green" v-else @click="toSelect(row)">报名</span>
@@ -54,15 +54,15 @@
       </template>
     </mx-table>
     <!-- 初录 多志愿拖拽 -->
-    <div v-if="generation == 0">
+    <div v-if="this.generation.current == 1">
       <p>您的选科志愿: <span v-for="(item,index) in selectedList">
       {{ item.groupName }}{{ index + 1 < selectedList.length ? '、' : '' }}</span>
       </p>
       <test-drage ref="drage" :sortList="selectedList"></test-drage>
       <el-button @click="commit" type="primary">提交</el-button>
     </div>
-    <!--  补录报名和二次补录报名 -->
-    <div v-else>
+    <!--  补录报名和二次补录报名和调剂报名 -->
+    <div v-if="flagShow">
       <div v-for="item in singleList" class="mb5 mt5">
         <el-button @click="commit" type="primary">{{ `${item.groupName} : 报名` }}</el-button>
       </div>
@@ -126,7 +126,8 @@ import OverUnderBadge from '@/views/elective/publish/components/steps/fauclty/ov
 export default {
 
   props: {
-    generation: Object
+    generation: Object,
+    readonly: Boolean // 校长端不允许操作
   },
   components: {
     OverUnderBadge,
@@ -155,19 +156,20 @@ export default {
       prevPreferences: [1], // 选科前一轮报名的group
       optionalMajors: [],
       dialogVisible: false,
-      modelsWrapper: {},
       selectedList: [],
       singleList: [], // 单志愿列表
       rows: []
     }
   },
-  mounted() {
-    // this.$refs.drage.init(this.selectedList)
-  },
   computed: {
+    flagShow() {
+      return (this.generation.current == 3 && this.generation.active == 3) ||
+        (this.generation.current == 5 && this.generation.active == 5)||
+        (this.generation.current == 5 && this.generation.active == 7)
+    },
     aiShow() {
       const active = this.generation.active
-      if (active == 3 || active == 5 || active == 7) return true
+      if (active == 3 || active == 5 ) return true
       return false
     },
     resolveTablePrefix() {
@@ -191,7 +193,9 @@ export default {
       }
     },
     resolveTableSuffix() {
-      const hidden = this.generation.active != this.generation.current
+      const stepMatched = this.generation.active == this.generation.current
+      const enableApply = !this.generation.currentOpt.decisionMaking
+      const enableSignUp = stepMatched && enableApply && !this.readonly
       return {
         allowSelectTips: {
           label: '报名状态'
@@ -216,7 +220,7 @@ export default {
           slot: 'signUp',
           width: '100',
           fixed: 'right',
-          hidden: hidden
+          hidden: !enableSignUp
         }
       }
     },
@@ -262,6 +266,7 @@ export default {
         return {
           groupId: row.groupId,
           groupName: row.groupName,
+          selected: row.selected,
           scoreSumGroup: row.scoreSumGroup,
           classCount: row.classCount,
           personCount: row.personCount,
@@ -291,7 +296,8 @@ export default {
       //
       const currentGeneration = 1
       // AI 分析 跳转
-      this.$refs.aiDialog.open(this.formatTable, currentGeneration)
+      console.log(this.formatRows)
+      this.$refs.aiDialog.open(this.formatRows, currentGeneration)
     },
     commit() {
       console.log(this.selectedList)
@@ -308,15 +314,19 @@ export default {
       this.$refs.esignDialog.open()
     },
     toSelect(row) {
-      const count = this.modelsWrapper.models.reduce((prev, cur) => {
+      const preferenceCount =this.generation.status.preferenceCount
+      const count = this.formatRows.reduce((prev, cur) => {
         return prev += cur.selected ? 1 : 0
-      })
-      if (count >= this.preferenceCount) {
-        this.$message.warning(`最多选择${this.preferenceCount}个志愿`)
+      },0)
+      console.log(count)
+      if (count >= preferenceCount) {
+        this.$message.warning(`最多选择${preferenceCount}个志愿`)
         return
       }
+      console.log(row)
       row.selected = true
       this.selectedList.push(row)
+      this.$refs.drage.init(this.selectedList)
     },
     toUnSelect(row) {
       this.$confirm(`是否解除选科组合【${row.groupName}】`, '警告', {

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

@@ -26,7 +26,7 @@
     </el-card>
     <!--  自选专业 推荐专业  -->
     <select-subject class="mt20" :evaluationMajors="evaluationMajors" :optionalMajors="optionalMajors"
-                    :list="reportInfo.models"
+                    :list="generation.currentGenerationModels"
     ></select-subject>
     <!--  选科报名表  -->
     <el-card class="box-card mt20">
@@ -133,7 +133,6 @@ export default {
         src: '9fca0b997b8346ce8c3ce69feaf89294',
         aliIdType: 2
       },
-      reportInfo: [],
       optionalMajors: [],
       evaluationMajors: [],
       form: {
@@ -152,11 +151,13 @@ export default {
       propData: {},
       stepOptions: config.electiveGenerationOptions,
       activeStep: '',
-      mode: [],
       generationModels: []
     }
   },
   computed: {
+    currentGenerationModels() {
+
+    },
     currentOpt() {
       /// 当前进程代对应的配置项,可能没有值
       return Object.values(this.stepOptions).find(opt => opt.value == this.selectObj.currentGeneration)
@@ -170,18 +171,9 @@ export default {
       /// 当前选中的进程代,可能没有值
       return this.generationModels.filter(gm => gm.generation <= this.activeOpt.value)
     },
-    // stepOptions() {
-    //   const steps = {}
-    //   const stepOptions = config.electiveGenerationOptions
-    //   for (let key in stepOptions) {
-    //     if(stepOptions[key].value <= this.selectObj.currentGeneration){
-    //       steps['a'+ key] = stepOptions[key]
-    //     }
-    //   }
-    //   return steps
-    // },
     generation() {
       if (!this.selectObj) return {}
+      const generationModels = this.generationModels
       return {
         // generation key value
         hiddenGenerations: [],
@@ -190,6 +182,7 @@ export default {
         currentOpt: this.currentOpt,
         active: this.activeOpt?.value,
         activeOpt: this.activeOpt,
+        currentGenerationModels: generationModels[generationModels.length-1].models,
         status: {
           ...this.selectObj,
           roundName: this.selectObj.name || ''
@@ -212,14 +205,12 @@ export default {
     this.loadStudentSelected()
     this.getStudentElectiveModels()
     this.getOptionalMajors()
-    // this.getReportList()
     this.getRecommendMajor()
   },
   methods: {
     getStudentElectiveModels() {
       getStudentElectiveModels().then(res => {
         this.generationModels =res.data
-        this.mode = res.data
       })
     },
     getRecommendMajor() {
@@ -227,12 +218,7 @@ export default {
         this.evaluationMajors = res.data
       })
     },
-    getReportList() {
-      getModels().then(res => {
-        this.reportInfo = res.data
-        this.$refs.reportRef.init(this.reportInfo)
-      })
-    },
+
     getOptionalMajors() {
       getOptionalMajors().then(res => {
         console.log(res)
@@ -244,7 +230,7 @@ export default {
       getStudentSelected().then(res => {
         console.log('getStudentSelected', res)
         const selectStatus = res.data.selectResult
-        selectStatus.currentGeneration = 7 // 当前所处的状态
+        selectStatus.currentGeneration = 3 // 当前所处的状态
         selectStatus.preferenceCount = 3 // 志愿数
         // selectStatus.groupIds = selectStatus.groupIds || '1,2,3,4,5,6'
         selectStatus.groupIds = '1,2,3,4,5,6'