<!DOCTYPE html>
|
<html lang="en">
|
<head>
|
<meta charset="UTF-8">
|
<title>修改电池组信息配置</title>
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
<link rel="stylesheet" href="mobilCss/jquery.mobile-1.4.5.min.css"/>
|
<link href="mobilCss/mobiscroll.core-2.5.2.css" rel="stylesheet" type="text/css" />
|
<link href="mobilCss/mobiscroll.animation-2.5.2.css" rel="stylesheet" type="text/css" />
|
<link rel="stylesheet" type="text/css" href="css/tbl.css">
|
<script type="text/javascript" src="mobilJs/jquery-1.8.2.js"></script>
|
<script src="mobilJs/mobiscroll.core-2.5.2.js" type="text/javascript"></script>
|
<script src="mobilJs/mobiscroll.core-2.5.2-zh.js" type="text/javascript"></script>
|
<script src="mobilJs/mobiscroll.datetime-2.5.1.js" type="text/javascript"></script>
|
<script src="mobilJs/mobiscroll.datetime-2.5.1-zh.js" type="text/javascript"></script>
|
<script type="text/javascript" src="js/tbl.js"></script>
|
<script type="text/javascript" src="mobilJs/base.js"></script>
|
<script type="text/javascript" src="mobilJs/jquery.mobile-1.4.5.min.js"></script>
|
<style type="text/css">
|
|
table {
|
margin-top:.5em;
|
border-collapse:separate;
|
border-spacing:0 .5em;
|
}
|
|
tbody tr td{
|
overflow: hidden;
|
text-overflow:ellipsis;
|
white-space: nowrap;
|
}
|
.uncheck{
|
background-color: #dddddd38!important;
|
color: #bdbdbdc4!important;
|
}
|
.ui-btn-icon-right {
|
padding-right: 2em;
|
}
|
.hbg{
|
background-color:#ddd9;
|
}
|
#battdata {
|
background-color:#dddddd54
|
}
|
.ui-select .ui-btn select{
|
width:77%;
|
}
|
.ptr0{
|
position: absolute;
|
top: 0;
|
right: 0;
|
margin:0!important;
|
}
|
#newbattnum-button{
|
padding: 1em 1.9em;
|
}
|
</style>
|
<link rel="stylesheet" href="css/fgpanel.css">
|
</head>
|
<body>
|
<div data-role="page">
|
|
<!-- 头部内容 -->
|
<div data-role="header" data-position="fixed">
|
<a href="ele-param2.html" target="_top" class="ui-btn ui-corner-all ui-shadow ui-icon-back ui-btn-icon-left" style="padding-top: 0.7em; padding-bottom: 0.7em;">返回</a>
|
<h1>修改电池组信息配置</h1>
|
<!-- <div data-role="collapsible" data-type="horizontal" class="ui-btn-right" style="padding-bottom:-0.7em; padding-top:-0.7em;" >
|
<h1 id="alwaysRight">新建</h1>
|
<div>
|
<h1 class="full-width">
|
<a href="" target="_top" style="text-decoration:none;">1个电池组</a>
|
</h1>
|
<h1 class="full-width">
|
<a href="" target="_top" style="text-decoration:none;">2个电池组</a>
|
</h1>
|
<h1 class="full-width">
|
<a href="" target="_top" style="text-decoration:none;">3个电池组</a>
|
</h1>
|
</div>
|
</div> -->
|
<fieldset data-role="controlgroup" class="ptr0" >
|
|
|
<select id="newbattnum" data-mini="true">
|
<option value=0>新建电池组</option>
|
|
</select>
|
|
|
</fieldset>
|
</div>
|
<!-- 主体内容 -->
|
<div data-role="main">
|
<!-- <div class="set-option"> -->
|
<table class="layout-set">
|
<tbody>
|
<tr>
|
<td>机房编号</td>
|
<td>
|
<input type="text" id="StationId" class="unable" data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>省</td>
|
<td>
|
<input type="text" id="station_name1"class="unable" data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>城市</td>
|
<td>
|
<input type="text" id="city" class="unable"data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>区县</td>
|
<td>
|
<input type="text" id="county" class="unable"data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>机房名称</td>
|
<td>
|
<input type="text" id="StationName3"class="unable" data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>设备名称</td>
|
<td>
|
<input type="text" id="StationName4" data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>机房IP</td>
|
<td>
|
<input type="text" id="StationIp" data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>FBS设备ID(重要)</td>
|
<td>
|
<input type="text" id="FBSDeviceId" class="unable" data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>FBS设备IP(重要)</td>
|
<td>
|
<input type="text" id="FbsDeviceIp" class="unable" data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>子网掩码</td>
|
<td>
|
<input type="text" id="FbsDeviceIp_YM" class="unable" data-mini="true" value="456"/>
|
</td>
|
</tr>
|
<tr>
|
<td>网关</td>
|
<td>
|
<input type="text" id="FbsDeviceIp_WG" class="unable" data-mini="true" value="456"/>
|
</td>
|
</tr>
|
<tr>
|
<td>FBS设备名称</td>
|
<td>
|
<input type="text" id="FBSDeviceName" data-mini="true" />
|
</td>
|
</tr>
|
|
<tr>
|
<td>机房内电池组编号</td>
|
<td>
|
<input type="text" readonly unselectable="on" value="123" id="BattGroupNum" class="unable" class="uncheck" data-mini="true" />
|
</td>
|
</tr>
|
|
<tr>
|
<td>浮充电压阀值(V)</td>
|
<td>
|
<input type="text" id="FloatVolLevel" data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>离线电压阀值(V)</td>
|
<td>
|
<input type="text" id="OfflineVolLevel" data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>浮充电流阀值(A)</td>
|
<td>
|
<input type="text" id="BattFloatCurrent" data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>单体数量</td>
|
<td>
|
<input type="text" id="MonCount" data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>标称容量(AH)</td>
|
<td>
|
<input type="text" id="MonCapStd" data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>标称单体电压(V)</td>
|
<td>
|
<input type="text" id="MonVolStd" data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>标称单体内阻(mΩ)</td>
|
<td>
|
<input type="text" id="MonResStd" data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>标称单体电导</td>
|
<td>
|
<input type="text" id="MonSerStd" data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>单体电压次低偏移量(V)</td>
|
<td>
|
<input type="text" id="MonVolLowToAvg" data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>负载电流(A)</td>
|
<td>
|
<input type="text" id="Load_curr" data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>最大核容电流(A)</td>
|
<td>
|
<input type="text" id="DisCurrMax" data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>基站号码</td>
|
<td>
|
<input type="text" id="station_phone" data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>电池品牌</td>
|
<td>
|
<input type="text" id="BattProducer" data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>电池型号</td>
|
<td>
|
<input type="text" id="BattModel" data-mini="true" />
|
</td>
|
</tr>
|
<tr>
|
<td>电池生产日期</td>
|
<td>
|
<input id="startTestrecord" type="text" name="appDate" class="appDatefir" value="2000-01-01" />
|
</td>
|
</tr>
|
<tr>
|
<td>投入使用日期 </td>
|
<td>
|
<input id="endTestrecord" type="text" name="appDate" class="appDatesec" value="2017-01-01" />
|
</td>
|
</tr>
|
<tr>
|
<td>安装人员</td>
|
<td>
|
<input type="text" id="install_user" data-mini="true" />
|
</td>
|
</tr>
|
</tbody>
|
</table>
|
<!-- </div> -->
|
<div id="battdata">
|
|
</div>
|
|
|
</div>
|
|
<div data-role="footer" data-position="fixed" data-theme="a">
|
<div data-role="navbar">
|
<ul>
|
<li><a href="#yourPopup" data-rel="popup" class="ui-btn ui-btn-inline ui-corner-all operat-but ui-btn-icon-check" data-position-to="window" data-icon="check" data-role="button">确定</a></li>
|
<li><a href="" id="cancel" data-rel="popup" class="ui-btn ui-btn-inline ui-corner-all operat-but ui-btn-icon-delete" data-position-to="window" data-icon="delete" data-role="button">取消</a></li>
|
</ul>
|
</div>
|
</div>
|
<div data-role="popup" id="yourPopup" class="ui-content" data-overlay-theme="b">
|
<a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn ui-icon-delete ui-btn-icon-notext ui-btn-right">关闭</a>
|
<a href="" data-rel="back" id="sure" class="ui-btn ui-corner-all ui-shadow ui-btn-icon-left ui-icon-check" >提交</a>
|
<a href="" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-icon-left ui-icon-delete" >放弃</a>
|
</div>
|
</div>
|
</body>
|
|
<script type="text/javascript">
|
function creatAllView(num){
|
var allString=''
|
,i=0;
|
if(num>4){return false}
|
for(i=0;i<num;i++){
|
allString+=creatBattView(i);
|
}
|
return $("#battdata").html(allString);
|
}
|
|
|
function creatBattView(index){
|
var count=index+1
|
,battTitle='<div>'+'<h1 class="hbg">'+'电池组'+count+'</h1>'+
|
'<table class="layout-set">'+'<tbody>'+'<tr>'+'<td>'+'设备索引'+'</td>'+'<td>'+'<fieldset data-role="controlgroup" data-type="horizontal">'+'<select>'
|
,allOption=selectedIndex(index)+'</select>'+'</fieldset>'+'</td>'+'</tr>'
|
,battName='<tr>'+'<td>'+'电池组名称'+'</td>'+'<td>'+'<input type="text" '+'id='+'battname'+index+' data-mini="true"'+'value='+'电池组'+count+' />'+'</td>'+'</tr>'+'</tbody>'+'</table>'+'</div>';
|
return battTitle+allOption+battName;
|
|
}
|
|
function selectedIndex(index){
|
var selected='',
|
i=0;
|
for(i=0;i<4;i++){
|
if(i==index){selected+='<option '+'value='+i+' selected'+'>'+i+'</option>';continue;}
|
selected+='<option value='+i+'>'+i+'</option>';
|
|
}
|
|
return selected;
|
}
|
|
function creatBa(a){
|
var battnum=4-a,
|
opstring='';
|
if(a>4&&battnum<=0){return false;}
|
for(var i=0;i<=battnum;i++){
|
|
opstring+='<option value='+i+'>新建'+i+'个电池组</option>';
|
}
|
console.warn(opstring+'ttt');
|
return $('#newbattnum').html(opstring);
|
}
|
var temp = getCookie("eleparm");
|
var tempindex = getCookie("eleparmindex");
|
var tempnum = getCookie("eleparmnum");
|
//var temp
|
//console.info(temp);
|
var tempgroupid = getCookie("elegroupid");
|
console.info(tempgroupid);
|
tempgroupid = JSON.parse(tempgroupid);
|
console.info(tempindex);
|
console.info(tempnum);
|
temp=JSON.parse(temp);
|
tempindex = JSON.parse(tempindex);
|
tempnum =JSON.parse(tempnum);
|
var suoyin = temp[33];
|
var addbattnum = tempindex.length;
|
$(function(){
|
creatAllView(tempindex.length).trigger('create');
|
creatBa(tempindex.length).trigger('create');
|
});
|
|
|
|
|
|
|
</script>
|
<script type="text/javascript">
|
$(function () {
|
//setTimes($("#startTestrecord"),'2000-01-01');
|
//setTimes($("#endTestrecord"),new Date().format('yyyy-MM-dd'));
|
installstartdata(temp);
|
|
});
|
|
function installstartdata(temp){
|
//$("#StationId").value=temp[0];
|
//var t=document.getElementById("station_name1");
|
document.getElementById("StationId").value = temp[0];
|
document.getElementById("station_name1").value = temp[1];
|
document.getElementById("city").value = temp[2]; //市
|
document.getElementById("county").value = temp[3]; //区县
|
document.getElementById("StationName3").value = temp[4]; //机房名称
|
document.getElementById("StationName4").value = temp[5]; //设备名称
|
document.getElementById("StationIp").value = temp[6]; //设备IP
|
document.getElementById("FBSDeviceId").value = temp[7];
|
document.getElementById("FbsDeviceIp").value = temp[8];
|
document.getElementById("FbsDeviceIp_YM").value = temp[9];
|
document.getElementById("FbsDeviceIp_WG").value = temp[10];
|
document.getElementById("FBSDeviceName").value = temp[11];
|
//document.getElementById("GroupIndexInFBSDevice").value = temp[12];
|
//document.getElementById("BattGroupId").value = temp[13];
|
document.getElementById("BattGroupNum").value = temp[14];
|
//document.getElementById("BattGroupName").value = temp[15];
|
document.getElementById("FloatVolLevel").value = temp[16];
|
document.getElementById("OfflineVolLevel").value = temp[17];
|
document.getElementById("BattFloatCurrent").value = temp[18];
|
document.getElementById("MonCount").value = temp[19];
|
document.getElementById("MonCapStd").value = temp[20];
|
document.getElementById("MonVolStd").value = temp[21];
|
document.getElementById("MonResStd").value = temp[22];
|
document.getElementById("MonSerStd").value = temp[23];
|
document.getElementById("MonVolLowToAvg").value = temp[24];
|
document.getElementById("Load_curr").value = temp[25];
|
document.getElementById("DisCurrMax").value = temp[26];
|
document.getElementById("station_phone").value = temp[27];
|
document.getElementById("BattProducer").value = temp[28];
|
document.getElementById("BattModel").value = temp[29];
|
//document.getElementById("startTestrecord").value = temp[30];
|
//document.getElementById("endTestrecord").value = temp[31];
|
setTimes($("#startTestrecord"),temp[30]);
|
setTimes($("#endTestrecord"),temp[31]);
|
document.getElementById("install_user").value = temp[32];
|
for(var i=0;i<tempindex.length;i++){
|
battname = "#battname"+i;
|
$(battname).val(tempindex[i]);
|
}
|
}
|
|
// 格式化提交后台信息的对象数组修改
|
function getUpdateArredit(){
|
var arr = new Array();
|
console.info(addbattnum);
|
for(var i=0;i<addbattnum;i++){
|
var battString = "#battname"+i;
|
var index = String(i);
|
console.info(battString);
|
var obj = {
|
StationId : $("#StationId").val(), // 机房编号
|
StationName : ($("#station_name1").val()+"-"+$("#city").val()+"-"+$("#StationName3").val()+"-"+$("#StationName4").val()), // 拼接机房名称
|
StationName1 : $("#station_name1").val(), // 省
|
StationName2 : $("#city").val(), // 市
|
StationName5 : $("#county").val(), // 区/县
|
StationName3 : $("#StationName3").val(), // 机房名称
|
StationName4 : $("#StationName4").val(), // 设备名称
|
StationIp : $("#StationIp").val(), //机房ip
|
FBSDeviceId : $("#FBSDeviceId").val(), //设备id
|
FbsDeviceIp : $("#FbsDeviceIp").val(), //设备ip
|
FbsDeviceIp_YM : $("#FbsDeviceIp_YM").val(), // 设备掩码
|
FbsDeviceIp_WG : $("#FbsDeviceIp_WG").val(), // 网关
|
FBSDeviceName : $("#FBSDeviceName").val(), //设备名称
|
GroupIndexInFBSDevice : i, //fbs设备索引
|
BattGroupId : tempgroupid[i], //电池组id
|
BattGroupNum : $("#BattGroupNum").val(), //机房内电池组编号
|
BattGroupName : $(battString).val(),
|
FloatVolLevel : $("#FloatVolLevel").val(), //浮充电压阀值
|
OfflineVolLevel : $("#OfflineVolLevel").val(), //离线电压阀值
|
BattFloatCurrent : $("#BattFloatCurrent").val(), //浮充电流阀值
|
MonCount : $("#MonCount").val(), //单体数量
|
MonCapStd : $("#MonCapStd").val(), //标称容量
|
MonVolStd : $("#MonVolStd").val(), //标称电压
|
MonResStd : $("#MonResStd").val(), //标称内阻
|
MonSerStd : $("#MonSerStd").val(), //标称电导
|
MonVolLowToAvg : $("#MonVolLowToAvg").val(), //单体电压次低偏移量
|
|
Load_curr : $("#Load_curr").val(), //负载电流
|
DisCurrMax : $("#DisCurrMax").val(), //最大核容电流
|
station_phone : $("#station_phone").val(), //基站号码
|
|
BattProducer : $("#BattProducer").val(), //电池品牌
|
BattModel : $("#BattModel").val(), //电池型号
|
BattProductDate : $("#startTestrecord").val()+" 00:00:00", //电池生产日期
|
BattInUseDate : $("#endTestrecord").val()+" 00:00:00", //电池使用日期
|
install_user : $("#install_user").val(), //安装人员
|
Station_install : 0,
|
}
|
arr.push(obj);
|
}
|
console.info(arr);
|
return arr;
|
}
|
|
</script>
|
<script type="text/javascript">
|
$(function(){
|
$(".unable").prop("readonly","readonly").attr("unselectable","on").addClass("uncheck");
|
$("#sure").click(function(){
|
editBatt();
|
|
});
|
});
|
|
//修改电池组,添加到BATTINF
|
function editBatt(){
|
var parm = getUpdateArredit();
|
console.info(parm);
|
$.ajax({
|
type: "post",
|
url: "BattInfAction!update",
|
async:true,
|
dataType:'text',
|
data:"json="+JSON.stringify(parm),
|
success: function(data){
|
data = eval('('+data+')');
|
var model = eval('('+data.result+')');
|
console.info(model);
|
if(model.code ==1){
|
alert("修改成功");
|
}else{
|
alert("修改失败!");
|
}
|
},
|
error:function(){
|
alert("修改电池组失败!");
|
}
|
});
|
}
|
|
$('#newbattnum').change(function(){
|
var numbattnum = parseInt($('#newbattnum').val());
|
var index =parseInt(tempindex.length);
|
addbattnum=Math.floor((numbattnum)+(tempindex.length));
|
console.warn(addbattnum);
|
creatAllView(addbattnum).trigger('create');
|
creatBattGroupId(addbattnum);
|
});
|
function creatBattGroupId(addbattnum){
|
$.ajax({type: "post",
|
url: "BattInfAction!searchMaxBattgroupId",
|
async:true,
|
dataType:'text',
|
data:null,
|
success: function(data){
|
data=JSON.parse(data);
|
data=data.result;
|
data =JSON.parse(data);
|
//console.info(data)
|
var groupid = data.data;
|
//console.info(groupid);
|
//tempgroupid.push(groupid);
|
console.info(tempgroupid);
|
for(var i=tempgroupid.length;i<addbattnum;i++){
|
tempgroupid.push(groupid++);
|
console.info(tempgroupid);
|
}
|
}
|
});
|
}
|
|
|
/* 操作成功
|
$('#changeSuc').popup('open');
|
操作失败
|
$('#changeErr').popup('open'); */
|
</script>
|
|
</html>
|