sign-progress-filter.js 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. (function(){
  2. Vue.component('sign-progress-filter',{
  3. template:'<div style="height: 400px;overflow: auto;margin-bottom: 50px;">\
  4. <div class="mt10 ml10 filter-title">统计年份</div>\
  5. <div class="c-row ml40 mr10" id="signYear">\
  6. <div v-for="year in years" class="c-33 mt20" style="margin-left:0;margin-right:3%;" :class="{\'active\': year==chooseYear}" @click="yearClick(year)"><a>{{year}}</a></div>\
  7. </div>\
  8. <div class="mt20 ml10 filter-title">统计维度</div>\
  9. <div class="div-content">\
  10. <div class="mt20 div-group-btn c-row ml40 mr10">\
  11. <div class="div-btn c-33" :class="{\'active\': analysisType==1}" @click="contentClick(1, \'\', \'按任务\')">\
  12. <a href="#" class="f-fs14">按任务</a>\
  13. </div>\
  14. <div class="div-btn c-33" :class="{\'active\': analysisType==2}" @click="contentClick(2, \'\', \'按人口\')">\
  15. <a href="#" class="f-fs14">按人口</a>\
  16. </div>\
  17. <div class="div-btn c-33" :class="{\'active\': analysisType==6}" @click="contentClick(6, 4, \'十大人群签约\')">\
  18. <a href="#" class="f-fs14">十大人群签约</a>\
  19. </div>\
  20. </div>\
  21. <div class="mt20 div-group-btn c-row ml40">\
  22. <div class="div-btn c-33" :class="{\'active\': analysisType==5}" @click="contentClick(5, 3, \'65岁以上签约\')">\
  23. <a href="#" class="f-fs14">65岁以上签约</a>\
  24. </div>\
  25. <div class="div-btn c-33" :class="{\'active\': analysisType==3}" @click="contentClick(3, 1, \'高血压\')">\
  26. <a href="#" class="f-fs14">高血压</a>\
  27. </div>\
  28. <div class="div-btn c-33" :class="{\'active\': analysisType==4}" @click="contentClick(4, 2, \'糖尿病\')">\
  29. <a href="#" class="f-fs14">糖尿病</a>\
  30. </div>\
  31. </div>\
  32. </div>\
  33. <div id="footer">\
  34. <div class="c-row btn-wrap c-border-top fr">\
  35. <div class="div-foot-btn mr20" @click="resetClick">\
  36. <a href="#" class="c-666 f-fs16">重置</a>\
  37. </div>\
  38. <div class="div-foot-btn active" @click="confirmClick">\
  39. <a href="#" class="c-666 f-fs16">保存</a>\
  40. </div>\
  41. </div>\
  42. </div>\
  43. </div>',
  44. props:['chooseYear','analysisType', 'lowCode', 'analysisName'],
  45. data: function(){
  46. return {
  47. years: [],
  48. }
  49. },
  50. mounted: function(){
  51. var now = new Date(),
  52. year = now.getFullYear();
  53. if(now.getMonth() < 6){
  54. year --;
  55. }
  56. for(i=year; i>=2016; i--){
  57. this.years.push(i);
  58. }
  59. },
  60. methods: {
  61. yearClick:function(val){
  62. this.chooseYear = val;
  63. },
  64. contentClick:function(type, lowCode, name){
  65. this.analysisType = type;
  66. this.lowCode = lowCode;
  67. this.analysisName = name;
  68. },
  69. resetClick:function(){
  70. this.analysisType = 1;
  71. this.lowCode = '';
  72. this.analysisName = '按任务';
  73. this.chooseYear=this.years[0]
  74. },
  75. confirmClick:function(){
  76. var vm = this;
  77. //触发刷新
  78. this.$emit('vuedals:close', {
  79. chooseYear: vm.chooseYear,
  80. id: vm.analysisType,
  81. lowCode: vm.lowCode,
  82. name: vm.analysisName
  83. });
  84. },
  85. }
  86. });
  87. })()