//报表类型 var type; var mycol; var testData={"rows":[{}]}; var g; //报表名 var report_name; var dept ; var tableObj = getThing($.pathname() +"/ws/xianlutingyun/XianlutingyunService/getTableObj",{},'text'); //var deptLevel = getThing($.pathname() +"/ws/xianlutingyun/XianlutingyunService/getDeptLevel",{"comp_id":compId},"text"); tableObj = eval('('+tableObj+')'); var url = decodeURI(window.location.href); // 获取(表头) function initComplete() { if(url.indexOf("?")>-1 ){ var data = url.split("?"); if(data.length>2){ type = data[1]; report_name = data[2]; $("#type").val(type); $("#report_name").val(report_name); }else{ var getType = data[1].split("&"); if(getType.length==3 && data[1].indexOf("deptLevel")==-1){ type = getType[0].split("=")[1]; }else{ var reportName = getType[0].split("=")[1]; var deptLevel = getType[2].split("=")[1]; if(reportName=="变电站停运及恢复情况统计表"){ if(deptLevel=="1" || deptLevel=="2"){ reportName = "变电站停运及恢复统计表"; }else{ reportName = "变电站停运及恢复情况表"; } } console.log(type); type = tableObj[reportName]; $(".pic").hide(); } } } getColumns(type); init(mycol,testData); } function init(cols,data) { g = $("#maingrid").quiGrid({ columns : cols, data : data, usePager:false, sortName : 'id', rownumbers : true, enabledEdit : true, // 编辑用 height : '100%', width : "100%", multihead : true }); } function getColumns(type) { if(type=="100"){ mycol=[{hide:"true",name:"FD_OBJECTID"}, {display:"支援单位",name:"COMP_NAME",id:"COMP_ID",width:'80'}, // {display:"支援单位",name:"COMP_NAME",id:"COMP_ID",minWidth:'100'/*,editor:{type:"text",inputMode:"positiveDecimal",maxlength:"20"}*/}, {display:"被支援单位",name:"BZYDW_ID",editor:{type:"text",inputMode:"text",maxlength:"15"},width:'11%'}, {display:"500kV线路",columns:[ { display:"累计完成",columns:[ {display:"组塔(基)",name:"LJWCZT_500",isCount:"0",width:'5%'}, {display:"架线(km)",name:"LJWCJX_500",isCount:"0",width:'5%'} ] } ]}, {display:"220kV线路",columns:[ { display:"累计完成",columns:[ {display:"组塔(基)",name:"LJWCZT_220",isCount:"0",width:'5%'}, {display:"架线(km)",name:"LJWCJX_220",isCount:"0",width:'5%'} ] } ]}, {display:"110kV线路",columns:[ { display:"累计完成",columns:[ {display:"组塔(基)",name:"LJWCZT_110",isCount:"0",width:'5%'}, {display:"立杆(根)",name:"LJWCLG_110",isCount:"0",width:'5%'}, {display:"架线(km)",name:"LJWCJX_110",isCount:"0",width:'5%'} ] } ]}, {display:"10kV线路",columns:[ { display:"今日完成",columns:[ {display:"组塔(基)",name:"JRWCZT_10",isCount:"0",width:'5%'}, {display:"扶杆(根)",name:"JRWCFG_10",isCount:"0",width:'5%'}, {display:"立杆(根)",name:"JRWCLG_10",isCount:"0",width:'5%'}, {display:"架线(km)",name:"JRWCJX_10",isCount:"0",width:'5%'} ] }, { display:"累计完成",columns:[ {display:"组塔(基)",name:"LJWCZT_10",isCount:"0",width:'5%'}, {display:"扶杆(根)",name:"LJWCFG_10",isCount:"0",width:'5%'}, {display:"立杆(根)",name:"LJWCLG_10",isCount:"0",width:'5%'}, {display:"架线(km)",name:"LJWCJX_10",isCount:"0",width:'5%'} ] } ]}, {display:"低压线路",columns:[ { display:"今日完成",columns:[ {display:"扶杆(根)",name:"JRWCFG_DY",isCount:"0",width:'5%'}, {display:"立杆(根)",name:"JRWCLG_DY",isCount:"0",width:'5%'}, {display:"架线(km)",name:"JRWCJX_DY",isCount:"0",width:'5%'} ] }, { display:"累计完成",columns:[ {display:"扶杆(根)",name:"LJWCFG_DY",isCount:"0",width:'5%'}, {display:"立杆(根)",name:"LJWCLG_DY",isCount:"0",width:'5%'}, {display:"架线(km)",name:"LJWCJX_DY",isCount:"0",width:'5%'} ] }]}, {display:"配变",columns:[ { display:"今日完成",columns:[ {display:"修复(台)",name:"JRWCXF_PB",isCount:"0",width:'5%'} ] }, { display:"累计完成",columns:[ {display:"修复(台)",name:"LJWCXF_PB",isCount:"0",width:'5%'} ] } ]}, {display:"累计完成比例",name:"LJWCBL",width:'5%'}, {display:"今日完成其他工作",name:"WCQTGZ",width:'5%'}, {display:"遗留问题",name:"YLWT",width:'5%'} ]; }else{ var urls = $.pathname() + "/ws/xianlutingyun/XianlutingyunService/getNoEditColumns"; $.ajax({ url : urls, type : 'post', timeout : 15000, async : false, data : { "report_type" : type, }, dataType : 'text', success : function(data) { mycol=eval('('+ data+')'); }, error : function(e) { $.messager.alert('查询失败!', '访问服务失败!', 'error'); } }); } } function _addStatus(rowdata, rowindex, value, column){ return "
"+''+"
"; } function goback(){ if(url.indexOf("&")==-1){ window.parent.document.getElementById("frmright").setAttribute("src", encodeURI("/nwyj/page/business/em/report/Show_Type.html?"+$("#type").val()+"?"+$("#report_name").val())); }else{ var urlData = url.split("?")[1].split("&"); if(urlData.length==3){ var fd_objectid = urlData[1].split("=")[1]; var go = urlData[2].split("=")[1]; if(go=="yj"){ window.parent.document.getElementById("frmright").setAttribute("src", encodeURI("/nwyj/page/business/em/report/ReportRequireData.html?fd_id="+fd_objectid)); }else { window.parent.document.getElementById("frmright").setAttribute("src", encodeURI("/nwyj/page/business/em/report/reportDept/ReportRequireData.html?fd_id="+fd_objectid)); } } } }