Commit e91cbf62 authored by 王's avatar

老师绑定用户

parent fcefa862
......@@ -287,7 +287,8 @@
periods_id:data.periods_id,
show:true,
goods_id:this.goods_id,
title:`${data.teacher_name}班级用户列表`
title:`${data.teacher_name}班级用户列表`,
teacherId: data.teacher_id
}
},
getTeacher(){
......
......@@ -51,7 +51,8 @@
<el-form-item>
<el-button type="primary" @click="searchList">搜索</el-button>
<el-button type="success" @click="changeClass" v-if="!$store.state.readonly">切换班级</el-button>
<el-button type="success" @click="onAddUser" v-if="!$store.state.readonly">+添加用户</el-button>
<el-button type="success" @click="onAddUser(false)" v-if="!$store.state.readonly">+添加用户</el-button>
<el-button type="success" @click="onAddUser(true)" v-if="!$store.state.readonly">老师绑定用户</el-button>
</el-form-item>
</el-form>
<el-table
......@@ -411,7 +412,7 @@
</template>
<script>
import {addClassUesrApi,getClassUserApi,changeUserApi,delClassUserApi,getUserListApi,addPeriodsClassUserDescApi,getClassStatisticsApi,userLookApi,getPeriodsApi,changeClassApi,getClassListApi,addUserTeacherApi,getUserDescListApi,updateUserPrivilegeApi} from "../../service/api";
import {addClassUesrApi,getClassUserApi,changeUserApi,delClassUserApi,getUserListApi,addPeriodsClassUserDescApi,getClassStatisticsApi,userLookApi,getPeriodsApi,changeClassApi,getClassListApi,addUserTeacherApi,getUserDescListApi,updateUserPrivilegeApi,teacherBindUserApi} from "../../service/api";
import page from '../framework/page'
import page2 from '../framework/page'
import pageDesc from '../framework/page'
......@@ -495,7 +496,8 @@
label: '用户主动添加老师',
value: 2
}
]
],
isBindUser: false
}
},
components:{
......@@ -728,6 +730,7 @@
if (!this.addId) {
return
}
if (!this.isBindUser) {
addClassUesrApi(this.userObj.classId,this.addId,json).then(res=>{
this.$message({
type: 'success',
......@@ -736,8 +739,19 @@
this.addShow = false;
this.initPage()
})
} else {
teacherBindUserApi(this.userObj.teacherId, {user_id: this.addId}).then(res=>{
this.$message({
type: 'success',
message: '绑定成功!'
});
this.addShow = false;
})
}
},
onAddUser(){
onAddUser(flag){
this.isBindUser = flag;
this.addShow = true;
this.getUser();
},
......
......@@ -267,7 +267,7 @@
filterable
remote
clearable
placeholder="请输入名称或者手机号"
placeholder="请输入名称"
:remote-method="remoteMethod"
:loading="loading">
<el-option
......
......@@ -477,6 +477,7 @@
}
getUserListApi(json).then(res=>{
this.userList = res.list;
this.userDialog.total = res.total;
})
},
confirmPutForward(){
......@@ -511,7 +512,7 @@
},
onUserPageChange(val){
this.userDialog.nowPage = val
this.getUser()
this.getUserList()
},
onUserSizeChange(val){
this.userDialog.limit = val
......
......@@ -182,7 +182,9 @@ import chooseGoodDialog from './chooseGoodDialog'
this.userObj={
classId:data.id,
show:true,
title:`${this.detail.name}班级用户列表`
title:`${this.detail.name}班级用户列表`,
teacherId: data.teacher_id,
periods_id: data.periods_id
}
},
onPageChange(val){
......
......@@ -409,7 +409,9 @@
this.userObj={
classId:data.class_id,
show:true,
title:`${data.teacher_name}班级用户列表`
title:`${data.teacher_name}班级用户列表`,
teacherId: data.teacher_id,
periods_id: data.periods_id
}
}
},
......
......@@ -739,3 +739,8 @@ const getTeacherDayRankListUrl = 'api/admin/teacher/performance/day';
export const getTeacherDayRankListApi = function (json) {
return Vue.prototype.$fetch(`${getTeacherDayRankListUrl}`,json)
};
// 老师绑定用户
const teacherBindUserUrl = 'api/admin/teacher/bind';
export const teacherBindUserApi = function (id,json) {
return Vue.prototype.$put(`${teacherBindUserUrl}/${id}`, json)
};
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