patrol_list.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import http from '../../base/httputil'
  2. const app = getApp()
  3. Page({
  4. /**
  5. * 组件的初始数据
  6. */
  7. data: {
  8. host: app.globalData.host,
  9. enterpriseId: null,
  10. mList: null,
  11. keyword: '',
  12. },
  13. onLoad(options) {
  14. this.data.enterpriseId = options.enterpriseId
  15. },
  16. onShow() {
  17. this.getPatrolPointList()
  18. },
  19. getPatrolPointList() {
  20. let obj = new Object()
  21. // obj.pageNum = this.data.pageNum
  22. // obj.busEnterpriseName = ""
  23. // obj.pageSize = 10
  24. // obj.reasonable = true
  25. obj.busEnterpriseId = this.data.enterpriseId
  26. obj.searchValue = this.data.keyword
  27. // obj.searchFrom='app'
  28. http.send_get("/system/AppPatrolstationController/getPatrolstationList", obj, this.getPatrolPointListSuccess)
  29. },
  30. getPatrolPointListSuccess(res) {
  31. if (res.code == 200) {
  32. this.setData({
  33. mList: res.data
  34. })
  35. }
  36. },
  37. // 搜索结果跳页
  38. bindViewSearchEnd() {
  39. // wx.navigateTo({
  40. // url: '../xunchawu/xunchawu'
  41. // })
  42. this.getPatrolPointList();
  43. },
  44. bindViewInputSearch(e) {
  45. this.data.keyword = e.detail.value
  46. },
  47. // bindViewSearchEnd(e){
  48. // let isrisk = e.currentTarget.dataset.isrisk
  49. // let buslogid = e.currentTarget.dataset.buslogid
  50. // if(isrisk == 0){
  51. // wx.showToast({
  52. // title: '没有发现安全隐患,请放心!!',
  53. // icon: "none"
  54. // })
  55. // }else{
  56. // console.log(isrisk,"####",buslogid)
  57. // wx.navigateTo({
  58. // url: '../xunjianmore/xunjianmore?buslogid='+buslogid
  59. // })
  60. // }
  61. // },
  62. bindViewAddPatrol() {
  63. wx.navigateTo({
  64. url: '../new_patrol_point/new_patrol_point?enterpriseId=' + this.data.enterpriseId
  65. })
  66. },
  67. bindViewToDetails(e) {
  68. let id = e.currentTarget.dataset.id
  69. let delFlag = e.currentTarget.dataset.delflag
  70. if (delFlag != null && delFlag != '') {
  71. wx.showToast({
  72. title: '该巡更点已废弃',
  73. icon: 'none'
  74. })
  75. } else {
  76. wx.navigateTo({
  77. url: '../xungengdetails/xungengdetails?id=' + id,
  78. })
  79. }
  80. }
  81. })