|  | @@ -4,17 +4,11 @@
 | 
	
		
			
				|  |  |        <template #header>选科信息</template>
 | 
	
		
			
				|  |  |        <el-row :gutter="20">
 | 
	
		
			
				|  |  |          <el-col :span="12">
 | 
	
		
			
				|  |  | -          <el-form ref="form" v-if="selectObj" :model="form" :rules="rule" label-position="right" label-width="80px">
 | 
	
		
			
				|  |  | +          <el-form ref="form" v-if="selectObj" label-position="right" label-width="80px">
 | 
	
		
			
				|  |  |              <el-form-item label="选科轮次" class="form-item-readonly">{{ selectObj.year }}{{ selectObj.name }}
 | 
	
		
			
				|  |  |              </el-form-item>
 | 
	
		
			
				|  |  |              <el-form-item label="选科时间" class="form-item-readonly">{{ selectObj.beginTime }} 至 {{ selectObj.endTime }}
 | 
	
		
			
				|  |  |              </el-form-item>
 | 
	
		
			
				|  |  | -            <!--<el-form-item label="选科状态" class="form-item-readonly">-->
 | 
	
		
			
				|  |  | -            <!--未选择/已选择<span class="f-red">缺字段</span>-->
 | 
	
		
			
				|  |  | -            <!--</el-form-item>-->
 | 
	
		
			
				|  |  | -            <!--<el-form-item label="AI选科" class="form-item-readonly">-->
 | 
	
		
			
				|  |  | -            <!--进入/查看<span class="f-red">缺字段</span>-->
 | 
	
		
			
				|  |  | -            <!--</el-form-item>-->
 | 
	
		
			
				|  |  |            </el-form>
 | 
	
		
			
				|  |  |          </el-col>
 | 
	
		
			
				|  |  |          <el-col :span="12" style="vertical-align: center">
 | 
	
	
		
			
				|  | @@ -26,71 +20,14 @@
 | 
	
		
			
				|  |  |      </el-card>
 | 
	
		
			
				|  |  |      <!--  自选专业 推荐专业  -->
 | 
	
		
			
				|  |  |      <select-subject class="mt20" :evaluationMajors="evaluationMajors" :optionalMajors="optionalMajors"
 | 
	
		
			
				|  |  | -                    :list="generation.currentGenerationModels"
 | 
	
		
			
				|  |  | -    ></select-subject>
 | 
	
		
			
				|  |  | +                    :list="roundGroups"></select-subject>
 | 
	
		
			
				|  |  |      <!--  选科报名表  -->
 | 
	
		
			
				|  |  |      <el-card class="box-card mt20">
 | 
	
		
			
				|  |  |        <template #header>
 | 
	
		
			
				|  |  | -        <elective-generation-steps v-if="allowSelect" v-model="activeStep" :generation="generation"
 | 
	
		
			
				|  |  | +        <elective-generation-steps v-if="selectObj" v-model="activeStep" :generation="generation"
 | 
	
		
			
				|  |  |                                     disable-hidden-feature></elective-generation-steps>
 | 
	
		
			
				|  |  |        </template>
 | 
	
		
			
				|  |  | -      <report-table ref="reportRef" :generation="generation"></report-table>
 | 
	
		
			
				|  |  | -    </el-card>
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    <el-card shadow="hover" class="mt20">
 | 
	
		
			
				|  |  | -      <template #header>意向选科</template>
 | 
	
		
			
				|  |  | -      <el-row :gutter="20">
 | 
	
		
			
				|  |  | -        <el-col :span="12">
 | 
	
		
			
				|  |  | -          <el-card shadow="hover">
 | 
	
		
			
				|  |  | -            <template #header>
 | 
	
		
			
				|  |  | -              <div class="fx-row fx-bet-cen">
 | 
	
		
			
				|  |  | -                <div>专业选科</div>
 | 
	
		
			
				|  |  | -                <div>
 | 
	
		
			
				|  |  | -                  <el-button type="primary" plain size="small" round>点击进入</el-button>
 | 
	
		
			
				|  |  | -                </div>
 | 
	
		
			
				|  |  | -              </div>
 | 
	
		
			
				|  |  | -            </template>
 | 
	
		
			
				|  |  | -            <div>介绍文案、测评结果</div>
 | 
	
		
			
				|  |  | -          </el-card>
 | 
	
		
			
				|  |  | -        </el-col>
 | 
	
		
			
				|  |  | -        <el-col :span="12">
 | 
	
		
			
				|  |  | -          <el-card shadow="hover">
 | 
	
		
			
				|  |  | -            <template #header>
 | 
	
		
			
				|  |  | -              <div class="fx-row fx-bet-cen">
 | 
	
		
			
				|  |  | -                <div>组合选科</div>
 | 
	
		
			
				|  |  | -                <div>
 | 
	
		
			
				|  |  | -                  <el-button type="primary" plain size="small" round>点击进入</el-button>
 | 
	
		
			
				|  |  | -                </div>
 | 
	
		
			
				|  |  | -              </div>
 | 
	
		
			
				|  |  | -            </template>
 | 
	
		
			
				|  |  | -            <div>介绍文案、测评结果</div>
 | 
	
		
			
				|  |  | -          </el-card>
 | 
	
		
			
				|  |  | -        </el-col>
 | 
	
		
			
				|  |  | -      </el-row>
 | 
	
		
			
				|  |  | -    </el-card>
 | 
	
		
			
				|  |  | -    <el-card shadow="hover" class="mt20">
 | 
	
		
			
				|  |  | -      <template #header>选科报名</template>
 | 
	
		
			
				|  |  | -      <div class="fx-column">
 | 
	
		
			
				|  |  | -        <div v-if="!allowSelect" class="mb30">
 | 
	
		
			
				|  |  | -          <span class="f-red">*</span>
 | 
	
		
			
				|  |  | -          当前时段未开启选科
 | 
	
		
			
				|  |  | -        </div>
 | 
	
		
			
				|  |  | -        <el-form ref="form" v-if="selectObj" :model="form" :rules="rule" label-position="right" label-width="80px">
 | 
	
		
			
				|  |  | -          <el-form-item label="选科轮次" class="form-item-readonly">{{ selectObj.year }}{{ selectObj.name }}</el-form-item>
 | 
	
		
			
				|  |  | -          <el-form-item label="选科时间" class="form-item-readonly">{{ selectObj.beginTime }} 至 {{ selectObj.endTime }}
 | 
	
		
			
				|  |  | -          </el-form-item>
 | 
	
		
			
				|  |  | -          <el-form-item prop="groupId" label="选科组合">
 | 
	
		
			
				|  |  | -            <el-radio-group v-model="form.groupId" :disabled="!allowSelect">
 | 
	
		
			
				|  |  | -              <el-radio v-for="(opt,idx) in selectGroupOptions" :key="idx" :label="opt.value">{{ opt.text }}
 | 
	
		
			
				|  |  | -              </el-radio>
 | 
	
		
			
				|  |  | -            </el-radio-group>
 | 
	
		
			
				|  |  | -          </el-form-item>
 | 
	
		
			
				|  |  | -          <div class="fx-row fx-cen-cen mt20" v-if="allowSelect">
 | 
	
		
			
				|  |  | -            <el-button v-loading="submitting" type="primary" @click="handleSubmit" style="width: 150px" round>保存
 | 
	
		
			
				|  |  | -            </el-button>
 | 
	
		
			
				|  |  | -          </div>
 | 
	
		
			
				|  |  | -        </el-form>
 | 
	
		
			
				|  |  | -      </div>
 | 
	
		
			
				|  |  | +      <report-table :generation="generation" :optional-majors="optionalMajors"></report-table>
 | 
	
		
			
				|  |  |      </el-card>
 | 
	
		
			
				|  |  |      <el-card shadow="hover" class="mt20">
 | 
	
		
			
				|  |  |        <template #header>选科通知</template>
 | 
	
	
		
			
				|  | @@ -134,31 +71,18 @@ export default {
 | 
	
		
			
				|  |  |          src: '9fca0b997b8346ce8c3ce69feaf89294',
 | 
	
		
			
				|  |  |          aliIdType: 2
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  | +      //
 | 
	
		
			
				|  |  |        optionalMajors: [],
 | 
	
		
			
				|  |  |        evaluationMajors: [],
 | 
	
		
			
				|  |  | -      form: {
 | 
	
		
			
				|  |  | -        groupId: ''
 | 
	
		
			
				|  |  | -      },
 | 
	
		
			
				|  |  | -      rule: {
 | 
	
		
			
				|  |  | -        groupId: [{
 | 
	
		
			
				|  |  | -          required: true,
 | 
	
		
			
				|  |  | -          message: '选科组合必填'
 | 
	
		
			
				|  |  | -        }]
 | 
	
		
			
				|  |  | -      },
 | 
	
		
			
				|  |  |        //
 | 
	
		
			
				|  |  |        selectObj: null,
 | 
	
		
			
				|  |  |        allowSelect: false,
 | 
	
		
			
				|  |  | -      submitting: false,
 | 
	
		
			
				|  |  | -      propData: {},
 | 
	
		
			
				|  |  |        stepOptions: config.electiveGenerationOptions,
 | 
	
		
			
				|  |  |        activeStep: '',
 | 
	
		
			
				|  |  |        generationModels: []
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    computed: {
 | 
	
		
			
				|  |  | -    currentGenerationModels() {
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    },
 | 
	
		
			
				|  |  |      currentOpt() {
 | 
	
		
			
				|  |  |        /// 当前进程代对应的配置项,可能没有值
 | 
	
		
			
				|  |  |        return Object.values(this.stepOptions).find(opt => opt.value == this.selectObj.currentGeneration)
 | 
	
	
		
			
				|  | @@ -172,9 +96,20 @@ export default {
 | 
	
		
			
				|  |  |        /// 当前选中的进程代,可能没有值
 | 
	
		
			
				|  |  |        return this.generationModels.filter(gm => gm.generation <= this.activeOpt.value)
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +    roundGroups() {
 | 
	
		
			
				|  |  | +      if (!this.selectObj?.groupIds) return []
 | 
	
		
			
				|  |  | +      if (!this.generationModels.length) return []
 | 
	
		
			
				|  |  | +      const currentModels = this.generationModels.last().models
 | 
	
		
			
				|  |  | +      return this.selectObj.groupIds?.split(',').map(groupId => {
 | 
	
		
			
				|  |  | +        const matched = currentModels.find(m => m.groupId == groupId) || {}
 | 
	
		
			
				|  |  | +        return ({
 | 
	
		
			
				|  |  | +          ...matched,
 | 
	
		
			
				|  |  | +          groupId: groupId
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  | +      }) || []
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      generation() {
 | 
	
		
			
				|  |  |        if (!this.selectObj) return {}
 | 
	
		
			
				|  |  | -      const generationModels = this.generationModels
 | 
	
		
			
				|  |  |        return {
 | 
	
		
			
				|  |  |          // generation key value
 | 
	
		
			
				|  |  |          hiddenGenerations: [],
 | 
	
	
		
			
				|  | @@ -183,7 +118,7 @@ export default {
 | 
	
		
			
				|  |  |          currentOpt: this.currentOpt,
 | 
	
		
			
				|  |  |          active: this.activeOpt?.value,
 | 
	
		
			
				|  |  |          activeOpt: this.activeOpt,
 | 
	
		
			
				|  |  | -        currentGenerationModels: generationModels[generationModels.length-1].models,
 | 
	
		
			
				|  |  | +        roundGroups: this.roundGroups,
 | 
	
		
			
				|  |  |          status: {
 | 
	
		
			
				|  |  |            ...this.selectObj,
 | 
	
		
			
				|  |  |            roundName: this.selectObj.name || ''
 | 
	
	
		
			
				|  | @@ -191,15 +126,6 @@ export default {
 | 
	
		
			
				|  |  |          models: this.generationModels,
 | 
	
		
			
				|  |  |          activeModels: this.activeModels
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  | -    },
 | 
	
		
			
				|  |  | -    stepChange(key) {
 | 
	
		
			
				|  |  | -      console.log(key)
 | 
	
		
			
				|  |  | -    },
 | 
	
		
			
				|  |  | -    selectGroupOptions() {
 | 
	
		
			
				|  |  | -      return this.selectObj.groupList?.map(g => ({
 | 
	
		
			
				|  |  | -        text: g.name,
 | 
	
		
			
				|  |  | -        value: g.groupId
 | 
	
		
			
				|  |  | -      })) || []
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    mounted() {
 | 
	
	
		
			
				|  | @@ -212,7 +138,6 @@ export default {
 | 
	
		
			
				|  |  |      getStudentElectiveModels() {
 | 
	
		
			
				|  |  |        getStudentElectiveModels().then(res => {
 | 
	
		
			
				|  |  |          this.generationModels = res.data
 | 
	
		
			
				|  |  | -        this.mode = res.data
 | 
	
		
			
				|  |  |        })
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      getRecommendMajor() {
 | 
	
	
		
			
				|  | @@ -220,12 +145,9 @@ export default {
 | 
	
		
			
				|  |  |          this.evaluationMajors = res.data
 | 
	
		
			
				|  |  |        })
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |      getOptionalMajors() {
 | 
	
		
			
				|  |  |        getOptionalMajors().then(res => {
 | 
	
		
			
				|  |  | -        console.log(res)
 | 
	
		
			
				|  |  |          this.optionalMajors = res.data.reverse().splice(0, 6)
 | 
	
		
			
				|  |  | -        this.$refs.reportRef.initOption(this.optionalMajors)
 | 
	
		
			
				|  |  |        })
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      loadStudentSelected() {
 | 
	
	
		
			
				|  | @@ -238,20 +160,6 @@ export default {
 | 
	
		
			
				|  |  |          selectStatus.groupIds = '1,2,3,4,5,6'
 | 
	
		
			
				|  |  |          this.selectObj = selectStatus
 | 
	
		
			
				|  |  |          this.allowSelect = res.data.allowSelect
 | 
	
		
			
				|  |  | -        this.form.groupId = this.selectObj?.groupId
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -      })
 | 
	
		
			
				|  |  | -    },
 | 
	
		
			
				|  |  | -    handleSubmit() {
 | 
	
		
			
				|  |  | -      this.$refs.form.validate((valid) => {
 | 
	
		
			
				|  |  | -        if (!valid) return
 | 
	
		
			
				|  |  | -        this.submitting = true
 | 
	
		
			
				|  |  | -        saveStudentSelected({
 | 
	
		
			
				|  |  | -          groupId: this.form.groupId
 | 
	
		
			
				|  |  | -        }).then(res => {
 | 
	
		
			
				|  |  | -          this.msgSuccess('保存成功')
 | 
	
		
			
				|  |  | -          this.loadStudentSelected()
 | 
	
		
			
				|  |  | -        }).finally(() => this.submitting = false)
 | 
	
		
			
				|  |  |        })
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    }
 |