|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<el-row>
|
|
|
- <mx-table :propDefines="propDefines" :rows="displayRows">
|
|
|
+ <mx-table :propDefines="propDefines" :rows="displayRows">
|
|
|
<template #classCount="{row,$index}">
|
|
|
<el-input-number size="mini" v-model="row.classCount" @change="classCountChange(row,$index)" :min="0"
|
|
|
:disabled="row.classCount != 0" label="label"
|
|
@@ -19,10 +19,11 @@
|
|
|
</template>
|
|
|
<template #className="{row}">
|
|
|
<div v-if="row.groupClass.length">
|
|
|
- <span class="btn-class" @click="toDetail(row,item.classId)" v-for="item in row.groupClass">{{item.className}}</span>
|
|
|
+ <span class="btn-class" @click="toDetail(row,item.classId)"
|
|
|
+ v-for="item in row.groupClass">{{ item.className }}</span>
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
- <span ></span>
|
|
|
+ <span></span>
|
|
|
</div>
|
|
|
</template>
|
|
|
<!-- 班级调整 -->
|
|
@@ -45,7 +46,7 @@
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</mx-table>
|
|
|
- <edit-group :year="round.year" ref="editDialog"></edit-group>
|
|
|
+ <edit-group :year="round.year" ref="editDialog"></edit-group>
|
|
|
<class-adjust ref="adjustDialog"></class-adjust>
|
|
|
</el-row>
|
|
|
</template>
|
|
@@ -61,21 +62,21 @@ export default {
|
|
|
components: {
|
|
|
EditGroup,
|
|
|
SetClasscount,
|
|
|
- ClassAdjust,
|
|
|
+ ClassAdjust
|
|
|
},
|
|
|
- mixins: [MxClassTreeTranslateMixin, MxSelectTranslateMixin,MxTransferMixin],
|
|
|
+ mixins: [MxClassTreeTranslateMixin, MxSelectTranslateMixin, MxTransferMixin],
|
|
|
props: {
|
|
|
loading: {
|
|
|
type: Boolean,
|
|
|
- default: false,
|
|
|
+ default: false
|
|
|
},
|
|
|
round: {
|
|
|
type: Object,
|
|
|
- default: {},
|
|
|
+ default: {}
|
|
|
},
|
|
|
settings: {
|
|
|
type: Array,
|
|
|
- default: [],
|
|
|
+ default: []
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
@@ -106,13 +107,13 @@ export default {
|
|
|
label: '人数'
|
|
|
},
|
|
|
proportion: {
|
|
|
- label: '男女比例',
|
|
|
+ label: '男女比例'
|
|
|
},
|
|
|
adjust: {
|
|
|
label: '操作',
|
|
|
width: 200,
|
|
|
slot: 'adjust'
|
|
|
- },
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -123,26 +124,32 @@ export default {
|
|
|
// if (!this.settings.length) return []
|
|
|
if (!this.round.groupList) return []
|
|
|
const rows = this.round.roundGroups.map(rg => ({
|
|
|
- groupId: rg.groupId,
|
|
|
- roundId: this.round.roundId,
|
|
|
- groupName: this.translateGroup(rg.groupId),
|
|
|
- number: this.round.enrollGroupCount[rg.groupId] || 0, // 录取人数
|
|
|
- classCount: rg.classCount, // 班级数
|
|
|
- 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 => {
|
|
|
- return {
|
|
|
- classId: item.classId,
|
|
|
- className: this.getClassName(item.classId)
|
|
|
- }
|
|
|
- })
|
|
|
- }))
|
|
|
+ groupId: rg.groupId,
|
|
|
+ roundId: this.round.roundId,
|
|
|
+ groupName: this.translateGroup(rg.groupId),
|
|
|
+ number: this.round.enrollGroupCount[rg.groupId] || 0, // 录取人数
|
|
|
+ classCount: rg.classCount, // 班级数
|
|
|
+ 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 => {
|
|
|
+ return {
|
|
|
+ classId: item.classId,
|
|
|
+ className: this.getClassName(item.classId)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }))
|
|
|
console.log('displayRows computed:', rows)
|
|
|
return rows
|
|
|
}
|
|
|
},
|
|
|
- inject: ['parentQuery'],
|
|
|
+ inject: {
|
|
|
+ parentQuery: {
|
|
|
+ default: function() {
|
|
|
+ // do nothing
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
openEditDialog(row) {
|
|
|
if (!row.classCount) {
|
|
@@ -155,21 +162,22 @@ export default {
|
|
|
adjust(row) {
|
|
|
// 调整 未分班不可调整
|
|
|
const filterSettings = this.settings.filter(item => item.groupId == row.groupId)
|
|
|
- if(filterSettings.length == 0){
|
|
|
+ if (filterSettings.length == 0) {
|
|
|
this.$message.warning('未分班不可调整')
|
|
|
return
|
|
|
}
|
|
|
- this.$refs.adjustDialog.open(row,this.settings.filter(item => item.groupId == row.groupId))
|
|
|
+ this.$refs.adjustDialog.open(row, this.settings.filter(item => item.groupId == row.groupId))
|
|
|
},
|
|
|
- toDetail(row,classId ='') {
|
|
|
+ toDetail(row, classId = '') {
|
|
|
const filterSettings = this.settings.filter(item => item.groupId == row.groupId)
|
|
|
- if(filterSettings.length == 0){
|
|
|
+ if (filterSettings.length == 0) {
|
|
|
this.$message.warning('该组合还未设定班级')
|
|
|
return
|
|
|
}
|
|
|
console.log(classId)
|
|
|
- const params = {group: row,classId:classId,groupIds: (this.round.groupIds &&this.round.groupIds.split(','))||[],
|
|
|
- parentQuery: this.parentQuery
|
|
|
+ const params = {
|
|
|
+ group: row, classId: classId, groupIds: (this.round.groupIds && this.round.groupIds.split(',')) || [],
|
|
|
+ parentQuery: this.parentQuery
|
|
|
}
|
|
|
const path = '/elective/dispatch/detail'
|
|
|
this.transferTo(path, params)
|
|
@@ -193,9 +201,9 @@ export default {
|
|
|
}
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
-.btn-class{
|
|
|
+.btn-class {
|
|
|
margin-right: 10px;
|
|
|
cursor: pointer;
|
|
|
- border-bottom:1px solid #42b983;
|
|
|
+ border-bottom: 1px solid #42b983;
|
|
|
}
|
|
|
</style>
|