From 5fe2efb71f6ad809a1cfc59beab18bbea99fff5e Mon Sep 17 00:00:00 2001 From: 81041 <81041@DESKTOP-025NVD9> Date: 星期五, 18 一月 2019 09:01:41 +0800 Subject: [PATCH] Merge branch 'dev_lxw' of https://gitlab.com/whyclxw1/gx_tieta.git into dev_lxw --- gx_tieta/WebRoot/mobil/batt-edit2.html | 363 +++++++++++++++++++++++++-------------------------- 1 files changed, 180 insertions(+), 183 deletions(-) diff --git a/gx_tieta/WebRoot/mobil/batt-edit2.html b/gx_tieta/WebRoot/mobil/batt-edit2.html index bf17e2b..e6a930b 100644 --- a/gx_tieta/WebRoot/mobil/batt-edit2.html +++ b/gx_tieta/WebRoot/mobil/batt-edit2.html @@ -26,17 +26,17 @@ white-space: nowrap; } .uncheck{ - background-color: #dddddd38!important; - color: #bdbdbdc4!important; + background-color: #ddd!important; + color: #000!important; } .ui-btn-icon-right { padding-right: 8.5em; } .hbg{ - background-color:#ddd9; + background-color:#ddd; } #battdata { - background-color:#dddddd54 + background-color:#eee; } .ui-select .ui-btn select{ width:77%; @@ -47,9 +47,7 @@ right: 0; margin:0!important; } - #newbattnum-button{ - padding: 1em 1.9em; - } + </style> <link rel="stylesheet" href="css/fgpanel.css"> </head> @@ -60,16 +58,7 @@ <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> - <fieldset data-role="controlgroup" class="ptr0" > - - - <select id="newbattnum" data-mini="true"> - <option value=0>鏂板缓鐢垫睜缁�</option> - - </select> - - - </fieldset> + </div> <!-- 涓讳綋鍐呭 --> @@ -78,30 +67,15 @@ <table class="layout-set"> <tbody> <tr> - <td>鏈烘埧缂栧彿</td> - <td> - <input type="text" id="StationId" class="unable" data-mini="true" onfocus="this.blur()"/> - </td> - </tr> - <tr> - <td>FBS璁惧ID(閲嶈)</td> - <td> - <input type="text" id="FBSDeviceId" class="unable" data-mini="true" onfocus="this.blur()"/> - </td> - </tr> - <tr> - <td>FBS璁惧IP(閲嶈)</td> - <td> - <input type="text" id="FbsDeviceIp" class="unable" data-mini="true" onfocus="this.blur()" /> - </td> - </tr> - <tr> - <td>鐢垫睜缁処D</td> - <td> - <input type="text" readonly unselectable="on" value="123"class="unable" id="BattGroupId" class="uncheck" data-mini="true" onfocus="this.blur()" /> - </td> - </tr> - <tr> + <input type="hidden" type="text" id="StationId" class="unable" data-mini="true" onfocus="this.blur()"/> + + <input type="hidden" type="text" id="FBSDeviceId" class="unable" data-mini="true" /> + + <input type="hidden" type="text" id="FbsDeviceIp" class="unable" data-mini="true" /> + + <input type="hidden" type="text" readonly unselectable="on" value="123"class="unable" id="BattGroupId0" class="uncheck" data-mini="true" /> + + <input type="hidden" type="text" readonly unselectable="on" value="123"class="unable" id="BattGroupId1" class="uncheck" data-mini="true" /> <td>鐪�</td> <td> <input type="text" id="mainteArea" class="unable" data-mini="true" onfocus="this.blur()"/> @@ -122,48 +96,34 @@ <tr> <td>鏈烘埧鍚嶇О</td> <td> - <input type="text" id="homeName" data-mini="true"> - + <textarea id="homeName" class="unable" data-mini="true"></textarea> </td> </tr> <input type="hidden" id="StationName4" data-mini="true" /> - - + <input type="hidden" id="StationIp" data-mini="true" /> - - - - - + <input type="hidden" id="FbsDeviceIp_YM" class="unable" data-mini="true" value="456"/> + <input type="hidden" id="FbsDeviceIp_WG" class="unable" data-mini="true" value="456"/> + <input type="hidden" id="FBSDeviceName" data-mini="true" /> - - - - - <input type="hidden" readonly unselectable="on" value="123" id="BattGroupNum" class="unable" class="uncheck" data-mini="true" /> - - + <input type="hidden" id="FloatVolLevel" data-mini="true" /> - - - + <input type="hidden" id="OfflineVolLevel" class="unable" data-mini="true" /> - - <input type="hidden" id="BattFloatCurrent" class="unable" data-mini="true" /> - <tr> + <!-- <tr> <td>*鍗曚綋鏁伴噺</td> <td> - <!-- <input type="text" id="MonCount" data-mini="true" /> --> + <input type="text" id="MonCount" data-mini="true" /> <fieldset data-role="controlgroup" data-type="horizontal"> <label for="four">4 涓�</label> @@ -171,9 +131,7 @@ <label for="twentyfour">24涓�</label> <input type="radio" name="battnum" id="twentyfour" value="24"> </fieldset> - - - + </td> </tr> <tr> @@ -191,11 +149,15 @@ </select> </fieldset> </td> - </tr> + </tr> --> <input type="hidden" id="MonResStd" data-mini="true" /> <input type="hidden" id="MonSerStd" data-mini="true" /> <input type="hidden" id="MonVolLowToAvg" data-mini="true" /> + <input type="hidden" id="fuchongfazhi0" data-mini="true" /> + <input type="hidden" id="fuchongfazhi1" data-mini="true" /> + <input type="hidden" id="lixiandianyafazhi0" data-mini="true" /> + <input type="hidden" id="lixiandianyafazhi1" data-mini="true" /> <tr> <td>*璐熻浇鐢垫祦(A)</td> @@ -208,7 +170,7 @@ <tr> - <td>鍩虹珯鐢佃瘽鍙风爜</td> + <td>*鍩虹珯鐢佃瘽鍙风爜</td> <td> <input type="text" id="station_phone" data-mini="true" /> </td> @@ -287,61 +249,59 @@ } + 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>' - ,nomCap='<tr>'+'<td>'+'鏍囩О瀹归噺'+'</td>'+'<td>'+'<input type="text" '+'id='+'nomCap'+index+' data-mini="true"'+'value='+'鏍囩О瀹归噺'+count+' />'+'</td>'+'</tr>' + ,battNum='<tr>'+'<td>'+'*鍗曚綋鏁伴噺'+'</td>'+'<td>'+'<fieldset data-role="controlgroup" data-type="horizontal">'+'<select '+ 'id='+'MonCount'+index+'>' + ,battNumOpt=selectedNum(index)+'</select>'+'</fieldset>'+'</td>'+'</tr>' + ,MonVolStd='<tr>'+'<td>'+'*鏍囩О鍗曚綋鐢靛帇(V)'+'</td>'+'<td>'+'<input type="text" '+'id='+'MonVolStd'+index+' data-mini="true"'+' class="unable" '+'/>'+'</td>'+'</tr>' + ,nomCap='<tr>'+'<td>'+'*鏍囩О瀹归噺(AH)'+'</td>'+'<td>'+'<fieldset data-role="controlgroup" >'+'<select '+'id='+'MonCapStd'+index+' data-mini="true"'+'>'+creatMonCapOpt(index)+'</select>' + +'</fieldset>'+'</td>'+'</tr>' ,battIndex='<tr>'+'<input type="hidden" '+'id='+'battindex'+index+' data-mini="true"'+'value='+count+' />'+'</tr>' ,battName='<tr>'+'<input type="hidden" '+'id='+'battname'+index+' data-mini="true"'+'value='+'鐢垫睜缁�'+count+' />'+'</tr>'+'</tbody>'+'</table>'+'</div>'; - return battTitle+battBrand+battType+battNum+nomCap+battIndex+battName; + return battTitle+battBrand+battType+battNum+battNumOpt+MonVolStd+nomCap+battIndex+battName; } - 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); - } + function selectedNum(index){ + var selected=''; + if(temp[index].binf.MonCount==4){ + return selected='<option '+'value='+4+' selected=selected' +'>'+'4 涓�'+'</option>'+'<option '+'value='+24 +'>'+'24涓�'+'</option>'; + }else{ + return selected='<option '+'value='+24+' selected=selected' +'>'+'24 涓�'+'</option>'+'<option '+'value='+4 +'>'+'4涓�'+'</option>'; + + } + } + function selectedIndex(index){ + var battproducer = getCookie("producer"); + battproducer = JSON.parse(battproducer); + console.info(battproducer); var selected='', i=0; - selected+= '<option '+'value='+'鐞嗗+'+'>'+'鐞嗗+'+'</option>'; - selected+= '<option '+'value='+'鍦i槼'+'>'+'鍦i槼'+'</option>'; - selected+= '<option '+'value='+'鍙岀櫥'+'>'+'鍙岀櫥'+'</option>'; - selected+= '<option '+'value='+'SENRY'+'>'+'SENRY'+'</option>'; - selected+= '<option '+'value='+'鍗楅兘'+'>'+'鍗楅兘'+'</option>'; - selected+= '<option '+'value='+'鐖遍粯鐢�'+'>'+'鐖遍粯鐢�'+'</option>'; - selected+= '<option '+'value='+'绉戝+杈�'+'>'+'绉戝+杈�'+'</option>'; - selected+= '<option '+'value='+'閾舵嘲'+'>'+' 閾舵嘲'+'</option>'; - selected+= '<option '+'value='+'涓版棩'+'>'+' 涓版棩'+'</option>'; - selected+= '<option '+'value='+'涓叴鑳芥淳'+'>'+' 涓叴鑳芥淳'+'</option>'; - selected+= '<option '+'value='+'鍏夊畤'+'>'+' 鍏夊畤'+'</option>'; - selected+= '<option '+'value='+'鑹捐鏂崕杈�'+'>'+'鑹捐鏂崕杈�'+'</option>'; - selected+= '<option '+'value='+'闆勯煬'+'>'+' 闆勯煬'+'</option>'; - selected+= '<option '+'value='+'椋庡竼'+'>'+' 椋庡竼'+'</option>'; - selected+= '<option '+'value='+'鏂囬殕'+'>'+' 鏂囬殕'+'</option>'; - selected+= '<option '+'value='+'椋庡竼'+'>'+' 椋庡竼'+'</option>'; - selected+= '<option '+'value='+'涓北'+'>'+' 涓北'+'</option>'; - selected+= '<option '+'value='+'缇庣殑'+'>'+' 缇庣殑'+'</option>'; - selected+= '<option '+'value='+'鏈楄揪'+'>'+' 鏈楄揪'+'</option>'; + //onsole.info(inde) + selected+= '<option '+'value='+temp[index].binf.BattProducer+'>'+temp[index].binf.BattProducer+'</option>'; + for(var i=0;i<battproducer.length;i++){ + if(temp[index].binf.BattProducer!=battproducer[i]){ + selected+= '<option '+'value='+battproducer[i]+'>'+battproducer[i]+'</option>'; + } + } + return selected; } var temp = getCookie("eleparm"); //console.info(temp); temp=JSON.parse(temp); console.info(temp); + var moncount = 0; var tempgroupid = new Array() ; + //var fuchongfazhi = [0,0,0,0]; + //var lixiandianyafazhi = [0,0,0,0]; for(var i=0;i<temp.length;i++){ tempgroupid.push(temp[i].binf.BattGroupId); } @@ -349,17 +309,14 @@ var addbattnum = temp.length;//娣诲姞鐢垫睜缁勬暟鐩鏁� $(function(){ creatAllView(temp.length).trigger('create'); - creatBa(temp.length).trigger('create'); + //creatMonCapOpt(temp.length); + setchangedMonVolStd(temp.length); + }); - - - - $(function () { //setTimes($("#startTestrecord"),'2000-01-01'); - //setTimes($("#endTestrecord"),new Date().format('yyyy-MM-dd')); - + //setTimes($("#endTestrecord"),new Date().format('yyyy-MM-dd')); installstartdata(temp); }); @@ -381,7 +338,7 @@ //console.info(dev_id); document.getElementById("FBSDeviceId").value = dev_id; var ip = getDevIp(dev_id); - //console.info(ip); + console.info(ip); document.getElementById("FbsDeviceIp").value = ip; }else{ alert("groupid鐢熸垚澶辫触"); @@ -408,35 +365,31 @@ return ip; } - // 璁剧疆娴厖鐢靛帇闃�鍊�/璁剧疆绂荤嚎鐢靛帇闃�鍊� // - function setFloatAndoutLine(monnum) { - var vol = $('#MonVolStd').val(); - //var monnum = $('#MonCount').val(); + // 璁剧疆娴厖鐢靛帇闃�鍊�/璁剧疆绂荤嚎鐢靛帇闃�鍊� // + function setFloatAndoutLine(index) { + var monvolstd = "#MonVolStd"+index; + var MonCount = "#MonCount" +index; + var vol = $(monvolstd).val(); + var monnum = $(MonCount).val(); var chargeVol = (vol*1.117*monnum).toFixed(1); // 娴厖鐢靛帇闃�鍊� var outlineVol = (vol*1.073*monnum).toFixed(1); // 绂荤嚎鐢靛帇闃�鍊� - $('#BattFloatCurrent').val(chargeVol); // 娴厖鐢靛帇闃�鍊� - $('#OfflineVolLevel').val(outlineVol); // 绂荤嚎鐢靛帇闃�鍊� + $("#fuchongfazhi"+index).val(chargeVol); // 娴厖鐢靛帇闃�鍊� + $("#lixiandianyafazhi"+index).val(outlineVol); // 绂荤嚎鐢靛帇闃�鍊� + console.info(vol); } - function prefixInteger(num, length) { - return (num/Math.pow(3,length)).toFixed(length).substr(2); + return (Array(length).join('0') + num).slice(-length); } - 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); - } + + //瀵煎叆琛ㄦ牸榛樿鏁版嵁 function installstartdata(temp){ data=temp[0].binf; + setMonVolStd(temp.length); + //creatgroupid(); + var ip = getDevIp(data.FBSDeviceId); document.getElementById("StationId").value = data.StationId; document.getElementById("mainteArea").value = data.StationName1; document.getElementById("city").value = data.StationName2; //甯� @@ -444,21 +397,21 @@ document.getElementById("homeName").value = data.StationName3; //鏈烘埧鍚嶇О document.getElementById("StationName4").value = data.StationName4; //璁惧鍚嶇О document.getElementById("StationIp").value = data.StationIp; //璁惧IP - document.getElementById("FBSDeviceId").value = data.FBSDeviceId; - document.getElementById("FbsDeviceIp").value = data.FbsDeviceIp; + document.getElementById("FBSDeviceId").value = data.FBSDeviceId; + document.getElementById("FbsDeviceIp").value = ip; document.getElementById("FbsDeviceIp_YM").value = data.FbsDeviceIp_YM; document.getElementById("FbsDeviceIp_WG").value = data.FbsDeviceIp_WG; document.getElementById("FBSDeviceName").value = data.FBSDeviceName; //document.getElementById("GroupIndexInFBSDevice").value = temp[12]; - document.getElementById("BattGroupId").value = data.BattGroupId; + document.getElementById("BattGroupNum").value = data.BattGroupNum; //document.getElementById("BattGroupName").value = temp[15]; - document.getElementById("FloatVolLevel").value = data.FloatVolLevel; - document.getElementById("OfflineVolLevel").value = data.OfflineVolLevel; - document.getElementById("BattFloatCurrent").value = data.BattFloatCurrent; + //document.getElementById("FloatVolLevel").value = data.FloatVolLevel; + //document.getElementById("OfflineVolLevel").value = data.OfflineVolLevel; + //document.getElementById("BattFloatCurrent").value = data.BattFloatCurrent; + document.getElementById("BattFloatCurrent").value = 5; //document.getElementById("MonCount").value = data.MonCount; - document.getElementById("MonCapStd").value = data.MonCapStd; - document.getElementById("MonVolStd").value = data.MonVolStd; + //document.getElementById("MonCapStd").value = data.MonCapStd; document.getElementById("MonResStd").value = data.MonResStd; document.getElementById("MonSerStd").value = data.MonSerStd; document.getElementById("MonVolLowToAvg").value = data.MonVolLowToAvg; @@ -474,6 +427,12 @@ document.getElementById("install_user").value = data.install_user; for(var i=0;i<temp.length;i++){ data=temp[i].binf; + console.info(data.BattGroupId); + document.getElementById("BattGroupId"+i).value = data.BattGroupId; + document.getElementById("MonCapStd"+i).value = data.MonCapStd; + document.getElementById("MonVolStd"+i).value = data.MonVolStd; + console.info(data.MonCount); + $("#MonCount"+i).find("option:selected").val(data.MonCount); var battString = "#battname"+i; var battModel = "#batttype"+i; var battproducer = "#battproducer"+i @@ -488,17 +447,11 @@ // 鏍煎紡鍖栨彁浜ゅ悗鍙颁俊鎭殑瀵硅薄鏁扮粍骞惰繑鍥� 鍗曚釜淇敼锛屾墜鏈烘柟寮忎笉淇敼澶氫釜鐢垫睜缁� function getUpdateArr(){ mon=$('#MonVolStd').val(); - var moncount = 0; - if(mon==12){ - console.info("aa"); - moncount=4; - }else if(mon==2){ - moncount==24; - } + var arr = new Array(); for(var i=0;i<temp.length;i++){ - setFloatAndoutLine(moncount); + setFloatAndoutLine(i); var battString = "#battname"+i; var battModel = "#batttype"+i; var battproducer ="#battproducer"+i; @@ -516,7 +469,7 @@ StationName1 : $("#mainteArea").val(), // 鐪� StationName2 : $("#city").val(), // 甯� StationName5 : $("#country").val(), // 鍖�/鍘� - homeName : $("#homeName").val(), // 鏈烘埧鍚嶇О + StationName3 : $("#homeName").val(), // 鏈烘埧鍚嶇О StationName4 : $("#StationName4").val(), // 璁惧鍚嶇О StationIp : $("#StationIp").val(), //鏈烘埧ip FBSDeviceId : $("#FBSDeviceId").val(), //璁惧id @@ -525,15 +478,15 @@ FbsDeviceIp_WG : $("#FbsDeviceIp_WG").val(), // 缃戝叧 FBSDeviceName : $("#FBSDeviceName").val(), //璁惧鍚嶇О GroupIndexInFBSDevice : i, //fbs璁惧绱㈠紩 - BattGroupId : $("#BattGroupId").val(), //鐢垫睜缁刬d + BattGroupId : $("#BattGroupId"+i).val(), //鐢垫睜缁刬d BattGroupNum : $("#BattGroupNum").val(), //鏈烘埧鍐呯數姹犵粍缂栧彿 BattGroupName : $(battString).val(), - FloatVolLevel : $("#FloatVolLevel").val(), //娴厖鐢靛帇闃�鍊� - OfflineVolLevel : $("#OfflineVolLevel").val(), //绂荤嚎鐢靛帇闃�鍊� + FloatVolLevel : $("#fuchongfazhi"+i).val(), //娴厖鐢靛帇闃�鍊� + OfflineVolLevel : $("#lixiandianyafazhi"+i).val(), //绂荤嚎鐢靛帇闃�鍊� BattFloatCurrent : $("#BattFloatCurrent").val(), //娴厖鐢垫祦闃�鍊� - MonCount : moncount, //鍗曚綋鏁伴噺 - MonCapStd : $("#MonCapStd").val(), //鏍囩О瀹归噺 - MonVolStd : $("#MonVolStd").val(), //鏍囩О鐢靛帇 + MonCount :$("#MonCount"+i).val(), //鍗曚綋鏁伴噺 + MonCapStd : $("#MonCapStd"+i).val(), //鏍囩О瀹归噺 + MonVolStd : $("#MonVolStd"+i).val(), //鏍囩О鐢靛帇 MonResStd : $("#MonResStd").val(), //鏍囩О鍐呴樆 MonSerStd : $("#MonSerStd").val(), //鏍囩О鐢靛 MonVolLowToAvg : $("#MonVolLowToAvg").val(), //鍗曚綋鐢靛帇娆′綆鍋忕Щ閲� @@ -542,7 +495,7 @@ DisCurrMax : $("#DisCurrMax").val(), //鏈�澶ф牳瀹圭數娴� station_phone : $("#station_phone").val(), //鍩虹珯鍙风爜 - BattProducer : $(battproducer).val(), //鐢垫睜鍝佺墝 + BattProducer : $("#battproducer"+i).find("option:selected").val(), //鐢垫睜鍝佺墝 BattModel : $(battModel).val(), //鐢垫睜鍨嬪彿 BattProductDate : $("#startTestrecord").val(), //鐢垫睜鐢熶骇鏃ユ湡 BattInUseDate : $("#endTestrecord").val(), //鐢垫睜浣跨敤鏃ユ湡 @@ -561,7 +514,7 @@ $(function(){ $(".unable").prop("readonly","readonly").attr("unselectable","on").addClass("uncheck"); $(function(){ - + }) $("#sure").click(function(){ if(nullOrn()){ @@ -577,13 +530,18 @@ }); function nullOrn(){ - - return true; - - + console.info($("#homeName").val()); + console.info($("#station_phone").val()); + if($("#homeName").val!=""&&$("#station_phone").val()!=""&&$("#install_user").val()!=""){ + return true; + }else{ + alert("璇峰~鍐�*鍐呭"); + } } - function editBatt(){// + + function editBatt(){ + //creatgroupid(); //id锛宨p console.info(getUpdateArr()); var temp = JSON.stringify(getUpdateArr()); console.info(temp); @@ -602,15 +560,15 @@ var model =data; if(model.code ==1){ alert("淇敼鎴愬姛"); - window.location.href="batt-unapproved.html" + window.location.href="batt-unapproved-index.html" }else{ alert("淇敼澶辫触!"); - window.location.href="batt-unapproved.html" + window.location.href="batt-unapproved-index.html" } }, error:function(){ alert("淇敼鐢垫睜缁勫け璐�!"); - //window.location.href="batt-unapproved.html" + //window.location.href="batt-unapproved.html" 璇︽儏鍒楄〃 } }); } @@ -623,31 +581,70 @@ if ($this.attr("checked")) { 銆�銆�銆�銆�銆�銆� if($this.val()==4){ $mon.val("12"); - + moncount = 12; }; - if($this.val()==24){$mon.val("2");} + if($this.val()==24){ + $mon.val("2"); + moncount = 2; + } 銆�銆�銆�銆�} }); - function creatMonCapOpt(){ - var k,optionStr='',allString; - for(var i=1;i<11;i++){ - k=i*50; - optionStr+='<option'+' value='+k+'>'+k+'</option>'; - } - allString=optionStr+'<option'+' value='+1000+'>'+1000+'</option>' - $("#MonCapStd").html(allString); - } - creatMonCapOpt(); - $('#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 creatMonCapOpt(suoyin){ + var optionStr,allString; + + for(var i=1;i<11;i++){ + + k=i*50; + + //optionStr+='<option'+' value='+k+'>'+k+'</option>'; + optionStr+='<option'+' value='+k+'>'+k+'</option>'; + + + + } + allString=optionStr+'<option'+' selected=selected '+' value='+1000+'>'+1000+'</option>' + return allString; + + + }*/ + + function creatMonCapOpt(index){ + var selected='', + i=0; + var battproducer = ["50","100","150","200","250","300","350","400","450","500","1000"]; + selected+= '<option '+'value='+temp[index].binf.MonCapStd+'>'+temp[index].binf.MonCapStd+'</option>'; + for(var i=0;i<battproducer.length;i++){ + if(temp[index].binf.MonCapStd!=battproducer[i]){ + selected+= '<option '+'value='+battproducer[i]+'>'+battproducer[i]+'</option>'; + } + } + return selected; + } + function setchangedMonVolStd(suoyin){ + for(var u=0;u<suoyin;u++){ + var id=''; + id='#MonCount'+u; + (function(u){ + var vol='#MonVolStd'+u; + $(document).on("change", id, function () { + if($(this).find("option:selected").val()==4){$(vol).val(12);} + if($(this).find("option:selected").val()==24){$(vol).val(2);} + }) + })(u) + + } + } + function setMonVolStd(index){ + for(var i=0;i<index;i++){ + var s='#MonVolStd'+i; + $(s).val(12); + } + + } /* 鎿嶄綔鎴愬姛 $('#changeSuc').popup('open'); 鎿嶄綔澶辫触 -- Gitblit v1.9.1