index.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. const { apply_status } = require('../../utils/dict');
  2. const app = getApp();
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. frameStyle: { useTop: true, name: '采购需求信息', leftArrow: true, useBar: false },
  9. // 主体高度
  10. infoHeight: '',
  11. // 采购申请
  12. list: [
  13. { id: '001', user_name: '法外狂徒张三', user_phone: '12345678901', examine_name: '李四', examine_date: '111', status_name: '待审', status: '1', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], },
  14. { id: '002', user_name: '小红帽', user_phone: '98765432109', examine_date: '222', examine_name: '赵五', status_name: '待审', status: '1', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], }
  15. ],
  16. // 弹框
  17. dialog: { title: '详细信息', show: false, type: '1' },
  18. // 详细信息
  19. info: {},
  20. // 查询
  21. shoopingtext: '',
  22. // 审核
  23. checkForm: {},
  24. // 比对结果
  25. resultList: [{ name: '121', num: '9999999' }]
  26. },
  27. back: function () {
  28. wx.navigateBack({ url: '/pages/home/index' })
  29. },
  30. // 详细信息
  31. toView: function (e) {
  32. let item = e.currentTarget.dataset.item;
  33. this.setData({ info: item })
  34. this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
  35. },
  36. // 自动对比库存
  37. toContrast: function (e) {
  38. this.setData({ dialog: { title: '比对结果', show: true, type: '3' } })
  39. },
  40. // 审核信息是否是采买,还是领取
  41. toCheck: function (e) {
  42. this.setData({ dialog: { title: '审核信息', show: true, type: '2' } })
  43. },
  44. // 提交审核
  45. checkSubmit: function (e) {
  46. this.setData({ dialog: { title: '详细信息', show: false, type: '1' } })
  47. },
  48. // 查询
  49. shoppinginput: function (e) {
  50. console.log('搜索', e.detail.value);
  51. this.setData({ shoopingtext: e.detail.value })
  52. },
  53. /**
  54. * 生命周期函数--监听页面加载
  55. */
  56. onLoad: function (options) {
  57. // 计算高度
  58. this.searchHeight();
  59. },
  60. // 计算高度
  61. searchHeight: function () {
  62. let frameStyle = this.data.frameStyle;
  63. let client = app.globalData.client;
  64. // 减去状态栏
  65. let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  66. // 是否减去底部菜单
  67. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  68. if (infoHeight) this.setData({ infoHeight: infoHeight })
  69. },
  70. /**
  71. * 生命周期函数--监听页面初次渲染完成
  72. */
  73. onReady: function () {
  74. },
  75. /**
  76. * 生命周期函数--监听页面显示
  77. */
  78. onShow: function () {
  79. },
  80. /**
  81. * 生命周期函数--监听页面隐藏
  82. */
  83. onHide: function () {
  84. },
  85. /**
  86. * 生命周期函数--监听页面卸载
  87. */
  88. onUnload: function () {
  89. },
  90. /**
  91. * 页面相关事件处理函数--监听用户下拉动作
  92. */
  93. onPullDownRefresh: function () {
  94. },
  95. /**
  96. * 页面上拉触底事件的处理函数
  97. */
  98. onReachBottom: function () {
  99. },
  100. /**
  101. * 用户点击右上角分享
  102. */
  103. onShareAppMessage: function () {
  104. }
  105. })