|
@@ -26,7 +26,11 @@
|
|
|
<!-- <u-form-item label="体验日期" placeholder="请选择体验日期" prop="experience">
|
|
|
<u-input v-model="subscribelForm.experience" :select-open="experienceShow" type="select" @click="experienceShow = true" />
|
|
|
</u-form-item> -->
|
|
|
- <u-form-item label="上课教练" placeholder="请选择上课教练" prop="coachName">
|
|
|
+ <u-form-item label="上课教练" placeholder="请选择上课教练" prop="coachName" v-if="subscribelForm.classId==0">
|
|
|
+ <u-search placeholder="请输入教练名" v-model="subscribelForm.coachName" focus :animation="false" @custom='handleCoachListShow' @search='handleCoachListShow' @clear="clear"/>
|
|
|
+ <!--<u-input v-if="!subscribelForm.experience" v-model="subscribelForm.coachName" type="select" @click="handleCoachListShow" />-->
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item v-else label="上课教练" placeholder="请选择上课教练" prop="coachName">
|
|
|
<u-input v-if="!subscribelForm.experience" v-model="subscribelForm.coachName" type="select" @click="handleCoachListShow" />
|
|
|
<text v-else>{{ subscribelForm.coachName }}</text>
|
|
|
</u-form-item>
|
|
@@ -125,6 +129,7 @@
|
|
|
NET.request(API.getClassListByVenueId, { id:this.venueId }, 'POST').then(res => {
|
|
|
if(res.status === 10000) {
|
|
|
this.classList = res.data.map( item => { return { id: item.id, text: item.name } })
|
|
|
+ this.classList = this.classList.reverse()
|
|
|
this.subscribelForm.coachId = ''
|
|
|
this.subscribelForm.coachName = ''
|
|
|
} else {
|
|
@@ -144,17 +149,37 @@
|
|
|
handleCoachListShow() {
|
|
|
this.coachList = []
|
|
|
this.coachShow = true
|
|
|
- // 教练列表
|
|
|
- NET.request(API.getCoachList, {venueId: this.venueId, classId: this.subscribelForm.classId }, 'POST').then(res=> {
|
|
|
- if(res.status == 10000) {
|
|
|
- this.coachList = res.data.map( item => { return { id: item.coachId, text: item.nickname }})
|
|
|
- } else {
|
|
|
- this.$refs.uTips.show({
|
|
|
- title: res.message,
|
|
|
- type: 'error',
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ if(this.subscribelForm.classId==0){
|
|
|
+ // 教练列表
|
|
|
+ NET.request(API.getCoachListAll, {}, 'GET').then(res=> {
|
|
|
+ if(res.status == 10000) {
|
|
|
+ var coachSearch = res.data.filter((item) => {
|
|
|
+ return item.nickname.indexOf(this.subscribelForm.coachName)>-1;
|
|
|
+ });
|
|
|
+ this.coachList = coachSearch.map( item => {
|
|
|
+ return { id: item.coachId, text: item.nickname }
|
|
|
+ })
|
|
|
+ console.log(this.coachList)
|
|
|
+ } else {
|
|
|
+ this.$refs.uTips.show({
|
|
|
+ title: res.message,
|
|
|
+ type: 'error',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ // 教练列表
|
|
|
+ NET.request(API.getCoachList, {venueId: this.venueId, classId: this.subscribelForm.classId }, 'POST').then(res=> {
|
|
|
+ if(res.status == 10000) {
|
|
|
+ this.coachList = res.data.map( item => { return { id: item.coachId, text: item.nickname }})
|
|
|
+ } else {
|
|
|
+ this.$refs.uTips.show({
|
|
|
+ title: res.message,
|
|
|
+ type: 'error',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
// 选择教练
|
|
|
HandleChooseCoachClick(index) {
|