123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- // pages/weighingRecord/list.js
- const app = getApp()
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- str:' ',
- showModal: false,
- pageType: true,
- loginStatus: wx.getStorageSync('loginStatus') ? wx.getStorageSync('loginStatus') : false,
- roleCodeList: wx.getStorageSync('roleCodeList') ? wx.getStorageSync('roleCodeList') : '',
- activeIndex: '',
- //分页
- limit: 10,
- requestStatu: '加载中...',
- page: 1,
- totalPages: 1,
- more: false,
- nomore: '',
- searchVal: '', //筛选条件
- //筛选E
- resData: [],
- //审核
- approveType: '',
- depotOpApprovalState: '通过',
- show: false,
- index:0,
- },
- //展示子过磅记录
- showPopup(e) {
- this.setData({ show: true, index:e.currentTarget.dataset.index });
- },
- onClose() {
- this.setData({ show: false });
- },
- //去登录页面
- toLogin(e) {
- wx.navigateTo({
- url: '../login/index',
- })
- },
- //变动筛选条件时
- changeFilter: function (e) {
- let getFilterType = e.currentTarget.dataset.filtertype + 'Value'
- this.setData({
- [getFilterType]: e.detail
- })
- //重新请求
- this.getListFun();
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
-
- },
- //点击选项卡变化
- changeTypeFun: function (e) {
- this.setData({
- activeIndex: Number(e.currentTarget.dataset.type)
- })
- this.getListFun();
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- const roleCodeList = wx.getStorageSync('roleCodeList')
- let loginStatus = wx.getStorageSync('loginStatus')
- this.setData({
- searchVal: '',
- roleCodeList: roleCodeList ? roleCodeList : '',
- loginStatus: loginStatus ? loginStatus : false
- })
- //动态tabbar
- // let selected = 1
- // if (roleCodeList == 'bizAdmin') {
- // this.getTabBar().setData({
- // list: app.globalData.allList[0].list2,
- // })
- // selected = 3
- // } else if(roleCodeList == 'send') {
- // this.getTabBar().setData({
- // list: app.globalData.allList[0].list3,
- // })
- // } else if(roleCodeList == 'sale') {
- // this.getTabBar().setData({
- // list: app.globalData.allList[0].list4,
- // })
- // }else if(roleCodeList == 'customer') {
- // this.getTabBar().setData({
- // list: app.globalData.allList[0].list5,
- // })
- // } else if (roleCodeList=='driver'||roleCodeList==''){
- // this.getTabBar().setData({
- // list: app.globalData.allList[0].list1,
- // })
- // }
- // if (typeof this.getTabBar === 'function' && this.getTabBar()) {
- // this.getTabBar().setData({
- // selected: selected
- // })
- // }
- if (wx.getStorageSync('loginStatus')) {
- this.getListFun();
- }
- },
-
- //搜索框请求S
- onChange(e) {
- this.setData({
- searchVal: e.detail,
- });
- },
- onSearch: function (event) {
- this.setData({
- searchVal: event.detail
- })
- this.getListFun();
- },
- onCancel: function () {
- this.setData({})
- },
- tocodeInfo:function(e){
- wx.navigateTo({
- url: e.currentTarget.dataset.url
- })
- },
- //列表
- getListFun: function () {
- this.setData({
- page: 1
- })
- let params = {
- current: this.data.page,
- size: this.data.limit,
- licensePlate:this.data.searchVal
- }
- app.request.pageFirst({
- url: app.API.recordList,
- page: this,
- params: params,
- })
- },
- //页面跳转
- toLink: function (e) {
- let { url } = e.currentTarget.dataset
- wx.navigateTo({
- url: url
- })
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- this.setData({
- searchVal: ''
- })
- if (wx.getStorageSync('loginStatus')) {
- this.getListFun();
- } else {
- wx.stopPullDownRefresh();
- }
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- this.data.page++;
- let params = {
- current: this.data.page,
- size: this.data.limit,
- licensePlate:this.data.searchVal
- }
- app.request.pageOther({
- url: app.API.recordList,
- page: this,
- params: params,
- loadType: true //加载类型,是否是下拉加载
- });
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- }
- })
|