| | |
| | | <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">
|
| | | function creatAllView(num){
|
| | | var allString=''
|
| | | ,i=0;
|
| | | if(num>4){return false}
|
| | | for(i=0;i<num;i++){
|
| | | allString+=creatBattView(i);
|
| | | }
|
| | | $("#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; |
| | | } |
| | | var temp = getCookie("eleparm");
|
| | | var tempindex = getCookie("eleparmindex");
|
| | | var tempnum = getCookie("eleparmnum");
|
| | | //console.info(temp);
|
| | | temp=JSON.parse(temp);
|
| | | tempindex = JSON.parse(tempindex);
|
| | | tempnum =JSON.parse(tempnum);
|
| | | var suoyin = temp[33];
|
| | | |
| | | $(function(){creatAllView(tempindex.length)});
|
| | | </script>
|
| | | <script type="text/javascript" src="mobilJs/jquery.mobile-1.4.5.min.js"></script>
|
| | | <script type="text/javascript" src="mobilJs/jquery.mobile-1.4.5.min.js"></script> |
| | | <style type="text/css">
|
| | |
|
| | | table {
|
| | |
| | | color: #bdbdbdc4!important;
|
| | | }
|
| | | .ui-btn-icon-right {
|
| | | padding-right: 8.5em;
|
| | | padding-right: 2em;
|
| | | }
|
| | | .hbg{
|
| | | background-color:#ddd9;
|
| | |
| | | .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>
|
| | |
| | | <div data-role="header" data-position="fixed">
|
| | | <a href="batt-unapproved.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">
|
| | |
| | | <tr>
|
| | | <td>机房编号</td>
|
| | | <td>
|
| | | <input type="text" id="StationId" data-mini="true" />
|
| | | <input type="text" id="StationId" class="unable" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | |
| | | <tr>
|
| | | <td>FBS设备ID(重要)</td>
|
| | | <td>
|
| | | <input type="text" id="FBSDeviceId" data-mini="true" />
|
| | | <input type="text" id="FBSDeviceId" class="unable" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>FBS设备IP(重要)</td>
|
| | | <td>
|
| | | <input type="text" id="FbsDeviceIp" data-mini="true" />
|
| | | <input type="text" id="FbsDeviceIp" class="unable" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | |
| | | <input type="text" id="FBSDeviceName" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>电池组ID</td>
|
| | | <td>
|
| | | <input type="text" readonly unselectable="on" value="123" id="BattGroupId" class="uncheck" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | |
| | | <tr>
|
| | | <td>机房内电池组编号</td>
|
| | | <td>
|
| | | <input type="text" readonly unselectable="on" value="123" id="BattGroupNum" class="uncheck" data-mini="true" />
|
| | | <input type="text" readonly unselectable="on" value="123" id="BattGroupNum" class="unable" class="uncheck" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | |
|
| | |
| | | </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 tempgroupid = getCookie("elegroupid");
|
| | | var temp = getCookie("eleparm");
|
| | | temp = JSON.parse(temp);
|
| | | console.info(temp);
|
| | | var tempgroupid = new Array() ;
|
| | | for(var i=0;i<temp.length;i++){
|
| | | tempgroupid.push(temp[i].binf.BattGroupId);
|
| | | }
|
| | | console.info(tempgroupid);//电池组 ID 数组,(若添加,则需要新建);
|
| | | var addbattnum = temp.length;
|
| | | $(function(){
|
| | | creatAllView(temp.length).trigger('create');
|
| | | creatBa(temp.length).trigger('create');
|
| | | });
|
| | | |
| | |
|
| | | |
| | | </script>
|
| | | <script type="text/javascript">
|
| | | $(function () {
|
| | | //setTimes($("#startTestrecord"),'2000-01-01');
|
| | |
| | | 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("BattGroupId").value = temp[13];
|
| | | document.getElementById("BattGroupNum").value = temp[14];
|
| | | //document.getElementById("BattGroupName").value = temp[15];
|
| | | document.getElementById("FloatVolLevel").value = temp[16];
|
| | |
| | | setTimes($("#startTestrecord"),temp[30]);
|
| | | setTimes($("#endTestrecord"),temp[31]);
|
| | | document.getElementById("install_user").value = temp[32];
|
| | | for(var i=0;i<tempindex.length;i++){
|
| | | for(var i=0;i<temp.length;i++){
|
| | | battname = "#battname"+i;
|
| | | $(battname).val(tempindex[i]);
|
| | | //$(battname).val(tempindex[i]);
|
| | | }
|
| | | }
|
| | |
|
| | | // 格式化提交后台信息的对象数组修改
|
| | | function getUpdateArr(){
|
| | | var arr = new Array();
|
| | | for(var i=0;i<tempindex.length;i++){
|
| | | console.info(addbattnum);
|
| | | for(var i=0;i<addbattnum;i++){
|
| | | var battString = "#battname"+i;
|
| | | var index = String(i);
|
| | | console.info(battString);
|
| | | var obj = {
|
| | | //apply_date : new Date().format("yyyy-MM-dd hh:mm:ss"),
|
| | | apply_date : new Date().format("yyyy-MM-dd hh:mm:ss"),
|
| | | num : tempnum[i],
|
| | | binf:{
|
| | | StationId : $("#StationId").val(), // 机房编号
|
| | |
| | | FbsDeviceIp_WG : $("#FbsDeviceIp_WG").val(), // 网关
|
| | | FBSDeviceName : $("#FBSDeviceName").val(), //设备名称
|
| | | GroupIndexInFBSDevice : i, //fbs设备索引
|
| | | BattGroupId : $("#BattGroupId").val(), //电池组id
|
| | | BattGroupId : tempgroupid[i], //电池组id
|
| | | BattGroupNum : $("#BattGroupNum").val(), //机房内电池组编号
|
| | | BattGroupName : $(battString).val(),
|
| | | FloatVolLevel : $("#FloatVolLevel").val(), //浮充电压阀值
|
| | |
| | | BattProductDate : $("#startTestrecord").val()+" 00:00:00", //电池生产日期
|
| | | BattInUseDate : $("#endTestrecord").val()+" 00:00:00", //电池使用日期
|
| | | install_user : $("#install_user").val(), //安装人员
|
| | | |
| | | }
|
| | | }
|
| | | arr.push(obj);
|
| | |
| | | $(".unable").prop("readonly","readonly").attr("unselectable","on").addClass("uncheck");
|
| | | $("#sure").click(function(){
|
| | | editParm();
|
| | | /* function backpage(){window.location.href="ele-param1.html";}
|
| | | setTimeout(backpage,500); |
| | | });
|
| | | $("#cancel").click(function(){
|
| | | window.location.href="ele-param1.html";
|
| | | */
|
| | |
|
| | | });
|
| | | });
|
| | | function editParm(){
|
| | |
| | | type: "post",
|
| | | url: "Battinf_applyAction!updatePro",
|
| | | async:true,
|
| | | dataType:'text',
|
| | | dataType:'json',
|
| | | data:"json="+JSON.stringify(parm),
|
| | | success: function(data){
|
| | | data = eval('('+data+')');
|
| | |
| | | console.info(model);
|
| | | if(model.code ==1){
|
| | | alert("修改成功");
|
| | | window.location.href="batt-unapproved.html"
|
| | | }else{
|
| | | alert("修改失败!");
|
| | | window.location.href="batt-unapproved.html"
|
| | | }
|
| | | },
|
| | | error:function(){
|
| | | alert("修改电池组失败!");
|
| | | window.location.href="batt-unapproved.html"
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | |
| | | |
| | | |
| | | |
| | | 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);
|
| | | }
|
| | | }
|
| | | }); |
| | | }
|
| | |
|
| | | |
| | | $('#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);
|
| | | });
|
| | | |
| | |
|
| | |
|
| | | /* 操作成功
|
| | | $('#changeSuc').popup('open');
|
| | | 操作失败
|
| | | $('#changeErr').popup('open'); */
|
| | | </script>
|
| | | </html> |
| | | |
| | | </html>
|