index.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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: '0', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], },
  14. { id: '002', user_name: '小红帽', user_phone: '98765432109', examine_date: '222', examine_name: '赵五', status_name: '待审', status: '0', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], }
  15. ],
  16. // 弹框
  17. dialog: { title: '详细信息', show: false, type: '1' },
  18. // 详细信息
  19. info: {},
  20. // 审核
  21. checkForm: { examine_name: '李四' },
  22. // 导出条件
  23. exportForm: {},
  24. // 商品状态
  25. statusList: apply_status
  26. },
  27. back: function () {
  28. wx.navigateBack({ url: '/pages/home/index' })
  29. },
  30. // 导出条件
  31. export_term: function () {
  32. this.setData({ dialog: { title: '导出条件', show: true, type: '3' }, })
  33. },
  34. // 选择状态
  35. statusChange: function (e) {
  36. let { value } = e.detail;
  37. if (value) {
  38. let data = this.data.statusList[value];
  39. this.setData({ 'exportForm.status': data.value })
  40. }
  41. },
  42. // 开始时间
  43. startChange: function (e) {
  44. let { value } = e.detail;
  45. this.setData({ 'exportForm.apply_date@start': value })
  46. },
  47. // 结束时间
  48. endChange: function (e) {
  49. let { value } = e.detail;
  50. this.setData({ 'exportForm.apply_date@end': value })
  51. },
  52. // 重置条件
  53. expertReset: function (e) {
  54. this.setData({ exportForm: { user_name: '', status: '' } })
  55. },
  56. // 确认导出
  57. exportSubmit: function (e) {
  58. console.log('打开文档成功')
  59. },
  60. // 采购申请审核
  61. toCheck: function (e) {
  62. this.setData({ dialog: { title: '采购申请审核', show: true, type: '2' } })
  63. },
  64. // 提交审核
  65. checkSubmit: function (e) {
  66. wx.showToast({ title: `审核信息成功`, icon: 'success', duration: 2000 });
  67. this.setData({ dialog: { title: '详细信息', show: false, type: '1' } })
  68. },
  69. // 详细信息
  70. toView: function (e) {
  71. let item = e.currentTarget.dataset.item;
  72. this.setData({ info: item })
  73. this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
  74. },
  75. // 刪除信息
  76. toDel: function (e) {
  77. },
  78. // 查询
  79. shoppinginput: function (e) {
  80. this.setData({ shoopingtext: e.detail.value })
  81. },
  82. /**
  83. * 生命周期函数--监听页面加载
  84. */
  85. onLoad: function (options) {
  86. // 计算高度
  87. this.searchHeight();
  88. },
  89. // 查询数据
  90. search: function (e) {
  91. },
  92. // 计算高度
  93. searchHeight: function () {
  94. let frameStyle = this.data.frameStyle;
  95. let client = app.globalData.client;
  96. // 减去状态栏
  97. let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  98. // 是否减去底部菜单
  99. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  100. if (infoHeight) this.setData({ infoHeight: infoHeight })
  101. },
  102. /**
  103. * 生命周期函数--监听页面初次渲染完成
  104. */
  105. onReady: function () {
  106. },
  107. /**
  108. * 生命周期函数--监听页面显示
  109. */
  110. onShow: function () {
  111. this.search();
  112. },
  113. /**
  114. * 生命周期函数--监听页面隐藏
  115. */
  116. onHide: function () {
  117. },
  118. /**
  119. * 生命周期函数--监听页面卸载
  120. */
  121. onUnload: function () {
  122. },
  123. /**
  124. * 页面相关事件处理函数--监听用户下拉动作
  125. */
  126. onPullDownRefresh: function () {
  127. },
  128. /**
  129. * 页面上拉触底事件的处理函数
  130. */
  131. onReachBottom: function () {
  132. },
  133. /**
  134. * 用户点击右上角分享
  135. */
  136. onShareAppMessage: function () {
  137. }
  138. })