123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264 |
- 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; i<content.length; i++){
- if(tempContent[i]=="content_min"){
- content1+= "'"+"250" + "'" + ",";
- }
- if(tempContent[i]=="content_mid"){
- content1= "251" + ",";
- content2="500" ;
- }
- if(tempContent[i]=="content_max"){
- content1="501";
- content2="99999999999999";
- }
- }
- }
-
- //电压等级
- var level = $('#CAR_LEVEL_265').attr("relValue");
- //储能方式
- var storedtype = $('#STORED_ENERGY_TYPE_265').attr("relValue");
- //可否调用
- var isUsed = $('#IS_USED_265').attr("relValue");
- //取所属单位
- var units = $('#COMP_ID_265').val();
-
- //电压等级
- var templevel = level+",";
- var temp = templevel.split(",");
- var valueType1 = "";
- for(var i=0; i<temp.length; i++){
- if(temp[i]=="level_max"){
- valueType1+= "'" + "139" +"'" +",";
- }
- if(temp[i]=="level_min"){
- valueType1+= "'" + "138" +"'" +",";
- }
- }
- var valueType = null;
- if(level.length>0){
- valueType = valueType1.substring(0,valueType1.length-1);
- }
-
- //储能
- var energytype = storedtype+",";
- var temp1 = energytype.split(",");
- var energytype1 = "";
- for(var i=0; i<temp1.length; i++){
- if(temp1[i]=="generator"){
- energytype1+= "'" + "1" +"'" +",";
- }
- if(temp1[i]=="ups"){
- energytype1+= "'" + "2" +"'" +",";
- }
- if(temp1[i]=="fly_circle"){
- energytype1+= "'" + "3" +"'" +",";
- }
- }
- var valueType2 = null;
- if(storedtype.length>0){
- valueType2 = energytype1.substring(0,energytype1.length-1);
- }
-
- //调用
- var isused1 = isUsed + ",";
- var temp2 = isused1.split(",");
- var isused3 = "";
- for(var i=0; i<temp2.length; i++){
- if(temp2[i]=="kused"){
- isused3+= "'" + "1" +"'" +",";
- }
- if(temp2[i]=="bused"){
- isused3+= "'" + "2" +"'" +",";
- }
- }
- var valueType3 = null;
- if(isUsed.length>0){
- 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<deptIdsTemp.length; i++){
- arrFF+="'"+deptIdsTemp[i]+"'"+",";
- }
- deptId = arrFF.substring(0,arrFF.length-1);
- }
-
- $.post($.pathname()+ "/ws/generatorcar/GeneratorCarService/getCarInfo",{id : deptName,content1:content1,content2:content2,valueType:valueType,valueType2:valueType2,valueType3:valueType3,deptId:deptId},function (data){
-
- json = data;
- //给表格数据赋值
- gridData= data;
- //初始化表格
- initCompletes(json);
-
- });
-
- }
-
-
- function addStatus(rowdata, rowindex, value, column){
- var comp_id='"'+rowdata.dept_id+'"';
- var name = '"'+value+'"';
- return "<a href='javascript:newHtml("+comp_id+","+name+")'>" + value +" </a>";
- }
- 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 '<a href="javascript:void(0)" '
- + 'onclick=showDetail("'
- + rowdata.dept_id
- + '",'+'"'+column.name+ '",'+'"'+value+'")>'+value+'</a>';
- }
- 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;
|