qiye.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // pages/qiye/qiye.js
  2. import http from '../../base/httputil'
  3. const app = getApp()
  4. Page({
  5. /**
  6. * 组件的初始数据
  7. */
  8. onLoad() {
  9. },
  10. onShow(){
  11. this.initQiyePage()
  12. },
  13. data: {
  14. host: app.globalData.host,
  15. weekCount: 0,
  16. monthCount: 0,
  17. totalCount: 0,
  18. enterpriseList: [],
  19. menulist: [{
  20. "id": "1",
  21. "url": "icon-anquanxuncha",
  22. "title": "巡查",
  23. },
  24. {
  25. "id": "2",
  26. "url": "icon-xunjian",
  27. "title": "巡检",
  28. },
  29. ],
  30. mainmodel: {
  31. }
  32. },
  33. // 搜索结果跳页
  34. bindViewSearchEnd() {
  35. wx.navigateTo({
  36. url: '../search/search'
  37. })
  38. },
  39. // 企业详细页
  40. bindViewDetails(e) {
  41. let busEnterpriseId = e.currentTarget.dataset.enterpriseid
  42. let delFlag = e.currentTarget.dataset.delflag
  43. if(delFlag==1){
  44. wx.showToast({
  45. title: '该企业已废弃',
  46. icon:'none'
  47. })
  48. }else{
  49. wx.navigateTo({
  50. url: '../details/details?busEnterpriseId=' + busEnterpriseId
  51. })
  52. }
  53. },
  54. //企业表单详细
  55. bindViewQiYeMore() {
  56. wx.navigateTo({
  57. url: '../qiyemore/qiyemore',
  58. })
  59. },
  60. initQiyePage() {
  61. http.send_post("/system/AppEnterpriseController/getInitEnterpriseData", null, this.getQiyePageSuccess)
  62. http.send_post("/system/AppEnterpriseController/getInitEnterpriseList", null, this.getQiyeEnterpriseListSuccess)
  63. },
  64. getQiyePageSuccess(res) {
  65. if(res.code==200){
  66. let enterpriseCount = res.data.enterpriseCount;
  67. this.setData({
  68. weekCount: enterpriseCount.weekCount,
  69. monthCount: enterpriseCount.monthCount,
  70. totalCount: enterpriseCount.totalCount,
  71. })
  72. }
  73. },
  74. getQiyeEnterpriseListSuccess(res) {
  75. if(res.code==200){
  76. this.setData({
  77. enterpriseList: res.rows
  78. })}
  79. },
  80. changeSearch(e) {
  81. }
  82. })