xunchajilu.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import http from '../../base/httputil'
  2. const app = getApp()
  3. Page({
  4. onLoad(e){
  5. let busEnterpriseId = e.busEnterpriseId
  6. this.data.busEnterpriseId = busEnterpriseId
  7. this.setData({
  8. businessName : e.businessName
  9. })
  10. this.getXunchaCount();
  11. this.getXunchaList();
  12. },
  13. getXunchaCount(){
  14. let obj = new Object();
  15. obj.busEnterpriseId = this.data.busEnterpriseId
  16. http.post("/system/AppXunchaController/getXunchaCount",obj,this.getXunchaCountSuccess)
  17. },
  18. getXunchaCountSuccess(res){
  19. console.log("222",res)
  20. if(res.code==200){
  21. this.setData({
  22. todayXunchaCount:res.data.xunchaCount.todayXunchaCount,
  23. todayRiskCount : res.data.xunchaCount.todayRiskCount
  24. })
  25. }
  26. },
  27. getXunchaList(){
  28. let obj = new Object();
  29. obj.busEnterpriseId = this.data.busEnterpriseId
  30. http.send_get("/system/AppXunchaController/getXunchaList",obj,this.getXunchaListSuccess)
  31. },
  32. getXunchaListSuccess(res){
  33. console.log("!!!",res.data.rows)
  34. this.setData({
  35. xunchaList : res.data.rows
  36. })
  37. },
  38. /**
  39. * 页面的初始数据
  40. */
  41. data: {
  42. host: app.globalData.host,
  43. busEnterpriseId : null,
  44. businessName : null,
  45. todayXunchaCount : 0,
  46. todayRiskCount : 0,
  47. xunchaList : null
  48. },
  49. // 巡检详细
  50. toBindXunjinaMore(e){
  51. let isrisk = e.currentTarget.dataset.isrisk
  52. let buslogid = e.currentTarget.dataset.buslogid
  53. if(isrisk == 0){
  54. wx.showToast({
  55. title: '没有发现安全隐患,请放心!!',
  56. icon: "none"
  57. })
  58. }else{
  59. console.log(isrisk,"####",buslogid)
  60. wx.navigateTo({
  61. url: '../xunjianmore/xunjianmore?buslogid='+buslogid
  62. })
  63. }
  64. },
  65. })