|  | @@ -41,19 +41,22 @@
 | 
	
		
			
				|  |  |      <!--  师资填写  -->
 | 
	
		
			
				|  |  |      <div class="mt20 mb5">
 | 
	
		
			
				|  |  |        <el-button-group>
 | 
	
		
			
				|  |  | -        <el-button :type="enableFacultyForm?'primary':''" size="small" @click="openFacultyForm">AI师资匹配</el-button>
 | 
	
		
			
				|  |  | -        <el-button v-if="enableFacultyForm||enableFacultyResult" size="small" :plain="!groupModel.completed"
 | 
	
		
			
				|  |  | +        <el-button v-if="groupsValid" :type="enableFacultyForm?'primary':''" size="small"
 | 
	
		
			
				|  |  | +                   @click="openFacultyForm">AI师资匹配
 | 
	
		
			
				|  |  | +        </el-button>
 | 
	
		
			
				|  |  | +        <el-button v-if="groupsValid&&(enableFacultyForm||enableFacultyResult)" size="small"
 | 
	
		
			
				|  |  | +                   :plain="!groupModel.completed"
 | 
	
		
			
				|  |  |                     :type="groupModel.completed?enableFacultyResult?'primary':'':'warning'"
 | 
	
		
			
				|  |  |                     @click="calculateFacultyResult">
 | 
	
		
			
				|  |  |            {{ groupModel.completed ? '' : '生成' }}师资匹配结果
 | 
	
		
			
				|  |  |          </el-button>
 | 
	
		
			
				|  |  |        </el-button-group>
 | 
	
		
			
				|  |  |      </div>
 | 
	
		
			
				|  |  | -    <faculty-forms ref="formFaculty" v-if="enableFacultyForm" :rows="groupModel.faculties"
 | 
	
		
			
				|  |  | +    <faculty-forms ref="formFaculty" v-if="groupsValid&&enableFacultyForm" :rows="groupModel.faculties"
 | 
	
		
			
				|  |  |                     @change="resetCalculateStatus"></faculty-forms>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <!--  师资结果  -->
 | 
	
		
			
				|  |  | -    <faculty-result v-if="enableFacultyResult" :rows="groupModel.faculties"></faculty-result>
 | 
	
		
			
				|  |  | +    <faculty-result v-if="groupsValid&&enableFacultyResult" :rows="groupModel.faculties"></faculty-result>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <!--  操作  -->
 | 
	
		
			
				|  |  |      <div class="fx-row mt20">
 | 
	
	
		
			
				|  | @@ -96,9 +99,10 @@ import FacultyForms from '@/views/permission/components/steps/fauclty/faculty-fo
 | 
	
		
			
				|  |  |  import RoundModelConvert from '../round-model-convert'
 | 
	
		
			
				|  |  |  import { calculateFaculties, generateFaculties } from '@/api/webApi/selection'
 | 
	
		
			
				|  |  |  import FacultyResult from '@/views/permission/components/steps/fauclty/faculty-result'
 | 
	
		
			
				|  |  | -import GroupQueryDialog from'../group-query-dialog'
 | 
	
		
			
				|  |  | +import GroupQueryDialog from '../group-query-dialog'
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  | -  components: { FacultyResult, FacultyForms, RoundScoreQuery,ChooseSubjectDialog,GroupQueryDialog },
 | 
	
		
			
				|  |  | +  components: { FacultyResult, FacultyForms, RoundScoreQuery, ChooseSubjectDialog, GroupQueryDialog },
 | 
	
		
			
				|  |  |    mixins: [selectTranslateMixin, RoundModelConvert],
 | 
	
		
			
				|  |  |    name: 'round-setting-group',
 | 
	
		
			
				|  |  |    props: {
 | 
	
	
		
			
				|  | @@ -157,6 +161,9 @@ export default {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    computed: {
 | 
	
		
			
				|  |  | +    groupsValid() {
 | 
	
		
			
				|  |  | +      return !!this.groupModel.groupIds.length
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      roundGroups() {
 | 
	
		
			
				|  |  |        // 按选项显示顺序排序
 | 
	
		
			
				|  |  |        if (!this.groupModel?.groupIds?.length) return []
 | 
	
	
		
			
				|  | @@ -254,9 +261,15 @@ export default {
 | 
	
		
			
				|  |  |      resetCalculateStatus() {
 | 
	
		
			
				|  |  |        this.groupModel.completed = false
 | 
	
		
			
				|  |  |        const clearFields = ['levelClassCount', 'qualifiedClassCount', 'requiredClassesCount', 'actualClassesCount', 'missingClassesCount', 'missingTeacherCount']
 | 
	
		
			
				|  |  | -      this.groupModel.faculties?.forEach(faculty => {
 | 
	
		
			
				|  |  | -        clearFields.forEach(field => faculty[field] = 0)
 | 
	
		
			
				|  |  | -      })
 | 
	
		
			
				|  |  | +      if (!this.groupsValid) {
 | 
	
		
			
				|  |  | +        this.enableFacultyForm = false
 | 
	
		
			
				|  |  | +        this.enableFacultyResult = false
 | 
	
		
			
				|  |  | +        this.groupModel.faculties = []
 | 
	
		
			
				|  |  | +      } else {
 | 
	
		
			
				|  |  | +        this.groupModel.faculties?.forEach(faculty => {
 | 
	
		
			
				|  |  | +          clearFields.forEach(field => faculty[field] = 0)
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  |        if (this.enableFacultyForm || this.enableFacultyResult) {
 | 
	
		
			
				|  |  |          this.enableFacultyForm = true
 | 
	
		
			
				|  |  |          this.enableFacultyResult = !this.enableFacultyForm
 | 
	
	
		
			
				|  | @@ -280,18 +293,16 @@ export default {
 | 
	
		
			
				|  |  |          this.scoreQueryGroupId = row.groupId
 | 
	
		
			
				|  |  |          this.scoreQueryVisible = true
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  | -      console.log(row,key)
 | 
	
		
			
				|  |  | -      if(key == 'dataQuery') {
 | 
	
		
			
				|  |  | +      if (key == 'dataQuery') {
 | 
	
		
			
				|  |  |          const year = this.settingModel.year
 | 
	
		
			
				|  |  |          this.$refs.groupQueryDialog.open(year)
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  | -      if(key == 'majorQuery') {
 | 
	
		
			
				|  |  | +      if (key == 'majorQuery') {
 | 
	
		
			
				|  |  |          // 打开选科弹窗
 | 
	
		
			
				|  |  |          const course0 = this.translateCourse0(row.groupId)
 | 
	
		
			
				|  |  |          const course1 = this.translateCourse1(row.groupId)
 | 
	
		
			
				|  |  | -        console.log(year)
 | 
	
		
			
				|  |  |          const year = this.settingModel.year
 | 
	
		
			
				|  |  | -        this.$refs.chooseDialog.open(course0, course1,year)
 | 
	
		
			
				|  |  | +        this.$refs.chooseDialog.open(course0, course1, year)
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    }
 |