|
@@ -23,7 +23,7 @@ export default{
|
|
|
props: {
|
|
|
year:'',
|
|
|
roundId: '',
|
|
|
- headteacherSettings: {} // 已经被选择的
|
|
|
+ headTeacherSettings: {} // 已经被选择的
|
|
|
},
|
|
|
mixins: [MxClassTreeTranslateMixin],
|
|
|
data() {
|
|
@@ -44,16 +44,25 @@ export default{
|
|
|
methods: {
|
|
|
confirm() {
|
|
|
// 判断是否重复?
|
|
|
- const headTeacherSettings = Object.values(this.headTeacherSettings)
|
|
|
- if(this.headteacherSettings.keys())
|
|
|
+ // const headTeacherSettings = Object.values(this.headTeacherSettings)
|
|
|
+ // if(this.headteacherSettings.keys())
|
|
|
// this.saveTeacherSettings()
|
|
|
// this.onClose()
|
|
|
- console.log(this.activeClass)
|
|
|
- console.log(this.value)
|
|
|
- console.log(this.headteacherSettings)
|
|
|
+ if(this.isRepeat()) {
|
|
|
+ this.$message.warning(`${this.activeClass.headteacherName}已分配给新班级`)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.saveTeacherSettings()
|
|
|
+ this.onClose()
|
|
|
+ console.log(this.isRepeat())
|
|
|
},
|
|
|
isRepeat() {
|
|
|
// 判断是否重复?
|
|
|
+ const headTeacherSettings = this.headTeacherSettings
|
|
|
+ const format = Object.values(headTeacherSettings)
|
|
|
+ const activeClass =this.activeClass
|
|
|
+ const flag = format.some(item => { return item.customerCode == activeClass.headteacherCode})
|
|
|
+ return flag
|
|
|
},
|
|
|
onClose() {
|
|
|
this.dialogVisible = false
|
|
@@ -69,9 +78,9 @@ export default{
|
|
|
})
|
|
|
},
|
|
|
enable(row){
|
|
|
- const headteacherSettings = this.headteacherSettings
|
|
|
+ const headTeacherSettings = this.headTeacherSettings
|
|
|
const activeClass = this.activeClass
|
|
|
- return Object.keys(headteacherSettings).findIndex(item => item == row.classId) != -1 && activeClass.classId != row.classId
|
|
|
+ return Object.keys(headTeacherSettings).findIndex(item => item == row.classId) != -1 && activeClass.classId != row.classId
|
|
|
},
|
|
|
init(row){
|
|
|
this.dialogVisible = true
|