| | |
| | | <view class="fxbtn"> |
| | | <uni-icons type="plusempty" color="#fff" @click="gotoggle()" ></uni-icons> |
| | | </view> |
| | | <uni-load-more :status="status" :icon-size="16" :content-text="contentText" /> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | user: { |
| | | username: '', |
| | | id: 0, |
| | | type: 'user_id' |
| | | type: '' |
| | | }, |
| | | falg: true, |
| | | csmtrList: [], |
| | |
| | | name:'平库', |
| | | value: 6 |
| | | }, |
| | | ] |
| | | { |
| | | name:'其他', |
| | | value: 7 |
| | | }, |
| | | ], |
| | | param: {curr:1,limit:4} |
| | | } |
| | | }, |
| | | onLoad() { |
| | |
| | | this.getDetail() |
| | | } |
| | | setTimeout(()=> { |
| | | this.getCsmtr1() |
| | | this.getList() |
| | | },50) |
| | | }, |
| | | onReachBottom() { |
| | |
| | | this.toggle('right') |
| | | }, |
| | | add(val) { |
| | | let addPlan = 'addPlan' |
| | | let addPlan = 'addPlan',_this = this |
| | | if (val > 1) { |
| | | addPlan = 'addPlan' + val |
| | | } |
| | | uni.navigateTo({ |
| | | url:'/pages/business/plan/' + addPlan, |
| | | success() { |
| | | _this.$refs.popup.close() |
| | | } |
| | | }) |
| | | |
| | | |
| | | }, |
| | | toggle(type) { |
| | | this.type = type |
| | | // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 |
| | | this.$refs.popup.open(type) |
| | | }, |
| | | getList() { |
| | | let that = this |
| | | that.csmtrList = [] |
| | | uni.showLoading() |
| | | if (this.user.type == 'user_id') { |
| | | that.param = {curr:1,limit:4,user_id: that.user.id} |
| | | } else if(this.user.type == 'dept_id') { |
| | | that.param = {curr:1,limit:4,dept_id: that.user.id} |
| | | } |
| | | uni.request({ |
| | | url: that.baseUrl + '/plan/page/auth', |
| | | header: {'token' : uni.getStorageSync('token'),}, |
| | | data: that.param, |
| | | method:'GET', |
| | | success(result) { |
| | | console.log(result); |
| | | if (result.statusCode === 404) { |
| | | uni.showToast({title: '请重新登录', icon: "none", position: 'top'}) |
| | | return |
| | | } |
| | | var res = result.data |
| | | if (res.code === 200) { |
| | | let list = res.data.records |
| | | that.csmtrList = that.reload ? list : that.csmtrList.concat(list); |
| | | if (res.data.records.length == 0) { |
| | | that.status = 'noMore' |
| | | } |
| | | } else if (res.code === 403) { |
| | | uni.showToast({title: res.msg, icon: "none", position: 'top'}) |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | | url: '../../login/login' |
| | | }); |
| | | }, 1000); |
| | | } else { |
| | | uni.showToast({title: res.msg, icon: "none",position: 'top'}) |
| | | } |
| | | }, |
| | | fail(result) { |
| | | uni.showToast({title: '请求失败'}) |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | | url: '../../login/login' |
| | | }); |
| | | }, 1000); |
| | | }, |
| | | complete() { |
| | | uni.hideLoading() |
| | | } |
| | | }) |
| | | }, |
| | | getCsmtr1(e) { |
| | | let that = this |
| | | that.csmtrList = [] |
| | | uni.showLoading({}) |
| | | uni.showLoading() |
| | | let param = {curr:1,limit:4,dept_id: 0,user_id: 67} |
| | | if (this.user.type == 'user_id') { |
| | | param = {curr:1,limit:4,user_id: that.user.id} |
| | |
| | | } else { |
| | | param = {curr:1,limit:4} |
| | | } |
| | | param = {curr:1,limit:4} |
| | | uni.request({ |
| | | url: that.baseUrl + '/plan/page/auth', |
| | | header: {'token' : uni.getStorageSync('token'),}, |
| | | data: param, |
| | | method:'GET', |
| | | success(result) { |
| | | console.log(result); |
| | | if (result.statusCode === 404) { |
| | | uni.showToast({title: '请重新登录', icon: "none", position: 'top'}) |
| | | return |
| | |
| | | data: param, |
| | | method:'GET', |
| | | success(result) { |
| | | console.log(result); |
| | | if (result.statusCode === 404) { |
| | | uni.showToast({title: '请重新登录', icon: "none", position: 'top'}) |
| | | return |
| | |
| | | if (res.code === 200) { |
| | | let list = res.data.records |
| | | that.csmtrList = that.reload ? list : that.csmtrList.concat(list); |
| | | that.curr = that.curr + 1 |
| | | console.log(list); |
| | | if (list.length > 0) { |
| | | that.curr = that.curr + 1 |
| | | } |
| | | if (res.data.records.length == 0) { |
| | | that.status = 'noMore' |
| | | } |