123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- <template>
- <view class="zhbox">
- <view class="pfixed"><tab-list :tablist='tablist' :tabidx="tabidx" @getCheck="goCheck" ></tab-list></view>
- <sh-list :datalist='list' :zhtype="zhtype" :userId="userId" :wtdt="wtdt" :subject="subject" :week="week" @getDel="getDel" @getPass='getPass' @getSefuse="getSefuse" @getUpdate="getUpdate"></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 {getshyjFn,getDictionaryFn} from '@/api/mine/register.js'
- import {getChangelistFn,getChangereplyFn,getChangeDelFn} from "@/api/work/index.js"
- export default {
- components:{
- tabList,shList,popUp
- },
- data(){
- return{
- sucimg:require("@/mine/static/mine/success.png"),
- tabidx:0,
- tablist:[{tit:'全部',val:0},{tit:'待审',val:1},{tit:'已审',val:2},{tit:'已拒绝',val:3,}],
- list:[],
- pageSize: 10,
- pageNum: 1,
- reachflag:true,
- wtdt:'',
- type:0,
- zhtype:4,
- subject:[],
- week:[],
- datain:'',
- userId:this.$store.state.user.userId,
- schoolId:'',
- }
- },
- onUnload(){
- uni.$off('refreshdatalis')
- },
- onLoad: function() {
- uni.$on('refreshdatalis',(e) => {
- this.reachflag=true;
- this.pageNum=1;
- this.list=[];
- this.getDataFn();
- })
- var choseroles=this.$store.state.user.choseroles;
- this.roles=choseroles;
- if(choseroles=='school'){
- this.schoolId=this.$store.state.user.deptId
- }else{
- this.schoolId=this.$store.state.user.schoolId
- }
- this.getDataFn();
- this.init()
- },
- onReachBottom() {
- if (this.reachflag) {
- this.pageNum++
- this.getDataFn()
- }
- },
- methods:{
- getClose(){
- this.type=0
- },
- init(){
- // 学科
- getDictionaryFn('sys_subject').then(res=>{
- if(res.code==200){
- this.subject = res.data.map(v => {
- return {
- dictLabel: v.dictLabel,
- dictValue: v.dictValue
- }
- })
- }
- })
- // 星期
- getDictionaryFn('sys_week').then(res=>{
- if(res.code==200){
- this.week = res.data.map(v => {
- return {
- dictLabel: v.dictLabel,
- dictValue: v.dictValue
- }
- })
- }
- })
- },
- getUpdate(data){
- this.$tab.navigateTo(`/work/pages/examine/applyclass?id=${data}&pagetype='update'`)
- },
- getPass(data){
- var params={
- id:data.id,
- isPass:2,
- "subjectClassId":data.subjectClassId,
- "beSubject":data.beSubject,
- opinion:''
- }
- var that=this;
- getChangereplyFn(params).then(res=>{
- if(res.code==200){
- this.$toast('审核成功')
- setTimeout(function(){
- that.pageNum=1;
- that.reachflag=true;
- that.list=[];
- that.getDataFn();
- that.type=0;
- },1500)
- }else{
- that.type=0;
- this.$toast(res.msg)
- }
- })
- },
- getDel(data){
- var idx=data.id;
- var that=this;
- getChangeDelFn(data.id).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.datain=data;
- },
- getyjSubmit(e){
- var params={
- id:this.datain.id,
- isPass:3,
- "subjectClassId":this.datain.subjectClassId,
- "beSubject":this.datain.beSubject,
- opinion:e
- }
- var that=this;
- getChangereplyFn(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.type=0;
- this.$toast(res.msg)
- }
- })
- },
- goCheck(data){
- this.tabidx=data;
- this.reachflag=true;
- this.pageNum=1;
- this.list=[];
- this.getDataFn()
- },
- getDataFn(){
- var params={
- pageSize:this.pageSize,
- pageNum: this.pageNum,
- schoolId:this.schoolId
- }
- if(this.tabidx>0){
- params.isPass=this.tabidx
- }
- getChangelistFn(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>
|