record.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. // pages/login/login.js
  2. const app = getApp()
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. inpscreenind: 0,
  9. inpscreenlist: ['水洗码', '封签号', '订单号', '物流单号', '手机号'],
  10. stateind: 0,
  11. statelist: ['全部','已质检上挂','已打包','已出厂','已分拣'],
  12. shopsind: 0,
  13. shopslist: [{
  14. id:0,title:'全部'
  15. }],
  16. keyword: '',
  17. currentlist: [],
  18. info: ''
  19. },
  20. /**
  21. * 生命周期函数--监听页面加载
  22. */
  23. onLoad: function (options) {
  24. this.getshopslist()
  25. },
  26. onShow() {
  27. this.getinfo()
  28. },
  29. getshopslist(){
  30. let that = this
  31. wx.showLoading()
  32. app.api.useApi(app.globalData.baseAppUrl + "api/admin/sorting/pack/Inventory", {
  33. network_id: that.data.shopsind!=0?that.data.shopslist[that.data.shopsind].id:'',
  34. status: that.data.stateind!=0?that.data.stateind:'',
  35. key: that.data.keyword
  36. }, "get").then(function (res) {
  37. wx.hideLoading()
  38. if(res.code==200){
  39. that.setData({
  40. shopslist:that.data.shopslist.concat(res.message.data.shops)
  41. })
  42. }
  43. }).catch(function (err) {
  44. console.log(222);
  45. })
  46. },
  47. getinfo(){
  48. let that = this
  49. wx.showLoading()
  50. app.api.useApi(app.globalData.baseAppUrl + "api/admin/sorting/pack/Inventory", {
  51. network_id: that.data.shopsind!=0?that.data.shopslist[that.data.shopsind].id:'',
  52. status: that.data.stateind!=0?that.data.stateind:'',
  53. key: that.data.keyword
  54. }, "get").then(function (res) {
  55. wx.hideLoading()
  56. if(res.code==200){
  57. that.setData({
  58. currentlist:res.message.data.list,
  59. info: res.message.data
  60. })
  61. }
  62. }).catch(function (err) {
  63. console.log(222);
  64. })
  65. },
  66. goinfo(e){
  67. let id = e.currentTarget.dataset.id
  68. let type = e.currentTarget.dataset.type
  69. wx.navigateTo({
  70. url: '/pages/record/recorddetails/recorddetails?id='+id+'&type='+type,
  71. })
  72. },
  73. changkeyword(e){
  74. this.setData({keyword: e.detail.value})
  75. },
  76. shopschange(e){
  77. this.setData({shopsind: e.detail.value})
  78. this.getinfo()
  79. },
  80. changeinpscreen() {
  81. let that = this
  82. wx.showActionSheet({
  83. itemList: that.data.inpscreenlist,
  84. success(res) {
  85. that.setData({inpscreenind: res.tapIndex})
  86. }
  87. })
  88. },
  89. changestate() {
  90. let that = this
  91. wx.showActionSheet({
  92. itemList: that.data.statelist,
  93. success(res) {
  94. that.setData({stateind: res.tapIndex})
  95. that.getinfo()
  96. }
  97. })
  98. },
  99. })