zhaccount.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <template>
  2. <view class="zhbox">
  3. <view class="pfixed">
  4. <tab-list :tablist='tablist' :tabbtn="tabbtn" :tabidx="tabidx" @getCheck="goCheck" @getroleFn="getroleFn"></tab-list>
  5. </view>
  6. <sh-list :datalist='list' :zhtype="zhtype" :wtdt="wtdt" @getDel="getDel" @getPass='getPass' @getSefuse="getSefuse"></sh-list>
  7. <pop-up :type="type" @getyjSubmit="getyjSubmit" @getClose="getClose"></pop-up>
  8. </view>
  9. </template>
  10. <script>
  11. import tabList from "@/components/toptab/tab.vue"
  12. import shList from "@/components/shlist/list.vue"
  13. import popUp from "@/components/popup/popup.vue"
  14. // 暂放
  15. import {getschoollistFn,getshyjFn,getteacherlistFn,getparentslistFn,getteacherdelFn,getstudentdelFn} from '@/api/mine/register.js'
  16. export default {
  17. components:{
  18. tabList,shList,popUp
  19. },
  20. // limt:'register:teacher:list'
  21. data(){
  22. return{
  23. sucimg:require("@/mine/static/mine/success.png"),
  24. tabbtn:false,
  25. tabidx:0,
  26. tablist:[{tit:'全部',val:0},{tit:'待审',val:1},{tit:'已审',val:2},{tit:'已拒绝',val:3,}],
  27. list:[],
  28. pageSize: 10,
  29. pageNum: 1,
  30. reachflag:true,
  31. type:0,
  32. wtdt:'',
  33. zhtype:'3',//1:学校注册,2:老师注册,3:家长注册,4:调课
  34. dataId:'',//选择的哪个
  35. }
  36. },
  37. onLoad: function() {
  38. //判断角色】
  39. var choseroles=this.$store.state.user.choseroles;
  40. if(choseroles=='teacher'){
  41. this.zhtype=3;
  42. this.schoolId=this.$store.state.user.schoolId;
  43. this.teacherId=this.$store.state.user.userId;
  44. }else if(choseroles=='school'){
  45. this.teacherId='';
  46. this.zhtype=2;
  47. this.schoolId=this.$store.state.user.deptId
  48. }
  49. this.getDataFn()
  50. },
  51. onReachBottom() {
  52. if (this.reachflag) {
  53. this.pageNum++
  54. this.getDataFn()
  55. }
  56. },
  57. methods:{
  58. goCheck(data){
  59. this.tabidx=data;
  60. this.reachflag=true;
  61. this.pageNum=1;
  62. this.list=[];
  63. this.getDataFn()
  64. },
  65. getroleFn(){
  66. if(this.zhtype==2){
  67. this.zhtype=3;
  68. uni.setNavigationBarTitle({title: '家长注册审核' })
  69. }else{
  70. this.zhtype=2;
  71. uni.setNavigationBarTitle({title: '老师注册审核'})
  72. }
  73. this.reachflag=true;
  74. this.pageNum=1;
  75. this.list=[];
  76. this.getDataFn();
  77. },
  78. getClose(){
  79. this.type=0
  80. },
  81. getPass(data){
  82. var params={
  83. dataId:data,
  84. type:this.zhtype,
  85. shjg:2,
  86. shyj:''
  87. }
  88. var that=this;
  89. getshyjFn(params).then(res=>{
  90. if(res.code==200){
  91. this.$toast('审核成功')
  92. setTimeout(function(){
  93. that.pageNum=1;
  94. that.reachflag=true;
  95. that.list=[];
  96. that.type=0;
  97. that.getDataFn()
  98. },1500)
  99. }else{
  100. this.$toast(res.msg)
  101. }
  102. })
  103. },
  104. getDel(data){
  105. var idx=data;
  106. var that=this;
  107. if(this.zhtype==2){
  108. getteacherdelFn(data).then(res=>{
  109. if(res.code==200){
  110. that.$toast('删除成功')
  111. setTimeout(function(){
  112. that.pageNum=1;
  113. that.reachflag=true;
  114. that.list=[];
  115. that.getDataFn()
  116. },1500)
  117. }else{
  118. that.$toast(res.msg)
  119. }
  120. })
  121. }else{
  122. getstudentdelFn(data).then(res=>{
  123. if(res.code==200){
  124. that.$toast('删除成功')
  125. setTimeout(function(){
  126. that.pageNum=1;
  127. that.reachflag=true;
  128. that.list=[];
  129. that.getDataFn()
  130. },1500)
  131. }else{
  132. that.$toast(res.msg)
  133. }
  134. })
  135. }
  136. },
  137. getSefuse(data){
  138. this.type=6;
  139. this.dataId=data;
  140. },
  141. getyjSubmit(e){
  142. var params={
  143. dataId:this.dataId,
  144. type:this.zhtype,
  145. shjg:3,
  146. shyj:e
  147. }
  148. var that=this;
  149. getshyjFn(params).then(res=>{
  150. if(res.code==200){
  151. this.$toast('审核成功')
  152. setTimeout(function(){
  153. that.pageNum=1;
  154. that.reachflag=true;
  155. that.list=[];
  156. that.type=0;
  157. that.getDataFn()
  158. },1500)
  159. }else{
  160. that.$toast(res.msg)
  161. }
  162. })
  163. },
  164. getDataFn(){
  165. var params={
  166. pageSize:this.pageSize,
  167. pageNum: this.pageNum,
  168. }
  169. if(this.tabidx>0){
  170. params.isPass=this.tabidx
  171. }
  172. if(this.zhtype==2){//老师
  173. //学校id
  174. params.schoolId=this.schoolId
  175. getteacherlistFn(params).then(res=>{
  176. if(res.code==200){
  177. if (res.rows.length < this.pageSize) {
  178. this.reachflag = false
  179. this.wtdt = '到底了~';
  180. } else {
  181. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  182. if (num < res.total) {
  183. this.reachflag = true
  184. this.wtdt = '上拉加载更多'
  185. } else {
  186. this.reachflag = false
  187. this.wtdt = '到底了~';
  188. }
  189. }
  190. if (this.pageNum == 1) {
  191. this.list = res.rows;
  192. } else {
  193. this.list = this.list.concat(res.rows)
  194. }
  195. }else{
  196. this.$toast(res.msg)
  197. }
  198. })
  199. }else{//家长
  200. // 老师id
  201. params.schoolId=this.schoolId
  202. params.teacherId=this.teacherId;
  203. getparentslistFn(params).then(res=>{
  204. if(res.code==200){
  205. if (res.rows.length < this.pageSize) {
  206. this.reachflag = false
  207. this.wtdt = '到底了~';
  208. } else {
  209. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  210. if (num < res.total) {
  211. this.reachflag = true
  212. this.wtdt = '上拉加载更多'
  213. } else {
  214. this.reachflag = false
  215. this.wtdt = '到底了~';
  216. }
  217. }
  218. if (this.pageNum == 1) {
  219. this.list = res.rows;
  220. } else {
  221. this.list = this.list.concat(res.rows)
  222. }
  223. }else{
  224. this.$toast(res.msg)
  225. }
  226. })
  227. }
  228. },
  229. },
  230. }
  231. </script>
  232. <style lang="scss" scoped>
  233. .zhbox{padding:132rpx 36rpx 32rpx;}
  234. </style>