var deptName = resolveUrl().dept_id; function resolveUrl(){ var encondeCondition=window.location.search; var condition= decodeURI(decodeURI(encondeCondition.substring(1,encondeCondition.length))); var conditionArr=condition.split("&"); var condJson={}; for(var item in conditionArr){ var temArr=conditionArr[item].split("="); condJson[temArr[0]]=temArr[1]; } userInfo = condJson; return condJson; }; // 数据表格 var g; var gridData; var myCols1 = [{ display : '0-250kW', "name" : 'content_min', minWidth : 60, width : "8%",render:showMsg }, { display : '251-500kW', "name" : 'content_mid', minWidth : 60, width : "8%",render:showMsg }, { display : '501kW及以上', "name" : 'content_max', minWidth : 60, width : "8%",render:showMsg }]; var myCols2 = [{ display : '380V', "name" : 'level_max', minWidth : 60, width : "8%",render:showMsg }, { display : '10kV', "name" : 'level_min', minWidth : 60, width : "8%",render:showMsg }]; var myCols3 = [{ display : '发电机', "name" : 'generator', minWidth : 60, width : "8%",render:showMsg }, { display : 'UPS', "name" : 'ups', minWidth : 60, width : "8%",render:showMsg }, { display : '磁飞轮', "name" : 'fly_circle', minWidth : 60, width : "8%",render:showMsg }]; var myCols4 = [{ display : '可调拨', "name" : 'kused', minWidth : 60, width : "5%",render:showMsg }, { display : '不可调拨', "name" : 'bused', minWidth : 60, width : "5%",render:showMsg }]; $(function(){ $("body").eq(0).showLoading(); $.post($.pathname()+ "/ws/generatorcar/GeneratorCarService/getCarInfo",{id : deptName},function (data){ //初始化表格 initCompletes(data); $("body").eq(0).hideLoading(); gridData=data; }); }); var columns= [ { display : '供电局',"name" : 'name',id : 'name',width : "10%",dept_id:'dept_id',align : 'center',render : addStatus, frozen: true }, { display : '按容量分类(辆)',columns : myCols1,width : "8%",align : 'center' }, { display : '按电压等级分类(辆)',columns : myCols2,width : "8%",align : 'center' }, { display : '按储能方式分类(辆)',columns : myCols3,width : "8%",align : 'center' }, { display : '按调拨分类(辆)',columns : myCols4,width : "8%",align : 'center' }, { display : '总数量(辆)',"name" : 'num',width : "8%",align : 'center' }, { display : '总容量(kW)',"name" : 'sum',width : "8%",align : 'center' } ]; var json =""; var loadData; function initCompletes(json){ g = $("#maingrid").quiGrid({ columns: columns, data:json, rownumbers : true, usePager : false }); // $(parent.document.body).find("iframe").height($(window.document.body).height()+30); // $(top.document.body).find("iframe").height($(window.document.body).height()+30); } //发送请求,从后台获取数据 function getNewValue(){ //容量 var content = $('#CAR_CONTENT_265').attr("relValue"); var tempContent = content.split(","); var content1 = ""; var content2 = ""; if(content.length>0){ for(var i =0; i0){ valueType = valueType1.substring(0,valueType1.length-1); } //储能 var energytype = storedtype+","; var temp1 = energytype.split(","); var energytype1 = ""; for(var i=0; i0){ valueType2 = energytype1.substring(0,energytype1.length-1); } //调用 var isused1 = isUsed + ","; var temp2 = isused1.split(","); var isused3 = ""; for(var i=0; i0){ valueType3 = isused3.substring(0,isused3.length-1); } //单位 var leng = units.length; var deptId = null; if(leng>0){ var deptIdsTemp = units.split(","); var arrFF = ""; for(var i=0; i" + value +" "; } function newHtml(comp_id,name){ if(name=="总计"){ return; }else if(deptName==comp_id){ return; }else{ window.open("/nwyj/page/business/am/resource/ledger/generator-car-poll1.jsp?"+comp_id); // window.location.href = "/nwyj/page/business/am/resource/expert/expert-poll.jsp?"+comp_id; // alert(comp_id); } } function showMsg(rowdata ,rowindex,value,column){ return ''+value+''; } function showDetail(index,name,val){ if(index=="11111"){ return; } return top.Dialog.open({URL:"/nwyj/page/business/am/resource/ledger/windowgenerator-car1.jsp?"+index+"?"+name,ID:"window1",Title:"发电车",ShowMaxButton:true,ShowMinButton:true,Width:1100,Height:500}); } $.messager=top.Dialog;