123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- <template>
- <view class="zhbox">
- <view class="pfixed">
- <tab-list :tablist='tablist' :tabbtn="tabbtn" :tabidx="tabidx" @getCheck="goCheck" @getroleFn="getroleFn"></tab-list>
- </view>
- <sh-list :datalist='list' :zhtype="zhtype" :wtdt="wtdt" @getDel="getDel" @getPass='getPass' @getSefuse="getSefuse"></sh-list>
- <pop-up :type="type" @getyjSubmit="getyjSubmit" @getClose="getClose"></pop-up>
- </view>
- </template>
- <script>
- import tabList from "@/components/toptab/tab.vue"
- import shList from "@/components/shlist/list.vue"
- import popUp from "@/components/popup/popup.vue"
- // 暂放
- import {getschoollistFn,getshyjFn,getteacherlistFn,getparentslistFn,getteacherdelFn,getstudentdelFn} from '@/api/mine/register.js'
- export default {
- components:{
- tabList,shList,popUp
- },
- // limt:'register:teacher:list'
- data(){
- return{
- sucimg:require("@/mine/static/mine/success.png"),
- tabbtn:false,
- tabidx:0,
- tablist:[{tit:'全部',val:0},{tit:'待审',val:1},{tit:'已审',val:2},{tit:'已拒绝',val:3,}],
- list:[],
- pageSize: 10,
- pageNum: 1,
- reachflag:true,
- type:0,
- wtdt:'',
- zhtype:'3',//1:学校注册,2:老师注册,3:家长注册,4:调课
- dataId:'',//选择的哪个
- }
- },
- onLoad: function() {
- //判断角色】
- var choseroles=this.$store.state.user.choseroles;
- if(choseroles=='teacher'){
- this.zhtype=3;
- this.schoolId=this.$store.state.user.schoolId;
- this.teacherId=this.$store.state.user.userId;
-
- }else if(choseroles=='school'){
- this.teacherId='';
- this.zhtype=2;
- this.schoolId=this.$store.state.user.deptId
- }
- this.getDataFn()
- },
- onReachBottom() {
- if (this.reachflag) {
- this.pageNum++
- this.getDataFn()
- }
- },
- methods:{
- goCheck(data){
- this.tabidx=data;
- this.reachflag=true;
- this.pageNum=1;
- this.list=[];
- this.getDataFn()
- },
- getroleFn(){
- if(this.zhtype==2){
- this.zhtype=3;
- uni.setNavigationBarTitle({title: '家长注册审核' })
- }else{
- this.zhtype=2;
- uni.setNavigationBarTitle({title: '老师注册审核'})
- }
- this.reachflag=true;
- this.pageNum=1;
- this.list=[];
- this.getDataFn();
-
- },
- getClose(){
- this.type=0
- },
- getPass(data){
- var params={
- dataId:data,
- type:this.zhtype,
- shjg:2,
- shyj:''
- }
- var that=this;
- getshyjFn(params).then(res=>{
- if(res.code==200){
- this.$toast('审核成功')
- setTimeout(function(){
- that.pageNum=1;
- that.reachflag=true;
- that.list=[];
- that.type=0;
- that.getDataFn()
- },1500)
- }else{
- this.$toast(res.msg)
- }
- })
- },
- getDel(data){
- var idx=data;
- var that=this;
- if(this.zhtype==2){
- getteacherdelFn(data).then(res=>{
- if(res.code==200){
- that.$toast('删除成功')
- setTimeout(function(){
- that.pageNum=1;
- that.reachflag=true;
- that.list=[];
- that.getDataFn()
- },1500)
- }else{
- that.$toast(res.msg)
- }
- })
- }else{
- getstudentdelFn(data).then(res=>{
- if(res.code==200){
- that.$toast('删除成功')
- setTimeout(function(){
- that.pageNum=1;
- that.reachflag=true;
- that.list=[];
- that.getDataFn()
- },1500)
- }else{
- that.$toast(res.msg)
- }
- })
- }
- },
- getSefuse(data){
- this.type=6;
- this.dataId=data;
- },
- getyjSubmit(e){
- var params={
- dataId:this.dataId,
- type:this.zhtype,
- shjg:3,
- shyj:e
- }
- var that=this;
- getshyjFn(params).then(res=>{
- if(res.code==200){
- this.$toast('审核成功')
- setTimeout(function(){
- that.pageNum=1;
- that.reachflag=true;
- that.list=[];
- that.type=0;
- that.getDataFn()
- },1500)
- }else{
- that.$toast(res.msg)
- }
- })
- },
- getDataFn(){
- var params={
- pageSize:this.pageSize,
- pageNum: this.pageNum,
- }
- if(this.tabidx>0){
- params.isPass=this.tabidx
- }
- if(this.zhtype==2){//老师
- //学校id
- params.schoolId=this.schoolId
- getteacherlistFn(params).then(res=>{
- if(res.code==200){
- if (res.rows.length < this.pageSize) {
- this.reachflag = false
- this.wtdt = '到底了~';
- } else {
- var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
- if (num < res.total) {
- this.reachflag = true
- this.wtdt = '上拉加载更多'
- } else {
- this.reachflag = false
- this.wtdt = '到底了~';
- }
- }
- if (this.pageNum == 1) {
- this.list = res.rows;
- } else {
- this.list = this.list.concat(res.rows)
- }
- }else{
- this.$toast(res.msg)
- }
- })
- }else{//家长
- // 老师id
- params.schoolId=this.schoolId
- params.teacherId=this.teacherId;
- getparentslistFn(params).then(res=>{
- if(res.code==200){
- if (res.rows.length < this.pageSize) {
- this.reachflag = false
- this.wtdt = '到底了~';
- } else {
- var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
- if (num < res.total) {
- this.reachflag = true
- this.wtdt = '上拉加载更多'
- } else {
- this.reachflag = false
- this.wtdt = '到底了~';
- }
- }
- if (this.pageNum == 1) {
- this.list = res.rows;
- } else {
- this.list = this.list.concat(res.rows)
- }
- }else{
- this.$toast(res.msg)
- }
- })
- }
-
- },
- },
-
- }
- </script>
- <style lang="scss" scoped>
- .zhbox{padding:132rpx 36rpx 32rpx;}
- </style>
|