|
@@ -7,11 +7,14 @@
|
|
|
|
|
|
<el-card v-if="queryParams.roundId">
|
|
|
<div>
|
|
|
- <div class="fx-row jc-between mb10">
|
|
|
- <el-button type="primary" @click="keepAll">一键维持原班级</el-button>
|
|
|
- <el-button type="primary" @click="send">发送名单</el-button>
|
|
|
+ <div>
|
|
|
+ <div v-if="round.allowDispatch && !round.dispatchCompleted" class="fx-row jc-between mb10">
|
|
|
+ <el-button type="primary" @click="keepAll">一键维持原班级</el-button>
|
|
|
+ <el-button type="primary" @click="send">发送名单</el-button>
|
|
|
+ </div>
|
|
|
+ <p class="text-right mt5 mb5 f14 mr5" v-if="round.dispatchCompleted">班主任分班完成,在 {{settings.activeDate}} 生效</p>
|
|
|
</div>
|
|
|
- <mx-table :propDefines="propDefines" :rows="formatRows">
|
|
|
+ <mx-table :propDefines="propDefines" :rows="formatRows" >
|
|
|
<template #temp="{row}">
|
|
|
<el-popover
|
|
|
placement="bottom"
|
|
@@ -19,7 +22,7 @@
|
|
|
<span class="btn-green mr5" @click="changeMaster(row)">班主任</span>
|
|
|
<span class="btn-green" v-if="!!row.headteacherName" @click="changeClass(row)">班级</span>
|
|
|
|
|
|
- <el-button type="primary" slot="reference" size="mini">更换</el-button>
|
|
|
+ <el-button type="primary" slot="reference" size="mini">更换</el-button>
|
|
|
</el-popover>
|
|
|
</template>
|
|
|
<template #cancel="{row}">
|
|
@@ -41,7 +44,7 @@ import {
|
|
|
keepAllOfTeacher,
|
|
|
getPublish,
|
|
|
saveTeacherSettings,
|
|
|
- lockPublishTeachers
|
|
|
+ getRound
|
|
|
} from '@/api/webApi/elective/dispatch'
|
|
|
import ChooseMasterTeacher from './components/choose-master-teacher'
|
|
|
import classTreeMixin from '@/components/Cache/modules/mx-classTree-translate-mixin'
|
|
@@ -57,7 +60,24 @@ export default {
|
|
|
mixins: [classTreeMixin],
|
|
|
data() {
|
|
|
return {
|
|
|
- propDefines: {
|
|
|
+
|
|
|
+ round: {},
|
|
|
+ requireFields: ['year', 'roundId'],
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ total: '',
|
|
|
+ year: '',
|
|
|
+ roundId: ''
|
|
|
+ },
|
|
|
+ settings: {}, // 分班时间配置
|
|
|
+ headteacherSettings: null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ propDefines() {
|
|
|
+ if(!this.round) return {}
|
|
|
+ return {
|
|
|
year: {
|
|
|
label: '学年'
|
|
|
},
|
|
@@ -69,7 +89,8 @@ export default {
|
|
|
},
|
|
|
temp: {
|
|
|
label: '确认班主任',
|
|
|
- slot: 'temp'
|
|
|
+ slot: 'temp',
|
|
|
+ hidden:this.round.dispatchCompleted
|
|
|
},
|
|
|
newClassName: {
|
|
|
label: '新班级号'
|
|
@@ -79,22 +100,11 @@ export default {
|
|
|
},
|
|
|
cancel: {
|
|
|
label: '操作',
|
|
|
- slot: 'cancel'
|
|
|
+ slot: 'cancel',
|
|
|
+ hidden:this.round.dispatchCompleted
|
|
|
}
|
|
|
- },
|
|
|
- requireFields: ['year', 'roundId'],
|
|
|
- queryParams: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 20,
|
|
|
- total: '',
|
|
|
- year: '',
|
|
|
- roundId: ''
|
|
|
- },
|
|
|
- settings: {}, // 分班时间配置
|
|
|
- headteacherSettings: null
|
|
|
- }
|
|
|
- },
|
|
|
- computed: {
|
|
|
+ }
|
|
|
+ },
|
|
|
formatRows() {
|
|
|
if (!this.classTree.length) return []
|
|
|
if (!this.headteacherSettings) return []
|
|
@@ -149,11 +159,20 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
send() {
|
|
|
- const headteacherSettings = Object.values(this.headteacherSettings)
|
|
|
+ const headteacherSettings = Object.values(this.headteacherSettings).map(item => {
|
|
|
+ return item.customerCode
|
|
|
+ })
|
|
|
if (headteacherSettings.length < this.classList.length) {
|
|
|
this.$message.warning('还有班级未分配新班主任和新班级号')
|
|
|
return
|
|
|
}
|
|
|
+ console.log(headteacherSettings)
|
|
|
+ // 验证重复
|
|
|
+ if((new Set(headteacherSettings)).size != headteacherSettings.length) {
|
|
|
+ this.$message.warning('有重复的班主任,请先校验好再发布')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
this.$Dialog('DispatchMaster',{
|
|
|
settings: this.settings
|
|
|
},(val) => {
|
|
@@ -178,12 +197,22 @@ export default {
|
|
|
},
|
|
|
handleQuery() {
|
|
|
// 获取班主任 settings
|
|
|
+ this.getRound()
|
|
|
this.getHeadteacherSettings()
|
|
|
this.getPublish()
|
|
|
},
|
|
|
changeMaster(row) {
|
|
|
this.$refs.chooseMasterTeacher.init(row)
|
|
|
},
|
|
|
+ // 获取批次的组合
|
|
|
+ getRound() {
|
|
|
+ getRound({
|
|
|
+ year:this.queryParams.year,
|
|
|
+ round:this.queryParams.roundId,
|
|
|
+ }).then(res => {
|
|
|
+ this.round = res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
changeClass(row) {
|
|
|
this.$refs.chooseClass.init(row)
|
|
|
},
|