xunchajilu.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. this.setData({
  20. todayXunchaCount:res.xunchaCount.todayXunchaCount,
  21. todayRiskCount : res.xunchaCount.todayRiskCount
  22. })
  23. },
  24. getXunchaList(){
  25. let obj = new Object();
  26. obj.busEnterpriseId = this.data.busEnterpriseId
  27. http.post("/system/AppXunchaController/getXunchaList",obj,this.getXunchaListSuccess)
  28. },
  29. getXunchaListSuccess(res){
  30. console.log(res.rows)
  31. this.setData({
  32. xunchaList : res.rows
  33. })
  34. },
  35. /**
  36. * 页面的初始数据
  37. */
  38. data: {
  39. host: app.globalData.host,
  40. busEnterpriseId : null,
  41. businessName : null,
  42. todayXunchaCount : 0,
  43. todayRiskCount : 0,
  44. xunchaList : null
  45. },
  46. // 巡检详细
  47. bindViewXunJianMore(){
  48. wx.navigateTo({
  49. url: '../xunjianmore/xunjianmore',
  50. })
  51. }
  52. })