Project.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. options: {
  4. addGlobalClass: true,
  5. },
  6. properties: {
  7. update: {
  8. type: Function
  9. }
  10. },
  11. lifetimes: {
  12. attached: function () {
  13. getApp().globalData.Language.getLanguagePackage(this)
  14. this.triggerEvent('update', "Client")
  15. }
  16. },
  17. data: {
  18. tabsActive: 0,
  19. tabsList: [{
  20. label: "数据概况",
  21. model: "#DataOverview"
  22. }, {
  23. label: "项目类型分析",
  24. model: "#ProjectType"
  25. }, {
  26. label: "项目等级分析",
  27. model: "#ProjectGrade"
  28. }, {
  29. label: "近12月项目新增分析",
  30. model: "#NewAnalysisAdded"
  31. }, {
  32. label: "近12月项目报备分析",
  33. model: "#ReportAnalysis"
  34. }, {
  35. label: "近12月项目报价分析",
  36. model: "#ProjectQuotationQuantity"
  37. }, {
  38. label: "近12月项目跟进分析",
  39. model: "#followUpAnalysis"
  40. }, {
  41. label: "项目跟进情况统计",
  42. model: "#ProjecFollowUp"
  43. }, {
  44. label: "项目联系人情况统计",
  45. model: "#ProjectContact"
  46. }, {
  47. label: "项目关联客户情况统计",
  48. model: "#RelatedCustomer"
  49. }, {
  50. label: "项目评估情况统计",
  51. model: "#ProjecEvaluation"
  52. }, {
  53. label: "有效项目未跟进天数分析",
  54. model: "#YXXMWGJTSFX"
  55. }, {
  56. label: "项目生命周期分析",
  57. model: "#XMSMZQFX"
  58. }]
  59. },
  60. methods: {
  61. getList() {
  62. this.partialRenewal()
  63. this.data.init = true;
  64. },
  65. tabsChange({
  66. detail
  67. }) {
  68. this.setData({
  69. tabsActive: detail
  70. });
  71. this.partialRenewal();
  72. },
  73. //局部数据更新 tabs
  74. partialRenewal() {
  75. try {
  76. const model = this.data.tabsList[this.data.tabsActive].model;
  77. if (model) {
  78. const Component = this.selectComponent(model);
  79. Component.getList(true);
  80. }
  81. this.data.model = model;
  82. } catch (error) {
  83. setTimeout(() => {
  84. this.partialRenewal();
  85. }, 100)
  86. }
  87. },
  88. getContent() {
  89. const model = this.data.tabsList[this.data.tabsActive].model;
  90. if (model) return this.selectComponent(model).data.content
  91. }
  92. }
  93. })