123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <template>
- <view class="box">
-
- <loading></loading>
- </view>
- </template>
- <script>
- import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
- import {getDictionaryFn} from "@/api/mine/register.js"
- export default {
- components:{},
- data(){
- return{
- list:[],
- pageSize: 10,
- pageNum: 1,
- reachflag: true,
- wtdt:'',
- }
- },
- onShow() {
-
- },
- onUnload() {
- uni.$off('refreshInfoAll')
- },
- onLoad: function() {
- uni.$on('refreshInfoAll',(res)=>{
- this.getrefreshData()
- })
- // this.init();
- // this.getDataFn()
- },
- // 上拉触底加载更多触发事件
- onReachBottom() {
- if (this.reachflag) {
- this.pageNum++
- this.getDataFn()
- }
- },
- methods:{
- checkPermi,checkRole,
- init(){
- //工单类型
- getDictionaryFn('work_order_type').then(res => {
- if (res.code == 200) {
- this.gdList = res.data.map(v => {
- return {
- dictLabel: v.dictLabel,
- dictValue: v.dictValue
- }
- })
- }
- })
- },
- getTab(val){
- this.tabval=val;
- this.getrefreshData()
- },
- getrefreshData(){
- this.pageNum=1;
- this.list=[];
- this.reachflag=true;
- this.getDataFn()
- },
- getDetail(e){
- this.$tab.navigateTo(`/work/pages/detail?id=${e}`)
- },
- getDataFn(){
- var params={
- pageSize:this.pageSize,
- pageNum: this.pageNum,
- }
- getworkInfoList(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>
- </style>
|