sign-progress-filter.js 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 mt20 ml40 mr10" id="signYear">\
  6. <div v-for="year in years" class="c-33" :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. },
  71. confirmClick:function(){
  72. var vm = this;
  73. //触发刷新
  74. this.$emit('vuedals:close', {
  75. chooseYear: vm.chooseYear,
  76. id: vm.analysisType,
  77. lowCode: vm.lowCode,
  78. name: vm.analysisName
  79. });
  80. },
  81. }
  82. });
  83. })()