| | |
| | | var index = $(t).attr("but-index");
|
| | | //delindex = index;
|
| | | $("#delete").attr("value",index);
|
| | | //setCookie("delindex",index);
|
| | | //setcookiedit(index);
|
| | | //delparm = battDeleteparm(index);
|
| | | //var parm = battDeleteparm();
|
| | | //console.info(parm);
|
| | | //delBatt(parm);
|
| | | return ;
|
| | | }
|
| | | function getEditButIndex(t){
|
| | | console.warn($(t).attr("but-index")+' 修改');
|
| | | var index = $(t).attr("but-index");
|
| | | setcookiedit(index);
|
| | | //window.location.href="batt-infor-unapproved-edit.html"; |
| | | var parm = seteditparm(index);
|
| | | window.location.href="batt-infor-unapproved-edit.html"; |
| | | return ;
|
| | | }
|
| | |
|
| | |
| | | battDeleteparm(delindex);
|
| | | });
|
| | |
|
| | | var arrdata = new Array(); |
| | | var arrTh = [ '机房编号', '省', '城市','区县','机房名称','设备名称','机房IP','FBS设备ID(重要)','FBS设备IP(重要)','子网掩码','网关','FBS设备名称','FBS电池索引(0-3)','电池组ID','机房内电池组编号','电池组名称','浮充电压阀值(V)','离线电压阀值(V)','浮充电流阀值(A)','单体数量','标称容量(AH)','标称单体电压(V)','标称单体内阻(mΩ)','标称单体电导','单体电压次低偏移量(V)','负载电流(A)','最大核容电流(A)','基站号码','电池品牌','电池型号','电池生产日期','投入使用日期','安装人员',''];
|
| | | dataArr = [];
|
| | | var startTime = "1980-01-01";
|
| | |
| | | data=data.data
|
| | | console.info(data);
|
| | | for(var i=0;i<data.length;i++){
|
| | | arrdata.push(data[i]);//存储数据
|
| | | arrTd[index++] = data[i].binf.StationId;
|
| | | arrTd[index++] = data[i].binf.StationName1;
|
| | | arrTd[index++] = data[i].binf.StationName2;
|
| | |
| | | });
|
| | | }
|
| | |
|
| | | //查询当前机房有几个电池组,并set入COOKIE
|
| | | function searchHomeInfoByName(id) {
|
| | | var groupName = new Array();
|
| | | //var index = 0;
|
| | | var num =new Array();
|
| | | var groupId = new Array();
|
| | | var eleditparm = new Array();
|
| | | //var index1 = 0;
|
| | | var temp = {
|
| | | binf:{
|
| | | StationId:id, // 省 |
| | | }
|
| | | ,page: {
|
| | | pageCurr: 1
|
| | | ,pageSize: 100
|
| | | }
|
| | | }; |
| | | // 请求后台
|
| | | $.ajax({
|
| | | type: "post", |
| | | url: "Battinf_applyAction!serchbystationId", |
| | | async:true, |
| | | dataType:'json',
|
| | | data:"json="+JSON.stringify(temp), |
| | | success: function(data){
|
| | | var data = JSON.parse(data.result)
|
| | | console.info(data);
|
| | | if(data.code!=0){
|
| | | data = data.data;
|
| | | for(var i=0;i<data.length;i++){
|
| | | console.info(data[i]);
|
| | | groupName[i] = data[i].binf.BattGroupName;
|
| | | num[i] = data[i].num;
|
| | | groupId[i] = data[i].binf.BattGroupId;
|
| | | var eleditparmarr={
|
| | | groupname : data[i].binf.BattGroupName,
|
| | | num : data[i].num,
|
| | | groupId :data[i].binf.BattGroupId,
|
| | | }
|
| | | eleditparm.push(eleditparmarr); |
| | | }
|
| | | console.info(eleditparm); |
| | | } |
| | | var json = JSON.stringify(groupName);
|
| | | var json1 =JSON.stringify(num);
|
| | | var json2 = JSON.stringify(groupId);
|
| | | |
| | | //console.info(eleditparm)
|
| | | var jsonedit = JSON.stringify(eleditparm);
|
| | | setCookie("eleditparm",jsonedit); |
| | | setCookie("eleparmindex",json); //电池组名称
|
| | | setCookie("eleparmnum",json1); //电池组编号
|
| | | console.info(groupName);
|
| | | setCookie("elegroupid",json2);
|
| | | console.info(json2);
|
| | | window.location.href="batt-infor-unapproved-edit.html"; |
| | | }
|
| | | }); |
| | | } |
| | | function setcookiedit(index){
|
| | | var arrcookie = new Array(); |
| | | for(var i=0;i<33;i++){//共35项 ,33数据有用
|
| | | var value = Math.floor((arrTh.length)*index); //35
|
| | | //console.info(value);
|
| | | value = Math.floor(value+i);
|
| | | if(i==13){//新建功能,电池组ID默认为当页最后一个电池组ID号加1
|
| | | var groupid = Math.floor(arrTd[value]+1);
|
| | | arrcookie.push(groupid);
|
| | | function seteditparm(index){
|
| | | if(arrdata.length>0){ //存入的为所有已查出数据 |
| | | console.info(arrdata); |
| | | var arr= creatYanshouObj(arrdata,index);//申请验收方法。
|
| | | return arr;
|
| | | }else{
|
| | | arrcookie.push(arrTd[value]);
|
| | | alert("请等待几秒后再提交申请");
|
| | | }
|
| | | }
|
| | | arrcookie.push($("#newbattnum").val());
|
| | | var id = arrcookie[0]; //机房ID
|
| | | //console.info(id);
|
| | | var json=window.JSON.stringify(arrcookie);
|
| | | setCookie("eleparm",json); //这里setcookie,若有上一条cookie则清空上一笔
|
| | | searchHomeInfoByName(id); |
| | |
|
| | | function creatYanshouObj(arrdata,index){
|
| | | var StationId = arrdata[index].binf.StationId;
|
| | | //console.info(StationId);
|
| | | var arr = new Array(); //初始化传参数组
|
| | | for(var i=0;i<arrdata.length;i++){//一次验收该机房下的所有电池组构建对象 。
|
| | | if(StationId == arrdata[i].binf.StationId){ |
| | | var obj = {
|
| | | binf:{
|
| | | StationId : arrdata[i].binf.StationId, // 机房编号
|
| | | StationName : (arrdata[i].binf.StationName1+"-"+ arrdata[i].binf.StationName2+"-"+arrdata[i].binf.StationName5+"-"+arrdata[i].binf.StationName3), // 拼接机房名称
|
| | | StationName1 :arrdata[i].binf.StationName1, // 省
|
| | | StationName2 : arrdata[i].binf.StationName2, // 市
|
| | | StationName5 : arrdata[i].binf.StationName5, // 区/县
|
| | | StationName3 : arrdata[i].binf.StationName3, // 机房名称
|
| | | StationName4 : arrdata[i].binf.StationName5, // 设备名称
|
| | | StationIp :arrdata[i].binf.StationIp, //机房ip
|
| | | FBSDeviceId : arrdata[i].binf.FBSDeviceId, //设备id
|
| | | FbsDeviceIp : arrdata[i].binf.FbsDeviceIp, //设备ip
|
| | | FbsDeviceIp_YM : arrdata[i].binf.FbsDeviceIp_YM, // 设备掩码
|
| | | FbsDeviceIp_WG : arrdata[i].binf.FbsDeviceIp_WG , // 网关
|
| | | FBSDeviceName : arrdata[i].binf.FBSDeviceName, //设备名称
|
| | | GroupIndexInFBSDevice : arrdata[i].binf.GroupIndexInFBSDevice, //fbs设备索引
|
| | | BattGroupId : arrdata[i].binf.BattGroupId, //电池组id
|
| | | BattGroupNum : arrdata[i].binf.BattGroupNum , //机房内电池组编号
|
| | | BattGroupName :arrdata[i].binf.BattGroupName, //电池组索引
|
| | | FloatVolLevel : arrdata[i].binf.FloatVolLevel, //浮充电压阀值
|
| | | OfflineVolLevel : arrdata[i].binf.OfflineVolLevel, //离线电压阀值
|
| | | BattFloatCurrent : arrdata[i].binf.BattFloatCurrent, //浮充电流阀值
|
| | | MonCount : arrdata[i].binf.MonCount, //单体数量
|
| | | MonCapStd : arrdata[i].binf.MonCapStd, //标称容量
|
| | | MonVolStd : arrdata[i].binf.MonVolStd, //标称电压
|
| | | MonResStd : arrdata[i].binf.MonResStd, //标称内阻
|
| | | MonSerStd : arrdata[i].binf.MonSerStd, //标称电导
|
| | | MonVolLowToAvg : arrdata[i].binf.MonVolLowToAvg, //单体电压次低偏移量
|
| | | |
| | | Load_curr : arrdata[i].binf.Load_curr, //负载电流
|
| | | DisCurrMax : arrdata[i].binf.DisCurrMax, //最大核容电流
|
| | | station_phone : arrdata[i].binf.station_phone, //基站号码
|
| | | |
| | | BattProducer : arrdata[i].binf.BattProducer, //电池品牌
|
| | | BattModel : arrdata[i].binf.BattModel, //电池型号
|
| | | BattProductDate : arrdata[i].binf.BattProductDate+" 00:00:00", //电池生产日期
|
| | | BattInUseDate : arrdata[i].binf.BattInUseDate+" 00:00:00", //电池使用日期
|
| | | install_user : arrdata[i].binf.install_user, //安装人员
|
| | | }
|
| | | }
|
| | | arr.push(obj);
|
| | | }
|
| | | } |
| | | console.info(arr); |
| | | //applyendyanshou(arr);//申请验收方法。
|
| | | var json=window.JSON.stringify(arr);
|
| | | setCookie("eleparm",json); //这里setcookie,若有上一条cookie则清空上一笔
|
| | | return arr;
|
| | | }
|
| | | |
| | | function delBatt(parm){
|
| | | $.ajax({
|
| | | type: "post",
|
| | |
| | | function battDeleteparm(index){
|
| | | console.info(arrTh.length);
|
| | | console.info(index);
|
| | | var delindex = Math.ceil(arrTh.length*index);
|
| | | var delindex = Math.ceil(arrTh.length*index);//在ARRTD上第几列
|
| | | var stationid = arrTd[delindex];
|
| | | console.info(stationid);
|
| | | searchdelnum(stationid,index,delindex);
|
| | | /*var arr = new Array();
|
| | | var temp = getCookie("eleparm");
|
| | | var tempindex = getCookie("eleparmindex");
|
| | | var tempnum = getCookie("eleparmnum");
|
| | | var tempgroupid = getCookie("elegroupid");
|
| | | temp=JSON.parse(temp);
|
| | | tempindex = JSON.parse(tempindex);
|
| | | tempnum =JSON.parse(tempnum);
|
| | | tempid = JSON.parse(tempgroupid);
|
| | | |
| | | console.info(temp[12]);
|
| | | //for(var i=0;i<tempindex.length;i++){
|
| | | //console.info(battString);
|
| | | var obj = {
|
| | | //apply_date : new Date().format("yyyy-MM-dd hh:mm:ss"),
|
| | | num : tempnum[temp[12]],
|
| | | binf:{
|
| | | StationId : temp[0], // 机房编号
|
| | | StationName : (temp[1]+"-"+temp[2]+"-"+temp[4]+"-"+temp[5]), // 拼接机房名称
|
| | | StationName1 :temp[1], // 省
|
| | | StationName2 : temp[2], // 市
|
| | | StationName5 : temp[3], // 区/县
|
| | | StationName3 : temp[4], // 机房名称
|
| | | StationName4 :temp[5], // 设备名称
|
| | | StationIp : temp[6], //机房ip
|
| | | FBSDeviceId : temp[7], //设备id
|
| | | FbsDeviceIp : temp[8], //设备ip
|
| | | FbsDeviceIp_YM : temp[9], // 设备掩码
|
| | | FbsDeviceIp_WG : temp[10], // 网关
|
| | | FBSDeviceName : temp[11], //设备名称
|
| | | GroupIndexInFBSDevice : temp[12], //fbs设备索引
|
| | | BattGroupId : tempid[temp[12]], //电池组id
|
| | | BattGroupNum : temp[14], //机房内电池组编号
|
| | | BattGroupName : temp[15], //电池组索引
|
| | | FloatVolLevel : temp[16], //浮充电压阀值
|
| | | OfflineVolLevel : temp[17], //离线电压阀值
|
| | | BattFloatCurrent : temp[18], //浮充电流阀值
|
| | | MonCount : temp[19], //单体数量
|
| | | MonCapStd : temp[20], //标称容量
|
| | | MonVolStd : temp[21], //标称电压
|
| | | MonResStd : temp[22], //标称内阻
|
| | | MonSerStd : temp[23], //标称电导
|
| | | MonVolLowToAvg : temp[24], //单体电压次低偏移量
|
| | | |
| | | Load_curr : temp[25], //负载电流
|
| | | DisCurrMax : temp[26], //最大核容电流
|
| | | station_phone : temp[27], //基站号码
|
| | | |
| | | BattProducer : temp[28], //电池品牌
|
| | | BattModel : temp[29], //电池型号
|
| | | BattProductDate : temp[30]+" 00:00:00", //电池生产日期
|
| | | BattInUseDate : temp[31]+" 00:00:00", //电池使用日期
|
| | | install_user : temp[32], //安装人员
|
| | | }
|
| | | }
|
| | | arr.push(obj);
|
| | | //}
|
| | | //console.info(arr);
|
| | | return arr;*/
|
| | |
|
| | | }
|
| | |
|
| | | function searchdelnum(id,index,delindex) {
|
| | | function searchdelnum(id,index,delindex) {//删除未审批,构造传参
|
| | | var groupName = new Array();
|
| | | //var index = 0;
|
| | | var num =new Array();
|