role.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. const Constants = require('@/utils/Constants.js');
  2. const util = require('@/utils/util.js')
  3. const mixins = require('@/mixins/index.js')
  4. Page({
  5. mixins: [mixins],
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. // 列表区(内容)
  11. contentList: [{ name: 'sysCode', title: '角色编码' },
  12. { name: 'remarks', title: '角色说明' }],
  13. // 弹出按钮
  14. buttonList: [{ name: 'follow', title: '采购作废' }, { name: 'followTask', title: '冲正重开' }, { name: 'purchase-return-repla-sup', title: '采购退货' },
  15. { name: 'collection', title: '采购退货冲正' }, { name: 'merge', title: '打印票据' }],
  16. totallength: 234999, //视图下方提醒数量
  17. selectTotallength: 12,
  18. selectlength: 5,
  19. // 路由
  20. routeObjName: 'role',
  21. tableData: [],
  22. },
  23. toAdd() {
  24. wx.navigateTo({
  25. url: this.data.route.add.url,
  26. events: function (e) {
  27. // 回调后,在这里给页面赋值
  28. },
  29. success: function (res) {
  30. // 通过eventChannel向被打开页面传送数据 TODO 测试例子url是写死的,实际中,需要从route中读取
  31. res.eventChannel.emit('params', {})
  32. }
  33. })
  34. },
  35. getData(params) {
  36. return this.excute(this.data.service, this.data.service.selectByCond, params);
  37. },
  38. /**
  39. * 生命周期函数--监听页面加载
  40. */
  41. onLoad(options) {
  42. console.log('routeUrl', this.data.route)
  43. },
  44. /**
  45. * 生命周期函数--监听页面初次渲染完成
  46. */
  47. onReady() {
  48. },
  49. /**
  50. * 生命周期函数--监听页面显示
  51. */
  52. onShow() {
  53. },
  54. /**
  55. * 生命周期函数--监听页面隐藏
  56. */
  57. onHide() {
  58. },
  59. /**
  60. * 生命周期函数--监听页面卸载
  61. */
  62. onUnload() {
  63. },
  64. /**
  65. * 页面相关事件处理函数--监听用户下拉动作
  66. */
  67. onPullDownRefresh() {
  68. },
  69. /**
  70. * 页面上拉触底事件的处理函数
  71. */
  72. onReachBottom() {
  73. },
  74. /**
  75. * 用户点击右上角分享
  76. */
  77. onShareAppMessage() {
  78. }
  79. })