#
whycq
2023-11-24 e912cf2fa42c9df789cc276bb9e9926ec269530e
pages/business/goBusiness/reimburseOnline.vue
@@ -54,7 +54,10 @@
               type: 'user_id'
            },
            falg: true,
            list: []
            list: [],
            curr: 2,
            reload: false,
            status: 'more',
         }
      },
      onShow() {
@@ -69,10 +72,106 @@
            this.getDetail()
         }
         setTimeout(()=> {
            this.getReimburseOnline()
            this.getReimburseOnline1()
         },50)
      },
      onReachBottom() {
         this.status = 'more';
         this.getReimburseOnline()
      },
      methods: {
         getReimburseOnline1() {
            let _this = this
            _this.list = []
            uni.showLoading({})
            let param = {curr:1,limit:8,dept_id: 0,user_id: 67}
            if (_this.user.type == 'user_id') {
               param = {curr:1,limit:8,user_id: _this.user.id}
            } else if(_this.user.type == 'dept_id') {
               param = {curr:1,limit:8,dept_id: _this.user.id}
            } else {
               param = {curr:1,limit:8}
            }
            uni.request({
               url: `${_this.baseUrl}/reimburseOnline/list/auth`,
               header: { 'token': uni.getStorageSync('token') },
               data: param,
               success(res) {
                  res = res.data
                  if (res.code === 200) {
                     for (let k of res.data.records) {
                        if (k.settle == 3) {
                           k['bgcolor'] = 'color: #12d489'
                        } else if (k.settle == 2) {
                           k['bgcolor'] = 'color: #ffbd67'
                        }
                     }
                     let list = res.data.records
                     _this.list = _this.reload ? list : _this.list.concat(list);
                     if (res.data.records.length == 0) {
                        _this.status = 'noMore'
                     }
                  }
               },
               fail(result) {
                  uni.showToast({title: '请求失败'})
                  setTimeout(() => {
                     uni.reLaunch({
                        url: '../../login/login'
                     });
                  }, 1000);
               },
               complete() {
                  uni.hideLoading()
               }
            })
         },
         getReimburseOnline() {
            let _this = this
            uni.showLoading({})
            let param = {curr:_this.curr,limit:8,dept_id: 0,user_id: 67}
            if (this.user.type == 'user_id') {
               param = {curr:_this.curr,limit:8,user_id: _this.user.id}
            } else if(this.user.type == 'dept_id') {
               param = {curr:_this.curr,limit:8,dept_id: _this.user.id}
            } else {
               param = {curr:_this.curr,limit:8}
            }
            uni.request({
               url: `${_this.baseUrl}/reimburseOnline/list/auth`,
               header: { 'token': uni.getStorageSync('token') },
               data: param,
               success(res) {
                  res = res.data
                  if (res.code === 200) {
                     for (let k of res.data.records) {
                        if (k.settle == 3) {
                           k['bgcolor'] = 'color: #12d489'
                        } else if (k.settle == 2) {
                           k['bgcolor'] = 'color: #ffbd67'
                        }
                     }
                     let list = res.data.records
                     _this.list = _this.reload ? list : _this.list.concat(list);
                     _this.curr = _this.curr + 1
                     if (res.data.records.length == 0) {
                        _this.status = 'noMore'
                     }
                  }
               },
               fail(result) {
                  uni.showToast({title: '请求失败'})
                  setTimeout(() => {
                     uni.reLaunch({
                        url: '../../login/login'
                     });
                  }, 1000);
               },
               complete() {
                  uni.hideLoading()
               }
            })
         },
         async getDetail() {
            let res = await user.getDetail()
            if (res.code === 200) {
@@ -100,38 +199,6 @@
                  res.eventChannel.emit('busunessDetl', {
                     data: e
                  })
               }
            })
         },
         getReimburseOnline() {
            let _this = this
            let param = {curr:1,limit:16,dept_id: 0,user_id: 67}
            if (_this.user.type == 'user_id') {
               param = {curr:1,limit:16,user_id: _this.user.id}
            } else if(_this.user.type == 'dept_id') {
               param = {curr:1,limit:16,dept_id: _this.user.id}
            } else {
               param = {curr:1,limit:16}
            }
            uni.request({
               url: `${_this.baseUrl}/reimburseOnline/list/auth`,
               header: { 'token': uni.getStorageSync('token') },
               data: param,
               success(res) {
                  console.log(res);
                  res = res.data
                  if (res.code === 200) {
                     for (let k of res.data.records) {
                        if (k.settle == 3) {
                           k['bgcolor'] = 'color: #12d489'
                        } else if (k.settle == 2) {
                           k['bgcolor'] = 'color: #ffbd67'
                        }
                     }
                     _this.list = res.data.records
                     // console.log(_this.list);
                  }
                  // _this.list =
               }
            })
         },