Commit 4dacfa85 authored by zhengke's avatar zhengke

修改

parent bc5b44c3
......@@ -33,8 +33,19 @@
<div style="margin:10px 0 15px 0;">邀请新学员</div>
</div>
<div class="drop_NameDown">
<q-select dense standout filled v-model="checkedStudent" :options="InvitationOptions"
@filter="filterInvitaFn" emit-value map-options input-debounce="0" use-input option-value="StuId" option-label="StuName" label="选择学员" />
<!-- <q-select dense standout="bg-primary text-white" v-model="checkedStudent" :options="InvitationList"
@filter="filterCourseFn" use-input option-value="StuId" option-label="StuName" label="选择学员" /> -->
<q-select filled stack-label use-input input-debounce="0"
option-value="StuId" option-label="StuName" v-model="checkedStudent"
:options="InvitationList" label="选择学员" :dense="false" emit-value map-options @filter="filterFn">
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-select>
</div>
<q-card-actions align="right" class="bg-white" style="margin-top:20px;">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="ishowInvit=false" />
......@@ -147,8 +158,8 @@
StudentId: 0
},
InvitationList: [], //学员下拉数据
AllInvitationList: [],
checkedStudent: '', //选择学员
InvitationOptions:[]
}
},
created() {
......@@ -159,14 +170,19 @@
this.getStudentList();
},
methods: {
filterInvitaFn(val, update, abort) {
//筛选员工
filterFn(val, update) {
update(() => {
this.InvitationOptions = this.InvitationList.filter(
v => v.StuName.indexOf(val) > -1
);
});
if (val === '') {
this.InvitationList = JSON.parse(JSON.stringify(this.AllInvitationList))
} else {
const needle = val.toLowerCase()
this.InvitationList = this.AllInvitationList.filter(v => v.StuName.toLowerCase().indexOf(needle) > -1)
}
})
},
//获取学员信息
getStudentData() {
this.studentList = [];
......@@ -228,8 +244,12 @@
};
GetStudentList({}).then(res => {
if (res.Code == 1) {
this.InvitationList = res.Data;
this.InvitationOptions = this.InvitationList;
var jsonData = res.Data;
if (jsonData && jsonData.length > 0) {
this.AllInvitationList = JSON.parse(JSON.stringify(jsonData));
this.InvitationList = JSON.parse(JSON.stringify(jsonData));
}
console.log("this.InvitationList",this.InvitationList);
}
})
},
......@@ -243,12 +263,18 @@
})
return;
} else {
let checkedStuObj = {};
this.InvitationList.forEach(x=>{
if(x.StuId==this.checkedStudent){
checkedStuObj=x;
}
})
this.invitationMsg.ClassId = this.setingObj.ClassId;
this.invitationMsg.GuestName = this.checkedStudent.StuName;
this.invitationMsg.Sex = this.checkedStudent.StuSex;
this.invitationMsg.Mobile = this.checkedStudent.StuTel;
this.invitationMsg.BirthDay = this.checkedStudent.StuBirthStr;
this.invitationMsg.StudentId = this.checkedStudent.StuId;
this.invitationMsg.GuestName = checkedStuObj.StuName;
this.invitationMsg.Sex = checkedStuObj.StuSex;
this.invitationMsg.Mobile = checkedStuObj.StuTel;
this.invitationMsg.BirthDay = checkedStuObj.StuBirthStr;
this.invitationMsg.StudentId = checkedStuObj.StuId;
this.invitationMsg.School_Id = this.setingObj.School_Id;
AddClassStudent(this.invitationMsg).then(res => {
if (res.Code == 1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment