var compid = ""; var deptName = ""; var ind = ""; var season_jidu = "1"; var NavJsonData = {"name":"定期维护信息", "children":[{"name":"内部(外部)应急队伍人员登记表","value":"/page/business/am/resource/team/team.jsp","type":"wh"}, {"name":"内部(外部)应急队伍人员统计表","value":"/page/business/am/resource/team/team-poll.jsp","type":"wh"}, /* {"name":"应急协作队伍人员统计表","value":"/page/business/am/resource/team/team-poll.jsp","type":"wh"},*/ {"name":"应急专家队伍人员登记表","value":"/page/business/am/resource/expert/expert-maintenance.jsp","type":"wh"}, /* {"name":"应急指挥(通信)车登记表","value":"/page/business/am/resource/ledger/command-car.jsp","type":"wh"},*/ {"name":"应急发电车登记表 ","value":"/page/business/am/resource/ledger/generator-car.jsp","type":"wh"}, {"name":"应急发电机登记表","value":"/page/business/am/resource/ledger/generator.jsp","type":"wh"} ]}; var url = window.location.href; if(url.indexOf("?")>-1){ var params = window.location.href.split("?"); compid = params[1]; report_type = params[2]; classid1 = params[2]; if(params.length==4){ ind = params[3]; } season_jidu = params[4]; }else{ compid = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids(); deptName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names(); } var QuarterData = {"list":[{"key":"第一季度","value":"1"}, {"key":"第二季度","value":"2"}, {"key":"第三季度","value":"3"}, {"key":"第四季度","value":"4"} ]}; /*************获取当前日期*******************************************************/ var currDate = getNowFormatDate(); var month = currDate.substring(5,7); currDate = currDate.substring(0,4); /*************获取当前日期*******************************************************/ var YearData = {"list":[{"key":currDate-6,"value":currDate-6}, {"key":currDate-5,"value":currDate-5}, {"key":currDate-4,"value":currDate-4}, {"key":currDate-3,"value":currDate-3}, {"key":currDate-2,"value":currDate-2}, {"key":currDate-1,"value":currDate-1}, {"key":currDate,"value":currDate}/*, {"key":currDate-(-1),"value":currDate-(-1)}*/ ]}; //数据表格 var g; var myCols; $(function(){ $(".isPrimaryKey").live("click",function(i,item){ var compId = $(this).find("a").attr("data-compid"); var rowindex = $(this).find("a").attr("data-rowindex"); var reportype = $(this).find("a").attr("data-reportype"); var fdId = $(this).find("a").attr("fdId"); if(rowindex==0){ return; } var index = $(".current").attr("data-index"); var season = $("#BB_JIDU").attr("relValue"); if (!!window.ActiveXObject || "ActiveXObject" in window){//ie $.indexOpenNextWindow("/nwyj/page/business/am/report/reportinput/huizong.jsp?"+compId+"?"+reportype+"?"+index+"?"+season,"_blank"); //上级查看下级单位上报的数据 if(compId!=compid && fdId!=""){ getThing($.pathname() + "/ws/RcBaoBiao/RcBaoBiaoService/updateRollStat", {fd_id:fdId,stat:"0"}, "text"); } }else{ $.indexOpenNextWindow("/nwyj/page/business/am/report/reportinput/huizong.jsp?"+compId+"?"+reportype+"?"+index+"?"+season,"_blank"); if(compId!=compid && fdId!=""){ getThing($.pathname() + "/ws/RcBaoBiao/RcBaoBiaoService/updateRollStat", {fd_id:fdId,stat:"0"}, "text"); } } }); //****布局 var layout = $("#layout1").layout({ leftWidth : 250, space:10 }); $("#layout1").layout({ onEndResize : function() { g.resetWidth(); /*var wi = $(".layout_content").width(); wi = wi*0.85; $(".layout_content .accordition").css("width",wi+"px");*/ } }); function customHeightSet(contentHeight) { $(".layout_content").height(contentHeight - 30); } function customHeightSet(contentHeight) { $(".cusBoxContent").height(contentHeight - 20); } var seasion = getThing($.pathname()+ "/ws/rcbaobiao/RcBbService/getSeasionByHz", "", "text"); if(seasion !=""){ season_jidu = seasion.split(";")[1]; currDate = seasion.split(";")[0]; } $("#BB_YEAR").data("data",YearData); $("#BB_YEAR").attr("selectedValue",currDate); $("#BB_YEAR").render(); $("#BB_JIDU").data("data",QuarterData); $("#BB_JIDU").attr("selectedValue",season_jidu); $("#BB_JIDU").render(); //后台读取数据创建左边导航 getNavDatas(); }); /** * 字符串转时间(yyyy-MM-dd HH:mm:ss) * result (分钟) */ String.prototype.stringToDate = function(){ return new Date(Date.parse(this.replace(/-/g, "/"))); }; /*** * 通过特定格式json数据,生成左边导航 * @param json */ function createNavJson(json){ var $obj = $("#accordition"); for(var k=0;k"+navName+""); $obj.append($aa); var $dd = $("
"); $obj.append($dd); for(var i=0;i'+name+''); if(i==0&&type=="bs"){ $div.addClass("current"); } if(type=="bs"){//定期报送信息 $div.attr("data-value",value); $div.attr("data-index",i); }else{//定期维护信息 $div.data("data-url",value); } $div.data("type",type); $div.unbind("click").bind("click",selectOneNav); $dd.append($div); } } $obj.find("a").eq(0).click(); if(ind=="" || ind==undefined){ $obj.find(".current").click(); }else{ $obj.find(".leftnav").eq(ind).click(); } } /**** * 绑定左侧导航点击事件 */ function selectOneNav(){ var type = $(this).data("type"); $(".current").removeClass("current"); $(this).addClass("current"); if(type=="bs"){ $("#i_grid").show(); $("#ifrcontent").hide(); var year_value = $("#BB_YEAR").attr("relvalue"); var season_value = $("#BB_JIDU").attr("relvalue"); dovalue = $(this).attr("data-value"); showGridandCharts(dovalue,year_value,season_value); }else{ $("#i_grid").hide(); $("#ifrcontent").show(); var showUrl = $(this).data("data-url"); $("#frmrightChild").attr("src",$.pathname()+showUrl); $("#frmrightChild").height($(window.document.body).height()+30); $(top.document.body).find("#frmright").height($(window.document.body).height()+30); } //设置该菜单选中 return false; } function export_report(){ var year=$("#BB_YEAR").attr("relvalue"); var season=$("#BB_JIDU").attr("relvalue");//若要季度文字,则把relvalue改成reltext var title= $("#accordition .current").text()+year+"年第"+season+"季度";//应急预警和响应统计表 var sql = { "report_type" :dovalue, "id":compid, "json":JSON.stringify(g.getData()), "year":year, "season":season, condition:' 1=1', "title":title }; excelExport(dovalue,sql,title,['FD_OBJECTID','REPORT_ID','COMP_ID','UPDATEDATE'],title,'rcreport'); } /** * 访问后台,将导航数据读取出来 */ function getNavDatas() { var urls = $.pathname()+ "/ws/xianlutingyun/XianlutingyunService/getRcNavData"; $.ajax({ url : urls, type : 'post', timeout : 15000, async : false, dataType : 'json', success : function(data) { data.push(NavJsonData); //调用方法,创建左边导航 createNavJson(data); }, error : function(e) { $.messager.alert('查询数据失败!', '访问服务失败!', 'error'); } }); } function _addStatus(rowdata, rowindex, value, column){ var value1 = ""+value+""; if(value=='总计'){ return "
"+value1+"
"; }else{ return "
"+value1+"
"; } } /*** * 从后台读取表头数据 */ function setColumn(reprotvalue){ var urls = $.pathname()+ "/ws/rcbaobiao/RcBbService/getHuizongColumns"; $.ajax({ url : urls, type : 'post', timeout : 15000, async : false, data : { "report_type" : reprotvalue }, dataType : 'text', success : function(data) { //alert("column=="+JSON.stringify(data)); myCols = data; }, error : function(e) { $.messager.alert('查询失败111!', '访问服务失败!', 'error'); } }); } /*访问后台,获取数据加载表格*/ function _initgrid(reprotvalue,year_value,season_value){ //alert(reprotvalue) if(!reprotvalue){ return; } setColumn(reprotvalue); var url=$.pathname() + '/ws/rcbaobiao/RcBbService/getHuiZongData/'; $.ajax({ url : url, type : 'post', timeout : 15000, async : false, data : { comp_id : compid, report_type:reprotvalue, year:year_value, season:season_value }, dataType : 'json', success : function(data) { if("438-439-440-441-442-444-445".match(new RegExp(reprotvalue))!=null){ $(".c_chart_mainContent").show(); EchartDoJo["echart"+reprotvalue]["fn_echart"](data.rows); }else{ destoryEchart(); $("#chartsContent").empty(); $(".c_chart_mainContent").hide(); } initgridcon(reprotvalue,data); //$(".zongji_td").parent().parent().parent().unbind("mouseover"); }, error : function(e) { $.messager.alert('查询失败!', '访问服务失败!', 'error'); } })/*.done(function(){//该方法为ajax与后台交互时方能用,执行时间为数据获取到并加载完执行 $(parent.document.body).find("iframe").height($(window.document.body).height()+40); $(top.document.body).find("#frmright").height($(window.document.body).height()+40); })*/; } function change() { //value = $(parent.document.body).find("#accordition .current").attr("data-value"); var val = $("#sel").val(); var year_value = $("#BB_YEAR").attr("relvalue"); var season_value = $("#BB_JIDU").attr("relvalue"); // alert(dovalue); _initgrid(dovalue,year_value,season_value); } /*传入data数据,加载表格对象,若ind=0,加载有分组模式的表格对象,否则没有分组,普通的表格 *只有应急指挥与管理机构统计表有分组 **/ function initgridcon(reprotvalue,data){ // alert("myCols=="+myCols); if(reprotvalue==438){ g = $("#maingrid").quiGrid({ //columns: myCols[ind].col, columns: eval('('+myCols+')'), data:data, rownumbers : true, width : "100%", onAfterShowData:function(){setHt();}, //pageSize:10 usePager : false, alternatingRow:false, rowAttrRender: function(rowdata, rowid){ return "总计" == rowdata.COMP_NAME ? "style=\"background-color:#5582b9;\"" : ''; }, groupColumnName: "TYPE", groupColumnDisplay: ''}); }else{ if(g!=undefined){ g.setOptions({groupColumnName: ""}); } g = $("#maingrid").quiGrid({ //columns: myCols[ind].col, columns: eval('('+myCols+')'), data:data, rownumbers : true, isScroll:false, width : "100%", usePager : false, rowAttrRender: function(rowdata, rowid){ return "总计" == rowdata.COMP_NAME ? "style=\"background-color:#5582b9;\"" : ''; }, onAfterShowData:function(){setHt();} }); } } function showGridandCharts(reportvalue,year_value,season_value){ _initgrid(reportvalue,year_value,season_value); //_initCharts(reprotvalue); //setTimeout("setHt();", 100); }; /*初始化图表 * ind值为0时应急指挥与管理机构统计表 * */ /* function _initCharts(ind){ if(ind==438){//应急指挥与管理机构统计表 emergencyCommandAndRegulatoryAgency438(); }else if(ind==439){//应急预案与修编 emergencyCommandAndRegulatoryAgency439(); } }*/ function setHt(){ var height = $("#layout1 .padding_right5").height()+$("#chartsContent").height()+$("#searchCondi").height()+90; $('#layout1').height(height); $('#layout1 .l-layout-left').height(height); $('#layout1 .l-layout-center').height(height); $('#searchPanel').height(height); $(window.document.body).height(height); $(parent.document.body).find("#frmright").height($(window.document.body).height()); } /*****************************************************************************************************************/ /******************************************** echart 图表方法 ***************************************************/ /*****************************************************************************************************************/ var echartImplArr=[]; /*var */ var EchartDoJo={ //应急指挥与应急管理机构 echart438:{fn_echart:YingJiZhiHuiAndGuanLiJiGou}, //应急预案修订 echart439:{fn_echart:YingJiYuAnXiuDing} , //应急培训 echart440: {fn_echart:YingJiPeiXun}, //应急演练 echart441: {fn_echart:YingJiYanLian}, //应急预警和响应统计表 echart442: {fn_echart:YingJiYuJingXiangYing}, //保供电任务统计 echart444: {fn_echart:BaoGongDianRenwu}, //保供电任务明细 echart445: {fn_echart:BaoGongDianMingXi} }; function reSetContent($dom,count){ $dom.empty(); $("#i_chart_descripe").empty(); if(count==2){ $dom.append("
"); $("#i_chart_descripe").append("
"); }else{ $dom.append("
"); $("#i_chart_descripe").append("
"); } } var utils=new Util(); /** * 报告明细 */ function BaoGongDianMingXi(dataParam){ $("#i_chart_descripe").addClass("c_chart_descripe_change"); destoryEchart(); reSetContent($("#chartsContent"),1); var leArr=[]; var select={}; var xAxis=["投入人员","投入车辆","投入应急发电车","投入应急发电机"]; var sArr=[]; for(var index1=0,len=dataParam.length;index1"; tempStr+="
保供电任务名称:"+sArr[0]["data"][0]["data"]["mc"]+"
"; tempStr+="
保供电任务时间:"+sArr[0]["data"][0]["data"]["sj"]+"
"; setSubTitle(tempStr); function loadBaoGongDianMingXiData($dom){ var dataIndex=$dom.attr("data"); setTitle(leArr[dataIndex]+"保供电明细统计图"); var tempStr="
保供电级别:"+sArr[dataIndex]["data"][0]["data"]["jb"]+"
"; tempStr+="
保供电任务名称:"+sArr[dataIndex]["data"][0]["data"]["mc"]+"
"; tempStr+="
保供电任务时间:"+sArr[dataIndex]["data"][0]["data"]["sj"]+"
"; setSubTitle(tempStr); echartImplArr[0].setSeries([sArr[dataIndex]]); } } /** * 报告任务 */ function BaoGongDianRenwu(dataParam){ $("#i_chart_descripe").removeClass("c_chart_descripe_change"); destoryEchart(); reSetContent($("#chartsContent"),1); var leArr=[]; /*var select={};*/ var xAxis=["特级","一级","二级","三级"]; var sArr=[]; for(var index1=0,len=dataParam.length;index1"; tempStr+="
参演人数:"+sArr[0]["data"][0]["data"]["cyrs"]+"
"; tempStr+="
投入金额:"+sArr[0]["data"][0]["data"]["trje"]+"
"; setSubTitle(tempStr); function loadYingJiYanLianData($dom){ var dataIndex=$dom.attr("data");; setTitle(leArr[dataIndex]+"应急演练统计图"); var tempStr="
举办次数:"+sArr[dataIndex]["data"][0]["data"]["jbcs"]+"(次)
"; tempStr+="
参演人数:"+sArr[dataIndex]["data"][0]["data"]["cyrs"]+"(万元)
"; tempStr+="
投入金额:"+sArr[dataIndex]["data"][0]["data"]["trje"]+"(人)
"; setSubTitle(tempStr); echartImplArr[0].setSeries([sArr[dataIndex]]); } } /** * 应急培训 * dataParam */ function YingJiPeiXun(dataParam){ $("#i_chart_descripe").addClass("c_chart_descripe_change"); destoryEchart(); reSetContent($("#chartsContent"),1); var leArr=[]; var select={}; var xAxis=["集中脱产","网络","其他"]; var sArr=[]; for(var index1=0,len=dataParam.length;index1"; tempStr+="
投入:"+sArr[0]["data"][0]["data"]["tu"]+"(万元)
"; tempStr+="
培训数量:"+sArr[0]["data"][0]["data"]["pxsl"]+"(人)
"; setSubTitle(tempStr); createList(leArr,loadYingJiPeiXunData); function loadYingJiPeiXunData($dom){ var dataIndex=$dom.attr("data"); setTitle(leArr[dataIndex]+"应急培训统计图"); var tempStr="
举办次数:"+sArr[dataIndex]["data"][0]["data"]["jbcs"]+"(次)
"; tempStr+="
投入:"+sArr[dataIndex]["data"][0]["data"]["tu"]+"(万元)
"; tempStr+="
培训数量:"+sArr[dataIndex]["data"][0]["data"]["pxsl"]+"(人)
"; setSubTitle(tempStr); echartImplArr[0].setSeries([sArr[dataIndex]]); } } /** * 应急预案修订 */ function YingJiYuAnXiuDing(dataParam){ $("#i_chart_descripe").removeClass("c_chart_descripe_change"); destoryEchart(); reSetContent($("#chartsContent"),1); var leArr=[]; var select={}; var xAxis=["总体预案","事故灾难","自然灾害","社会安全事件","部门预案","现场处置方案"]; var sArr=[]; for(var index1=0,len=dataParam.length;index1"+arrData[index]+""; }else{ htmlstr+="
  • "+arrData[index]+"
  • "; } } $("#i_department_list").append(htmlstr); $("#i_list_text").on("click",function(){ if($(this).attr("data")==1){ var _this=this; $("#i_department_list").addClass("c_department_list_change"); $("#i_department_list").find("ul").find("li").show(); $("#i_department_list").on("mouseleave",function(){ $("#i_department_list").removeClass("c_department_list_change"); $("#i_department_list").find("ul").find("li").hide(); $(_this).attr("data",1); }); $(this).attr("data",2); }else{ $("#i_department_list").removeClass("c_department_list_change"); $("#i_department_list").find("ul").find("li").hide(); $(this).attr("data",1); } }); $("#i_department_list").find("ul").on("click","li",function(){ $("#i_department_list").find("ul").find(".c_department_lionClick").removeClass("c_department_lionClick"); $(this).addClass("c_department_lionClick"); callFn($(this)); }); } /** * 设置标题 * @param title */ function setTitle(title){ $("#i_chart_head").empty(); $("#i_chart_head").text(title); } /** * 设置二级标题 * @param title */ function setSubTitle(title){ $("#i_echart_title1").empty(); $("#i_echart_title1").html(title); } /** *销毁echart */ function destoryEchart(){ if(!(echartImplArr.length>0))return; for(var index=0,len=echartImplArr.length;index