function setTblHeadr(thisTime){
$("#datatable_ajax1 thead").empty();
//获取星期
var weekday=new Array(7);
weekday[0]="日" ;
weekday[1]="一";
weekday[2]="二";
weekday[3]="三";
weekday[4]="四";
weekday[5]="五";
weekday[6]="六";
var thisNewHeader='<tr><th rowspan="2" style="text-align: center;">安检员</th><th rowspan="2" style="text-align: center;">总计划</th><th rowspan="2" style="text-align: center;">计划户数及实际户数</th>';
if(thisTime){var date=new Date(thisTime);}
else{var date=new Date();}
var days=new Date(date.getFullYear(), (date.getMonth()+1),0).getDate();//获取当月的天数
var daysHtml="";
for(var i=1;i<=days;i++){
daysHtml+="<th>"+i+"</th>";//获取天数
}
console.log(daysHtml)
thisNewHeader+=daysHtml+'<th rowspan="2" style="text-align: center;">计划外户数</th><th rowspan="2" style="text-align: center;">安检率</th></tr><tr>';//拼接出天数
var weeks=weekday[date.getDay()];//当月第一天星期
var weeksHtml="";debugger;
for(var j=1;j<=days;j++){
date.setDate(j);
weeksHtml+="<th>"+weekday[date.getDay()]+"</th>";//获取月数
}
thisNewHeader+=weeksHtml+"</tr>"
$("#datatable_ajax1 thead").append(thisNewHeader);
}
2 thisTime='2016/02/05'