sign-progress-filter.js 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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==5}" @click="contentClick(5, 3, \'65岁以上签约\')">\
  18. <a href="#" class="f-fs14">65岁以上签约</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==3}" @click="contentClick(3, 1, \'高血压\')">\
  23. <a href="#" class="f-fs14">高血压</a>\
  24. </div>\
  25. <div class="div-btn c-33" :class="{\'active\': analysisType==4}" @click="contentClick(4, 2, \'糖尿病\')">\
  26. <a href="#" class="f-fs14">糖尿病</a>\
  27. </div>\
  28. </div>\
  29. </div>\
  30. <div id="footer">\
  31. <div class="c-row btn-wrap c-border-top fr">\
  32. <div class="div-foot-btn mr20" @click="resetClick">\
  33. <a href="#" class="c-666 f-fs16">重置</a>\
  34. </div>\
  35. <div class="div-foot-btn active" @click="confirmClick">\
  36. <a href="#" class="c-666 f-fs16">保存</a>\
  37. </div>\
  38. </div>\
  39. </div>\
  40. </div>',
  41. props:['chooseYear','analysisType', 'lowCode', 'analysisName'],
  42. data: function(){
  43. return {
  44. years: [],
  45. }
  46. },
  47. mounted: function(){
  48. var now = new Date(),
  49. year = now.getFullYear();
  50. if(now.getMonth() < 6){
  51. year --;
  52. }
  53. for(i=year; i>=2016; i--){
  54. this.years.push(i);
  55. }
  56. },
  57. methods: {
  58. yearClick:function(val){
  59. this.chooseYear = val;
  60. },
  61. contentClick:function(type, lowCode, name){
  62. this.analysisType = type;
  63. this.lowCode = lowCode;
  64. this.analysisName = name;
  65. },
  66. resetClick:function(){
  67. this.analysisType = 1;
  68. this.lowCode = '';
  69. this.analysisName = '按任务';
  70. this.chooseYear=this.years[0]
  71. },
  72. confirmClick:function(){
  73. var vm = this;
  74. //触发刷新
  75. this.$emit('vuedals:close', {
  76. chooseYear: vm.chooseYear,
  77. id: vm.analysisType,
  78. lowCode: vm.lowCode,
  79. name: vm.analysisName
  80. });
  81. },
  82. }
  83. });
  84. })()