| | |
| | | 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"id="battproducer'+index+'">'+'<select>'
|
| | | '<table class="layout-set">'+'<tbody>'+'<tr>'+'<td>'+'电池品牌'+'</td>'+'<td>'+'<fieldset data-role="controlgroup" data-type="horizontal" >'+'<select id="battproducer'+index+'">'
|
| | | ,battBrand=selectedIndex(index)+'</select>'+'</fieldset>'+'</td>'+'</tr>'
|
| | | ,battType='<tr>'+'<td>'+'电池型号'+'</td>'+'<td>'+'<input type="text" '+'id='+'batttype'+index+' data-mini="true"'+'value='+'电池型号'+count+' />'+'</td>'+'</tr>'
|
| | | ,battNum='<tr>'+'<td>'+'电池数量'+'</td>'+'<td>'+'<input type="text" '+'id='+'battnum'+index+' data-mini="true"'+'value='+'电池数量'+count+' />'+'</td>'+'</tr>'
|
| | |
| | | function selectedIndex(index){
|
| | | var selected='',
|
| | | i=0;
|
| | | var pruducer = temp[index].binf.BattProducer;
|
| | | |
| | | selected+= '<option '+'value='+pruducer+'>'+pruducer+'</option>';
|
| | | selected+= '<option '+'value='+'理士'+'>'+'理士'+'</option>';
|
| | | selected+= '<option '+'value='+'圣阳'+'>'+'圣阳'+'</option>';
|
| | | selected+= '<option '+'value='+'双登'+'>'+'双登'+'</option>';
|
| | |
| | | //导入表格默认数据
|
| | | function installstartdata(temp){
|
| | | data=temp[0].binf;
|
| | | |
| | | document.getElementById("StationId").value = data.StationId;
|
| | | document.getElementById("mainteArea").value = data.StationName1;
|
| | | document.getElementById("city").value = data.StationName2; //市
|
| | |
| | | document.getElementById("Load_curr").value = data.Load_curr;
|
| | | document.getElementById("DisCurrMax").value = data.DisCurrMax;
|
| | | document.getElementById("station_phone").value = data.station_phone;
|
| | | //document.getElementById("BattProducer").value = data.BattProducer;
|
| | | //document.getElementById(battproducer).value = data.BattProducer;
|
| | | $(battproducer).val(data.BattProducer);
|
| | | //document.getElementById("BattModel").value = data.BattModel;
|
| | | document.getElementById("startTestrecord").value = data.BattProductDate;
|
| | | document.getElementById("endTestrecord").value = data.BattInUseDate;
|
| | |
| | | //setTimes($("#endTestrecord"),data.useDate);
|
| | | document.getElementById("install_user").value = data.install_user;
|
| | | for(var i=0;i<temp.length;i++){
|
| | | var battproducer ="#battproducer"+i;
|
| | | data=temp[i].binf;
|
| | | var battString = "#battname"+i;
|
| | | var battModel = "#batttype"+i;
|
| | | //var battModel = "#batttype"+i;
|
| | | var battproducer = "#battproducer"+i
|
| | | //var battproducer ="#battproducer"+i;
|
| | | $(battString).val(data.BattGroupName);
|
| | | $(battModel).val(data.BattModel);
|
| | | $(battproducer).val(data.BattProducer);
|
| | | console.info($(battproducer).val());
|
| | | //$(battModel).val(data.BattModel);
|
| | | //$(battproducer).val(data.BattProducer);
|
| | | //console.info(data.BattProducer);
|
| | | $(battproducer).prepend('<option value="4343" selected="selected">344343</option>');
|
| | | console.info($(battproducer)[0]);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | var battString = "#battname"+i;
|
| | | var battModel = "#batttype"+i;
|
| | | var battproducer ="#battproducer"+i;
|
| | | var nomCap = "#nomCap"+i;
|
| | | //var id = $('fieldset div div input[data-cacheval=\'true\']').val();
|
| | | //var inputVal = $(id).val();
|
| | | //var input =$(four).option()
|
| | |
| | | DisCurrMax : $("#DisCurrMax").val(), //最大核容电流
|
| | | station_phone : $("#station_phone").val(), //基站号码
|
| | |
|
| | | BattProducer : "双登", //电池品牌
|
| | | BattProducer :getSelected(battproducer) , //电池品牌
|
| | | BattModel : $(battModel).val(), //电池型号
|
| | | BattProductDate : $("#startTestrecord").val(), //电池生产日期
|
| | | BattInUseDate : $("#endTestrecord").val(), //电池使用日期
|
| | |
| | | console.info(model);
|
| | | if(model.code ==1){
|
| | | alert("修改成功");
|
| | | window.location.href="batt-unapproved.html"
|
| | | //window.location.href="batt-unapproved.html"
|
| | | }else{
|
| | | alert("修改失败!");
|
| | | window.location.href="batt-unapproved.html"
|
| | |
| | | creatAllView(addbattnum).trigger('create');
|
| | | creatBattGroupId(addbattnum);
|
| | | });
|
| | | |
| | | |
| | | |
| | | function getSelected(id){
|
| | | /* var s;
|
| | | $(id).change(function(){
|
| | | |
| | | var g=$(this).find("option:selected").val();
|
| | | console.warn(g);
|
| | | s=g
|
| | | });
|
| | | if(!s){s=$(id).find("option:selected").val()} */
|
| | | var s=$(id).find("option:selected").val();
|
| | | return s;
|
| | | }
|
| | | |
| | | |
| | | |
| | | /* 操作成功
|
| | | $('#changeSuc').popup('open');
|
| | | 操作失败
|