var myDate = new Date(); var curYear = myDate.getFullYear(); //获取完整的年份(4位,1970-????) var curMonth = myDate.getMonth()+1; //获取当前月份(0-11,0代表1月) var curQuarters = Math.floor( ( (curMonth-1) % 3 == 0 ? ( (curMonth-1) / 3 ) : ( (curMonth-1) / 3 + 1 ) ) ); var scopeTitle = '月 度'; myDate.getMonth(); //获取当前月份(0-11,0代表1月) //调整相应的频度 function tyepChange(){ if($("#attType").val() == "0"){ $("#attMonth").removeAttr("disabled"); $("#attMonth").css("background",""); $("#attQuarters").attr("disabled","disabled"); $("#attQuarters").css("background","#f0f0f0"); scopeTitle = '月 度'; }else if($("#attType").val() == "1"){ $("#attMonth").attr("disabled","disabled"); $("#attMonth").css("background","#f0f0f0"); $("#attQuarters").removeAttr("disabled"); $("#attQuarters").css("background",""); scopeTitle = '季 度'; }else{ $("#attMonth").attr("disabled","disabled"); $("#attMonth").css("background","#f0f0f0"); $("#attQuarters").attr("disabled","disabled"); $("#attQuarters").css("background","#f0f0f0"); scopeTitle = '年 度'; } } var _hasSearch=false; function setDefault(){ if(curMonth<10) curMonth = "0"+curMonth; $("#attMonth").val(curMonth); $("#attYear").val(curYear); $('#attQuarters').val(curQuarters); } var _rpttitle = '报表'; function btn_output(){ if(!_hasSearch){ alert('请先查询数据'); return; } var opt = { type:'excel' ,fileName:_rpttitle ,escape:'false' ,mso:{ fileFormat: 'xlshtml' ,onMsoNumberFormat: null ,pageFormat: 'a4' ,pageOrientation: 'portrait' ,rtl: false ,styles: ['background-color', 'color', 'font-family', 'font-size', 'font-weight', 'text-align', 'height', 'padding', ,'border-bottom', 'border-top', 'border-left', 'border-right' ] // ,worksheetName: 'abc' } }; // $('#jqGrid').tableExport(opt); var ex = $('#jqGrid').clone(); var tbody = ex.find('tbody'); var tds = tbody.find('tr:eq(0)').find('td'); var thead = $("#gbox_jqGrid .ui-jqgrid-htable thead").clone(); tbody.before(thead); var titleTr =$('