123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- // pages/login/login.js
- const app = getApp()
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- inpscreenind: 0,
- inpscreenlist: ['水洗码', '封签号', '订单号', '物流单号', '手机号'],
- stateind: 0,
- statelist: ['全部','已质检上挂','已打包','已出厂','已分拣'],
- shopsind: 0,
- shopslist: [{
- id:0,title:'全部'
- }],
- keyword: '',
- currentlist: [],
- info: ''
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- this.getshopslist()
- },
- onShow() {
- this.getinfo()
- },
- getshopslist(){
- let that = this
- wx.showLoading()
- app.api.useApi(app.globalData.baseAppUrl + "api/admin/sorting/pack/Inventory", {
- network_id: that.data.shopsind!=0?that.data.shopslist[that.data.shopsind].id:'',
- status: that.data.stateind!=0?that.data.stateind:'',
- key: that.data.keyword
- }, "get").then(function (res) {
- wx.hideLoading()
- if(res.code==200){
- that.setData({
- shopslist:that.data.shopslist.concat(res.message.data.shops)
- })
- }
- }).catch(function (err) {
- console.log(222);
- })
- },
- getinfo(){
- let that = this
- wx.showLoading()
- app.api.useApi(app.globalData.baseAppUrl + "api/admin/sorting/pack/Inventory", {
- network_id: that.data.shopsind!=0?that.data.shopslist[that.data.shopsind].id:'',
- status: that.data.stateind!=0?that.data.stateind:'',
- key: that.data.keyword
- }, "get").then(function (res) {
- wx.hideLoading()
- if(res.code==200){
- that.setData({
- currentlist:res.message.data.list,
- info: res.message.data
- })
- }
- }).catch(function (err) {
- console.log(222);
- })
- },
- goinfo(e){
- let id = e.currentTarget.dataset.id
- let type = e.currentTarget.dataset.type
- wx.navigateTo({
- url: '/pages/record/recorddetails/recorddetails?id='+id+'&type='+type,
- })
- },
- changkeyword(e){
- this.setData({keyword: e.detail.value})
- },
- shopschange(e){
- this.setData({shopsind: e.detail.value})
- this.getinfo()
- },
- changeinpscreen() {
- let that = this
- wx.showActionSheet({
- itemList: that.data.inpscreenlist,
- success(res) {
- that.setData({inpscreenind: res.tapIndex})
- }
- })
- },
- changestate() {
- let that = this
- wx.showActionSheet({
- itemList: that.data.statelist,
- success(res) {
- that.setData({stateind: res.tapIndex})
- that.getinfo()
- }
- })
- },
- })
|