123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- <template>
- <view class="yybox">
- <!-- <nav-bar navtit="预约信息" ></nav-bar> -->
- <!-- 主体 -->
- <view class="yydet">
- <view class="yytab flexc">
- <view :class="ite.val==tabval?'act':''" v-for="(ite,idx) in tablist" :key='idx' @click="getTab(ite.val)">{{ite.tit}}</view>
- </view>
- <!-- 列表 -->
- <scroll-view scroll-y class="yylists" lower-threshold="40" @scrolltolower="reach_btn">
- <view class="mt12">
- <y-list type='1' :datalist="list" :wtdt="wtdt" @getDetail='getDetail' :adrlist="adrlist" @getDelFn="getDelFn" @gettypeFn="gettypeFn"></y-list>
- </view>
- </scroll-view>
- </view>
-
- </view>
- </template>
- <script>
- import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
- import yList from "@/components/order/list.vue"
- import navBar from "@/components/toptab/navbar.vue"
- import {getReservatList,getReservatDel,getReservatSh} from "@/api/mine/order.js"
- import {getDictionaryFn} from "@/api/mine/register.js"
- export default {
- components:{yList,navBar},
- data(){
- return{
- navbg:require("@/static/images/navbg.png"),
- headimg:require("@/static/images/order/staff/head.png"),
- listline:require("@/static/images/order/staff/listline.png"),
- backgroundColor: "transparent",
- tabval:'0',
- tablist:[{tit:"全部",val:0},{tit:"未审核",val:1},{tit:"已拒绝",val:2},{tit:"已审核",val:3},],
- list:[],
- adrlist:[],
- wtdt:'',
- pageSize: 10,
- pageNum: 1,
- reachflag: true,
- }
- },
- onPageScroll(e) {
- var scrollTop = Number(e.scrollTop);
- if (scrollTop > 0) {
- this.backgroundColor = '#0491FD'
- } else {
- this.backgroundColor = 'transparent'
- }
- },
- onLoad: function() {
- uni.$on('refreshdatalist',(e) => {
- this.reachflag=true;
- this.pageNum=1;
- this.list=[];
- this.getDataFn();
- })
- this.init()
- this.getDataFn()
-
- },
- onUnload() {
- uni.$off('refreshdatalist')
- },
- methods:{
- checkPermi, checkRole,
- reach_btn(){
- if (this.reachflag) {
- this.pageNum++
- this.getDataFn()
- }
- },
- getTab(val){
- this.tabval=val;
- this.reachflag=true;
- this.pageNum=1;
- this.list=[];
- this.getDataFn();
- },
- init(){
- // 记录来源
- getDictionaryFn('jluly').then(res=>{
- if(res.code==200){
- this.adrlist = res.data.map(v => {
- return {
- dictLabel: v.dictLabel,
- dictValue: Number(v.dictValue)
- }
- })
- }
- })
- },
- getDelFn(id){
- var that=this;
- getReservatDel(id).then(res=>{
- if(res.code==200){
- that.$toast('删除成功')
- setTimeout(function(){
- that.reachflag=true;
- that.pageNum=1;
- that.list=[];
- that.getDataFn();
- // that.getcount();
- },1500)
-
- }else{
- that.$toast(res.msg)
- }
- })
- },
- gettypeFn(ite){
- var that=this;
- var params={
- reservatId:ite.id,
- visitType:ite.type
- }
- getReservatSh(params).then(res=>{
- if(res.code==200){
- that.$toast('审核成功')
- setTimeout(function(){
- that.reachflag=true;
- that.pageNum=1;
- that.list=[];
- that.getDataFn();
- // that.getcount();
- },1500)
-
- }else{
- that.$toast(res.msg)
- }
- })
- },
- getDetail(data){
- this.$tab.navigateTo('/pages/order/staffcode?type=look&id='+data)
- },
- getDataFn(){
- var params={
- pageSize:this.pageSize,
- pageNum: this.pageNum,
- }
- if(this.tabval==0){
-
- }else{
- params.visitType=this.tabval
- }
- getReservatList(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>
- .yytab{height: 80rpx;flex: 0 0 auto;background-color: #ffffff;
- view{flex: 1;display: flex;align-items: center;justify-content: center;height: 80rpx;position: relative;color: #666;
- &.act{color: $com-cd3;
- &::after{content: '';width: 100rpx;height: 6rpx;background: $com-cd3;position: absolute;left: 50%;margin-left: -50rpx;bottom: 0;}
- }
- }
- }
- .yylists{width: 684rpx;margin: 0 auto 0;flex: 1;overflow: auto;}
- </style>
|