|  | @ -1,104 +1 @@
 | 
	
		
			
				|  |  | (function(){
 | 
	
		
			
				|  |  |     Vue.component('smfu-serviceList',{
 | 
	
		
			
				|  |  |         template:'<div style="height: 400px;overflow: auto;margin-bottom: 50px;">\
 | 
	
		
			
				|  |  | 				<div class="mt10 ml10 filter-title">统计年份</div>\
 | 
	
		
			
				|  |  | 				<div class="c-row ml40 mr10" id="signYear">\
 | 
	
		
			
				|  |  | 				    <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>\
 | 
	
		
			
				|  |  | 				</div>\
 | 
	
		
			
				|  |  | 				<div class="mt20 ml10 filter-title">统计指标</div>\
 | 
	
		
			
				|  |  | 				<div class="div-content">\
 | 
	
		
			
				|  |  | 					<div class="mt20 div-group-btn c-row ml40 mr10">\
 | 
	
		
			
				|  |  | 						<div class="div-btn c-33" v-for="item in smfuList" :class="{\'active\': smfu==item.code}" @click="selItem(item,\'smfu\')">\
 | 
	
		
			
				|  |  | 							<a href="#" class="f-fs14">{{item.name}}</a>\
 | 
	
		
			
				|  |  | 						</div>\
 | 
	
		
			
				|  |  | 					</div>\
 | 
	
		
			
				|  |  | 				</div>\
 | 
	
		
			
				|  |  | 				<div class="mt20 ml10 filter-title" v-if="smfu == 2">统计维度</div>\
 | 
	
		
			
				|  |  | 				<div class="div-content" v-if="smfu == 2">\
 | 
	
		
			
				|  |  | 					<div class="c-row ml40 mr10">\
 | 
	
		
			
				|  |  | 						<div class="c-33 mt20"  style="margin-left:0;margin-right:3%;" :class="{\'active\': rhfs.length==0}" @click="selItems(\'\',\'rhfs\')">\
 | 
	
		
			
				|  |  | 							<a href="#" class="f-fs14">全部</a>\
 | 
	
		
			
				|  |  | 						</div>\
 | 
	
		
			
				|  |  | 						<div class="c-33 mt20"  style="margin-left:0;margin-right:3%;" v-for="item in rhfsList" :class="{\'active\': rhfs.indexOf(item.code)>-1}" @click="selItems(item,\'rhfs\')">\
 | 
	
		
			
				|  |  | 							<a href="#" class="f-fs14">{{item.name}}</a>\
 | 
	
		
			
				|  |  | 						</div>\
 | 
	
		
			
				|  |  | 					</div>\
 | 
	
		
			
				|  |  | 				</div>\
 | 
	
		
			
				|  |  | 				<div id="footer">\
 | 
	
		
			
				|  |  | 					<div class="c-row btn-wrap c-border-top fr">\
 | 
	
		
			
				|  |  | 						<div class="div-foot-btn mr20" @click="resetClick">\
 | 
	
		
			
				|  |  | 							<a href="#" class="c-666 f-fs16">重置</a>\
 | 
	
		
			
				|  |  | 						</div>\
 | 
	
		
			
				|  |  | 						<div class="div-foot-btn active" @click="confirmClick">\
 | 
	
		
			
				|  |  | 							<a href="#" class="c-666 f-fs16">保存</a>\
 | 
	
		
			
				|  |  | 						</div>\
 | 
	
		
			
				|  |  | 					</div>\
 | 
	
		
			
				|  |  | 				</div>\
 | 
	
		
			
				|  |  | 			</div>',
 | 
	
		
			
				|  |  |         props:['chooseYear','minYear'],
 | 
	
		
			
				|  |  |         data: function(){
 | 
	
		
			
				|  |  |             return {
 | 
	
		
			
				|  |  |                 years: [],
 | 
	
		
			
				|  |  |                 smfuList:[{code:1,name:'上门服务'},{code:2,name:'入户访视'}],	//上门服务
 | 
	
		
			
				|  |  | 				smfu:1,
 | 
	
		
			
				|  |  | 				rhfsList:[{code:"5",name:'孕产妇'},{code:"6",name:'新生儿'},
 | 
	
		
			
				|  |  | 				{code:"9",name:'肺结核'},{code:"8",name:'80岁以上老人'},{code:"7",name:'重性精神疾病'}],  //入户访视
 | 
	
		
			
				|  |  | 				rhfs:[],
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         },
 | 
	
		
			
				|  |  |         mounted: function(){
 | 
	
		
			
				|  |  |             var now = new Date(),
 | 
	
		
			
				|  |  |                 year = now.getFullYear();
 | 
	
		
			
				|  |  |             var minYear = 2016
 | 
	
		
			
				|  |  |             
 | 
	
		
			
				|  |  |             if(this.minYear){
 | 
	
		
			
				|  |  |             	minYear = this.minYear
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |              
 | 
	
		
			
				|  |  |             if(now.getMonth() < 6){
 | 
	
		
			
				|  |  |                 year --;
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             for(i=year; i>=this.minYear; i--){
 | 
	
		
			
				|  |  |                 this.years.push(i);
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         },
 | 
	
		
			
				|  |  |         methods: {
 | 
	
		
			
				|  |  |         	 yearClick:function(val){
 | 
	
		
			
				|  |  | 	          this.chooseYear = val;
 | 
	
		
			
				|  |  | 	         },
 | 
	
		
			
				|  |  | 	         resetClick:function(){
 | 
	
		
			
				|  |  | 				this.chooseYear=this.years[0]
 | 
	
		
			
				|  |  | 				this.rhfs = []
 | 
	
		
			
				|  |  | 				this.smfu = 1
 | 
	
		
			
				|  |  | 	         },
 | 
	
		
			
				|  |  | 	         confirmClick:function(){
 | 
	
		
			
				|  |  | 	         	var vm = this;
 | 
	
		
			
				|  |  | 				//触发刷新
 | 
	
		
			
				|  |  | 				this.$emit('vuedals:close', {
 | 
	
		
			
				|  |  | 					chooseYear: vm.chooseYear,
 | 
	
		
			
				|  |  | 					rhfs: vm.rhfs.join(","),
 | 
	
		
			
				|  |  | 					smfu: vm.smfu
 | 
	
		
			
				|  |  | 				});
 | 
	
		
			
				|  |  | 	         },
 | 
	
		
			
				|  |  | 	        selItem:function(item,index){
 | 
	
		
			
				|  |  | 				var vm = this
 | 
	
		
			
				|  |  | 				vm[index] = item.code
 | 
	
		
			
				|  |  | 			},
 | 
	
		
			
				|  |  | 			selItems:function(item,index){
 | 
	
		
			
				|  |  | 				var vm=this
 | 
	
		
			
				|  |  | 				if(item){
 | 
	
		
			
				|  |  | 					var code = item.code
 | 
	
		
			
				|  |  | 					var hasIndex = vm[index].indexOf(code)
 | 
	
		
			
				|  |  | 					if(hasIndex>-1){
 | 
	
		
			
				|  |  | 						vm[index].splice(hasIndex,1)
 | 
	
		
			
				|  |  | 					}else{
 | 
	
		
			
				|  |  | 						vm[index].push(code)
 | 
	
		
			
				|  |  | 					}
 | 
	
		
			
				|  |  | 				}else{
 | 
	
		
			
				|  |  | 					vm[index] = []
 | 
	
		
			
				|  |  | 				}
 | 
	
		
			
				|  |  | 			},
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     });
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  | })()
 | 
	
		
			
				|  |  |  
 |