|
|
|
|
@ -87,7 +87,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-select v-model="siteData" @change="changeSite" multiple collapse-tags placeholder="请选择预约场地" clearable style="width:100%">
|
|
|
|
|
<el-option v-for="item in site_options" :key="item.id" :label="item.real_name" :value="item.id">
|
|
|
|
|
<el-option v-for="item in site_options" :key="item.id" :label="item.show_name" :value="item.id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
@ -177,7 +177,8 @@
|
|
|
|
|
status: 1,
|
|
|
|
|
reason: ''
|
|
|
|
|
},
|
|
|
|
|
loading: false,
|
|
|
|
|
loading: false,
|
|
|
|
|
allUser:[],
|
|
|
|
|
user_options: [],
|
|
|
|
|
site_options: [],
|
|
|
|
|
course_options: [],
|
|
|
|
|
@ -205,7 +206,7 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
created() {
|
|
|
|
|
this.getCourseList()
|
|
|
|
|
this.getUserList('')
|
|
|
|
|
this.getSites()
|
|
|
|
|
@ -252,15 +253,19 @@
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (this.type === 'more') {
|
|
|
|
|
if (this.type === 'more') {
|
|
|
|
|
console.log("this.form.user_id",this.form.user_id)
|
|
|
|
|
let _arr = []
|
|
|
|
|
if (this.base.isNull(this.form.user_id)) {
|
|
|
|
|
this.user_options.map(item => {
|
|
|
|
|
this.allUser.map(item => {
|
|
|
|
|
_arr.push(item.id)
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
_arr = this.user_options.filter(item => !this.form.user_id.includes(item.id))
|
|
|
|
|
_arr = _arr.map(item => item.id)
|
|
|
|
|
let _filterarr = this.allUser.filter(item => !this.form.user_id.includes(item.id))
|
|
|
|
|
console.log("_filterarr",_filterarr)
|
|
|
|
|
_filterarr.map(item => {
|
|
|
|
|
_arr.push(item.id)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
console.log("_arr", _arr)
|
|
|
|
|
if(_arr.length===0){
|
|
|
|
|
@ -268,7 +273,8 @@
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.form.user_id = _arr.join(",")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// return
|
|
|
|
|
if (this.type === "editor") {
|
|
|
|
|
this.form.status = 0
|
|
|
|
|
}
|
|
|
|
|
@ -340,19 +346,31 @@
|
|
|
|
|
remoteMethod(query) {
|
|
|
|
|
if (query !== '') {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
this.getUserList(query)
|
|
|
|
|
} else {
|
|
|
|
|
this.user_options = [];
|
|
|
|
|
this.remoteUserList(query)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async remoteUserList(query) {
|
|
|
|
|
const res = await indexStudy({
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 300,
|
|
|
|
|
name: query,
|
|
|
|
|
course_id: this.form.course_id,
|
|
|
|
|
})
|
|
|
|
|
this.user_options = res.list.data
|
|
|
|
|
if(res.list.data===0){
|
|
|
|
|
this.$Message.warning("当前搜索没有学员")
|
|
|
|
|
}
|
|
|
|
|
this.loading = false
|
|
|
|
|
},
|
|
|
|
|
async getUserList(query) {
|
|
|
|
|
const res = await indexStudy({
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 99,
|
|
|
|
|
page_size: 300,
|
|
|
|
|
name: query,
|
|
|
|
|
course_id: this.form.course_id,
|
|
|
|
|
})
|
|
|
|
|
this.user_options = res.list.data
|
|
|
|
|
this.allUser = res.list.data
|
|
|
|
|
if(this.user_options.length===0){
|
|
|
|
|
this.$Message.warning("当前搜索没有学员")
|
|
|
|
|
}
|
|
|
|
|
@ -368,6 +386,9 @@
|
|
|
|
|
value: 1
|
|
|
|
|
}]
|
|
|
|
|
})
|
|
|
|
|
res.data.map(item=>{
|
|
|
|
|
item.show_name = item.content?`${item.real_name}(${item.content})`:item.real_name
|
|
|
|
|
})
|
|
|
|
|
this.site_options = res.data
|
|
|
|
|
},
|
|
|
|
|
changeCourse(e) {
|
|
|
|
|
|