|
@ -2,26 +2,27 @@
|
|
|
Vue.component('sign-progress-filter',{
|
|
|
template:'<div style="height: 400px;overflow: auto;margin-bottom: 50px;">\
|
|
|
<div class="mt10 ml10 filter-title">统计年份</div>\
|
|
|
<div class="c-row mt20 ml40" id="signYear" v-html="yearHtml" @click="yearClick">\
|
|
|
<div class="c-row mt20 ml40 mr10" id="signYear">\
|
|
|
<div v-for="year in years" class="c-33" :class="{\'active\': year==chooseYear}" @click="yearClick(year)"><a>{{year}}</a></div>\
|
|
|
</div>\
|
|
|
<div class="mt20 ml10 filter-title">统计维度</div>\
|
|
|
<div class="div-content" @click="contentClick">\
|
|
|
<div class="mt20 div-group-btn c-row ml40">\
|
|
|
<div class="div-btn c-33 active" data-val="1">\
|
|
|
<div class="div-content">\
|
|
|
<div class="mt20 div-group-btn c-row ml40 mr10">\
|
|
|
<div class="div-btn c-33" :class="{\'active\': analysisType==1}" @click="contentClick(1, \'\', \'按任务\')">\
|
|
|
<a href="#" class="f-fs14">按任务</a>\
|
|
|
</div>\
|
|
|
<div class="div-btn c-33" data-val="2">\
|
|
|
<div class="div-btn c-33" :class="{\'active\': analysisType==2}" @click="contentClick(2, \'\', \'按人口\')">\
|
|
|
<a href="#" class="f-fs14">按人口</a>\
|
|
|
</div>\
|
|
|
<div class="div-btn c-33" data-val="5" data-lowCode="3">\
|
|
|
<div class="div-btn c-33" :class="{\'active\': analysisType==5}" @click="contentClick(5, 3, \'65岁以上签约\')">\
|
|
|
<a href="#" class="f-fs14">65岁以上签约</a>\
|
|
|
</div>\
|
|
|
</div>\
|
|
|
<div class="mt20 div-group-btn c-row ml40">\
|
|
|
<div class="div-btn c-33" data-val="3" data-lowCode="1">\
|
|
|
<div class="div-btn c-33" :class="{\'active\': analysisType==3}" @click="contentClick(3, 1, \'高血压\')">\
|
|
|
<a href="#" class="f-fs14">高血压</a>\
|
|
|
</div>\
|
|
|
<div class="div-btn c-33" data-val="4" data-lowCode="2">\
|
|
|
<div class="div-btn c-33" :class="{\'active\': analysisType==4}" @click="contentClick(4, 2, \'糖尿病\')">\
|
|
|
<a href="#" class="f-fs14">糖尿病</a>\
|
|
|
</div>\
|
|
|
</div>\
|
|
@ -37,71 +38,47 @@
|
|
|
</div>\
|
|
|
</div>\
|
|
|
</div>',
|
|
|
props:['yearHtml','contentHtml'],
|
|
|
props:['chooseYear','analysisType', 'lowCode', 'analysisName],
|
|
|
data: function(){
|
|
|
return {
|
|
|
|
|
|
years: [],
|
|
|
}
|
|
|
},
|
|
|
mounted: function(){
|
|
|
var now = new Date(),
|
|
|
year = now.getFullYear();
|
|
|
if(now.getMonth() < 6){
|
|
|
year --;
|
|
|
}
|
|
|
for(i=year; i>=2016; i--){
|
|
|
this.years.push(i);
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
yearClick:function(){
|
|
|
$(event.target.closest("div")).addClass('active').siblings().removeClass('active');
|
|
|
yearClick:function(val){
|
|
|
this.chooseYear = val;
|
|
|
},
|
|
|
contentClick:function(){
|
|
|
$(".div-content").find(".div-btn").removeClass('active');
|
|
|
$(event.target.closest("div")).addClass('active');
|
|
|
contentClick:function(type, lowCode, name){
|
|
|
this.analysisType = type;
|
|
|
this.lowCode = lowCode;
|
|
|
this.analysisName = name;
|
|
|
},
|
|
|
resetClick:function(){
|
|
|
$("#signYear").find(".c-33").removeClass("active");
|
|
|
$("#signYear").find(".c-33").eq(0).addClass("active");
|
|
|
$(".div-content").find(".c-33").removeClass("active");
|
|
|
$(".div-content").find(".c-33").eq(0).addClass("active");
|
|
|
this.analysisType = 1;
|
|
|
this.lowCode = '';
|
|
|
this.analysisName = '按任务';
|
|
|
},
|
|
|
confirmClick:function(){
|
|
|
var vm = this;
|
|
|
var year = $("#signYear .c-33.active").attr("data-val"),
|
|
|
$type = $(".div-content .div-btn.active"),
|
|
|
typeCode = $type.attr("data-val"),
|
|
|
lowCode = $type.attr("data-lowCode"),
|
|
|
name = $type.find("a").html();
|
|
|
console.log("year:"+$("#signYear .c-33.active").attr("data-val"))
|
|
|
console.log("id:"+typeCode)
|
|
|
console.log("lowCode:"+lowCode)
|
|
|
console.log("name:"+name)
|
|
|
|
|
|
//触发刷新
|
|
|
this.$emit('vuedals:close', {
|
|
|
chooseYear: year,
|
|
|
id: typeCode,
|
|
|
lowCode: lowCode,
|
|
|
name: name,
|
|
|
yearHtml:$("#signYear").html(),
|
|
|
contentHtml:$(".div-content").html()
|
|
|
chooseYear: vm.chooseYear,
|
|
|
id: vm.analysisType,
|
|
|
lowCode: vm.lowCode,
|
|
|
name: vm.analysisName
|
|
|
});
|
|
|
},
|
|
|
formatYearData: function () {
|
|
|
//显示年份最低是2016年
|
|
|
var now = new Date(),
|
|
|
year = now.getFullYear();
|
|
|
var yearHtml = "";
|
|
|
if(now.getMonth() >= 6){
|
|
|
yearHtml += '<div class="c-33 active" data-val="'+year+'"><a>'+year+"</a></div>";
|
|
|
}
|
|
|
for(i=year-1; i>=2016; i--){
|
|
|
if(i == (year-1) && now.getMonth() < 6){
|
|
|
yearHtml += '<div class="c-33 active" data-val="'+i+'"><a>'+i+"</a></div>";
|
|
|
}else{
|
|
|
yearHtml += '<div class="c-33" data-val="'+i+'"><a>'+i+"</a></div>";
|
|
|
}
|
|
|
}
|
|
|
this.yearHtml = yearHtml;
|
|
|
},
|
|
|
},
|
|
|
mounted: function(){
|
|
|
if(this.contentHtml){
|
|
|
$(".div-content").html(this.contentHtml);
|
|
|
}else{
|
|
|
this.formatYearData();
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|