CJJ
2018-12-20 866a6facb439b93b7d693bb84730714200c7f85a
gx_tieta/WebRoot/mobil/batt-infor-conf-temp1.html
@@ -57,6 +57,7 @@
   console.info(temp);
   console.info(temp[30]);
   console.info(temp[33]);
   console.info(temp[34]);
   var suoyin = temp[33];
   
   $(function(){creatAllView(suoyin)});
@@ -99,7 +100,7 @@
      
      <!-- 头部内容 -->
      <div data-role="header" data-position="fixed">
         <a href="ele-param1.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>
         <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>
@@ -212,19 +213,19 @@
                                 </td>
                              </tr>
                              <tr>
                                 <td>单体数量</td>
                                 <td>*单体数量</td>
                                 <td>
                                    <input type="text" id="MonCount" data-mini="true" />
                                 </td>
                              </tr>
                              <tr>
                                 <td>标称容量(AH)</td>
                                 <td>*标称容量(AH)</td>
                                 <td>
                                    <input type="text" id="MonCapStd" data-mini="true" />
                                 </td>
                              </tr>
                              <tr>
                                 <td>标称单体电压(V)</td>
                                 <td>*标称单体电压(V)</td>
                                 <td>
                                    <input type="text" id="MonVolStd" data-mini="true" />
                                 </td>
@@ -248,7 +249,7 @@
                                 </td>
                              </tr>
                              <tr>
                                 <td>负载电流(A)</td>
                                 <td>*负载电流(A)</td>
                                 <td>
                                    <input type="text" id="Load_curr" data-mini="true" />
                                 </td>
@@ -260,7 +261,7 @@
                                 </td>
                              </tr>
                              <tr>
                                 <td>基站号码</td>
                                 <td>基站电话号码</td>
                                 <td>
                                    <input type="text" id="station_phone" data-mini="true" />
                                 </td>
@@ -272,7 +273,7 @@
                                 </td>
                              </tr>
                              <tr>
                                 <td>电池型号</td>
                                 <td>*电池型号</td>
                                 <td>
                                    <input type="text" id="BattModel" data-mini="true" />
                                 </td>
@@ -290,7 +291,7 @@
                                 </td>
                              </tr>
                              <tr>
                                 <td>安装人员</td>
                                 <td>*安装人员</td>
                                 <td>
                                    <input type="text" id="install_user" data-mini="true" />
                                 </td>
@@ -350,7 +351,13 @@
   $(function () {
      //setTimes($("#startTestrecord"),'2000-01-01');
      //setTimes($("#endTestrecord"),new Date().format('yyyy-MM-dd'));
      creatgroupid();
      console.info()
      if(temp[34]!="edit")
      {
      console.warn("sssss")
         creatgroupid();//如果检测为NEW ,则执行添加ID,如果为修改,则执行为拿到ID
      }else{
      }
      installstartdata(temp);
   });
   
@@ -421,7 +428,7 @@
   
   //导入表格默认数据
   function installstartdata(temp){
      creatgroupid();
      var data = {
                StationId: '4011100'
                ,StationName1: '广西省'
@@ -434,7 +441,7 @@
                ,FbsDeviceIp: '127.0.0.1'
                ,FbsDeviceIp_YM: '255.255.255.0'
                ,FbsDeviceIp_WG: '127.0.0.1'
                ,FBSDeviceName: '设备名称'
                ,FBSDeviceName: 'BTS'
                ,GroupIndexInFBSDevice: 1 
                ,BattGroupId: 1000005
                ,BattGroupNum: 2
@@ -458,7 +465,8 @@
                ,install_user: '呵呵'
            };
            console.info(data.StationId);
      if(temp.length>0){
      if(temp[34]!="edit"){
         creatgroupid();
         document.getElementById("StationId").value = data.StationId;
   //      document.getElementById("station_name1").value = data.StationName1;
   //      document.getElementById("city").value = data.StationName2;         //市
@@ -483,7 +491,7 @@
   //      document.getElementById("MonVolStd").value = data.MonVolStd;
         document.getElementById("MonResStd").value = data.MonResStd;
         document.getElementById("MonSerStd").value = data.MonSerStd;
   //      document.getElementById("MonVolLowToAvg").value = data.MonVolLowToAvg;
         document.getElementById("MonVolLowToAvg").value = data.MonVolLowToAvg;
   //      document.getElementById("Load_curr").value = data.Load_curr;
         document.getElementById("DisCurrMax").value = data.DisCurrMax;
   //      document.getElementById("station_phone").value = data.station_phone;
@@ -502,7 +510,7 @@
         document.getElementById("StationName3").value = temp[4];   //机房名称
         document.getElementById("StationName4").value = temp[5];    //设备名称
         document.getElementById("StationIp").value = temp[6];      //设备IP
         //document.getElementById("FBSDeviceId").value = dev_id;
         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];
@@ -592,17 +600,35 @@
<script type="text/javascript">  
   $(function(){
      $(".unable").prop("readonly","readonly").attr("unselectable","on").addClass("uncheck");
      $("#sure").click(function(){
         addBatt();
      $("#sure").click(function(){
         if(nullOrn()){
            if(temp[34]=="edit"){
               creatgroupid();//提交之前再次验证,创建ID
               addBattnew();    //提交
            }else{
               editBatt();
            }
         }else{
         }            //验证重要项是否为空,为空则提示;
            //function backpage(){window.location.href="ele-param1.html";}
          // setTimeout(backpage,500); 
      });
      $("#cancel").click(function(){
          window.location.href="ele-param1.html";
          window.location.href="ele-param2.html";
      });
   });
    
    function addBatt(){
    function nullOrn(){
       if($("#BattFloatCurrent").val()&&$("#MonCount").val()&&$("#MonCapStd").val()){
          return true;
       }else{
          alert("*项为必填项,不能为空,请重新输入");
          return false;
       }
    }
    function addBattnew(){//新建电池组,添加到申请
       var temp = JSON.stringify(getUpdateArr());
       console.info(temp);
       $.ajax({
@@ -624,7 +650,31 @@
          }
       });
    }
      //修改电池组,添加到BATTINF
   function editParm(){
         var parm = getUpdateArr();
         $.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("修改电池组失败!");
              }
       });
   }
    /* 操作成功 
   $('#changeSuc').popup('open');
       操作失败