|
@@ -2,7 +2,9 @@
|
|
|
<el-row>
|
|
|
<mx-table :propDefines="propDefines" :rows="displayRows">
|
|
|
<template #classCount="{row,$index}">
|
|
|
- <el-input-number size="small" v-model="row.classCount" @change="classCountChange(row,$index)" :min="0" :disabled="row.classCount != 0" label="label"></el-input-number>
|
|
|
+ <el-input-number size="small" v-model="row.classCount" @change="classCountChange(row,$index)" :min="0"
|
|
|
+ :disabled="row.classCount != 0" label="label"
|
|
|
+ ></el-input-number>
|
|
|
</template>
|
|
|
<!-- 人数设定 -->
|
|
|
<template #countSet="{row}">
|
|
@@ -11,7 +13,7 @@
|
|
|
plain
|
|
|
icon="el-icon-edit"
|
|
|
size="mini"
|
|
|
- @click="countEdit(row)"
|
|
|
+ @click="editCount(row)"
|
|
|
>设定
|
|
|
</el-button>
|
|
|
</template>
|
|
@@ -22,7 +24,7 @@
|
|
|
plain
|
|
|
icon="el-icon-edit"
|
|
|
size="mini"
|
|
|
- @click="edit(row)"
|
|
|
+ @click="editClass(row)"
|
|
|
>编辑
|
|
|
</el-button>
|
|
|
</template>
|
|
@@ -38,7 +40,7 @@
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</mx-table>
|
|
|
- <choose-class ref="editClassDialog"></choose-class>
|
|
|
+ <choose-class :year="round.year" :roundId="round.roundId" ref="editClassDialog"></choose-class>
|
|
|
<set-classcount ref="setClassDialog"></set-classcount>
|
|
|
<class-adjust ref="adjustDialog"></class-adjust>
|
|
|
</el-row>
|
|
@@ -46,34 +48,37 @@
|
|
|
<script>
|
|
|
import MxClassTreeTranslateMixin from '@/components/Cache/modules/mx-classTree-translate-mixin.js'
|
|
|
import MxSelectTranslateMixin from '@/components/Cache/modules/mx-select-translate-mixin.js'
|
|
|
-import * as gradeAxios from '@/api/webApi/grade'
|
|
|
-import { getCurrentRound } from '@/api/webApi/elective/dispatch'
|
|
|
import ChooseClass from './choose-class'
|
|
|
import ClassAdjust from './class-adjust'
|
|
|
import SetClasscount from './set-classcount'
|
|
|
+
|
|
|
export default {
|
|
|
components: {
|
|
|
ChooseClass,
|
|
|
SetClasscount,
|
|
|
- ClassAdjust
|
|
|
+ ClassAdjust,
|
|
|
},
|
|
|
mixins: [MxClassTreeTranslateMixin, MxSelectTranslateMixin],
|
|
|
props: {
|
|
|
- // round: {
|
|
|
- // type: Object,
|
|
|
- // default: {},
|
|
|
- // }
|
|
|
+ round: {
|
|
|
+ type: Object,
|
|
|
+ default: {},
|
|
|
+ },
|
|
|
+ settings: {
|
|
|
+ type: Array,
|
|
|
+ default: [],
|
|
|
+ }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- round: null,
|
|
|
settingList: [],
|
|
|
+ dataList: [],
|
|
|
propDefines: {
|
|
|
groupName: {
|
|
|
label: '组合'
|
|
|
},
|
|
|
number: {
|
|
|
- label: '组合人数'
|
|
|
+ label: '录取人数'
|
|
|
},
|
|
|
classCount: {
|
|
|
label: '班级数',
|
|
@@ -84,78 +89,78 @@ export default {
|
|
|
slot: 'edit'
|
|
|
},
|
|
|
groupClass: {
|
|
|
- label: '班级名称',
|
|
|
+ label: '班级名称'
|
|
|
},
|
|
|
countSet: {
|
|
|
label: '人数设定',
|
|
|
- slot: 'countSet'
|
|
|
+ slot: 'countSet'
|
|
|
},
|
|
|
- actualCount: {
|
|
|
- label: '人数',
|
|
|
+ expectedCount: {
|
|
|
+ label: '人数'
|
|
|
},
|
|
|
adjust: {
|
|
|
label: '操作',
|
|
|
- slot:'adjust'
|
|
|
- },
|
|
|
+ slot: 'adjust'
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- allowDispatch() {
|
|
|
- return this.round.allowDispatch
|
|
|
- },
|
|
|
displayRows() {
|
|
|
if (!this.classTree.length) return []
|
|
|
if (!this.listGroupsOptions.length) return []
|
|
|
- // if (!this.settingList.length) return []
|
|
|
- if (!this.round) return []
|
|
|
-
|
|
|
- //
|
|
|
- const rows = this.round.roundGroups.map(rg => ({
|
|
|
+ // if (!this.settings.length) return []
|
|
|
+ if (!this.round.groupList) return []
|
|
|
+ const rows = this.round.groupList.map(rg => ({
|
|
|
groupId: rg.groupId,
|
|
|
- groupName: this.translateGroup(rg.groupId),
|
|
|
- number: this.round.enrollGroupCount[rg.groupId],
|
|
|
- classCount: rg.classCount,
|
|
|
- actualCount: this.settingList.filter(item => item.groupId == rg.groupId).map(item => item.actualCount).toString(),
|
|
|
- groupClass: this.settingList
|
|
|
+ roundId: this.round.roundId,
|
|
|
+ groupName: rg.name,
|
|
|
+ number: this.round.enrollGroupCount[rg.groupId] || 200, // 录取人数
|
|
|
+ classCount: rg.classCount || 5, // 班级数
|
|
|
+ expectedCount: this.settings.filter(item => item.groupId == rg.groupId).map(item => item.expectedCount).toString(),
|
|
|
+ groupClass: this.settings
|
|
|
.filter(item => item.groupId == rg.groupId)
|
|
|
- .map(item => this.getClassName(item.classId)).toString(),
|
|
|
+ .map(item => this.getClassName(item.classId)).toString()
|
|
|
}))
|
|
|
console.log('displayRows computed:', rows)
|
|
|
return rows
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- this.loadRoundStatus()
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
adjust() {
|
|
|
this.$refs.adjustDialog.open()
|
|
|
},
|
|
|
- countEdit(row) {
|
|
|
- // 设定人数
|
|
|
- const filter = this.settingList.filter(item => item.groupId == row.groupId)
|
|
|
+ editCount(row) {
|
|
|
+ // 设定分配人数
|
|
|
+ const filter = this.settings.filter(item => item.groupId == row.groupId)
|
|
|
if (filter.length == 0) {
|
|
|
this.$message.warning('班级未编辑')
|
|
|
return
|
|
|
}
|
|
|
- this.$refs.setClassDialog.open(row,this.settingList)
|
|
|
- },
|
|
|
- async loadRoundStatus() {
|
|
|
- const res = await getCurrentRound()
|
|
|
- this.round = res.data
|
|
|
+ // if(){
|
|
|
+ // this.$message.warning('需要选择')
|
|
|
+ // }
|
|
|
+ this.$refs.setClassDialog.open(row, this.settings)
|
|
|
},
|
|
|
- classCountChange(newVal,index) {
|
|
|
- console.log(newVal)
|
|
|
- console.log(index)
|
|
|
- this.round.roundGroups[index] = newVal
|
|
|
+ classCountChange(newVal, index) {
|
|
|
+ this.round.groupList[index] = newVal
|
|
|
},
|
|
|
- edit(row) {
|
|
|
+ editClass(row) {
|
|
|
+ // 分配班级
|
|
|
if (!row.classCount) {
|
|
|
this.$message.warning('班级数为0时不可分班')
|
|
|
return
|
|
|
}
|
|
|
- this.$refs.editClassDialog.open(row,this.settingList)
|
|
|
+ // 获取分班配置
|
|
|
+ // getSettings({
|
|
|
+ // roundId: row.roundId
|
|
|
+ // }).then(res => {
|
|
|
+ // this.$refs.editClassDialog.open(row, res.data)
|
|
|
+ // })
|
|
|
+ this.$refs.editClassDialog.open(row, this.settings)
|
|
|
}
|
|
|
}
|
|
|
}
|