From fb783f79cac8d1524fcf3f41cfaa275a6bd6e70c Mon Sep 17 00:00:00 2001
From: CJJ <Administrator@USER-20180117QL>
Date: 星期四, 20 十二月 2018 21:11:40 +0800
Subject: [PATCH] 修改
---
gx_tieta/WebRoot/mobil/batt-infor-unapproved-edit.html | 368 ++++++++++++++++++++++++++++++---------------------
1 files changed, 216 insertions(+), 152 deletions(-)
diff --git a/gx_tieta/WebRoot/mobil/batt-infor-unapproved-edit.html b/gx_tieta/WebRoot/mobil/batt-infor-unapproved-edit.html
index 4c0cf17..1906444 100644
--- a/gx_tieta/WebRoot/mobil/batt-infor-unapproved-edit.html
+++ b/gx_tieta/WebRoot/mobil/batt-infor-unapproved-edit.html
@@ -17,50 +17,7 @@
<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");
- //console.info(temp);
- temp=JSON.parse(temp);
- console.info(temp);
- console.info(temp[30]);
- console.info(temp[33]);
- var suoyin = temp[33];
-
- $(function(){creatAllView(4)});
- </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 {
@@ -79,7 +36,7 @@
color: #bdbdbdc4!important;
}
.ui-btn-icon-right {
- padding-right: 8.5em;
+ padding-right: 2em;
}
.hbg{
background-color:#ddd9;
@@ -90,6 +47,15 @@
.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>
@@ -98,9 +64,32 @@
<!-- 澶撮儴鍐呭 -->
<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="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">
@@ -110,7 +99,7 @@
<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>
@@ -152,13 +141,13 @@
<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>
@@ -179,30 +168,14 @@
<input type="text" id="FBSDeviceName" data-mini="true" />
</td>
</tr>
- <tr>
- <td>FBS鐢垫睜绱㈠紩(0-3)</td>
- <td>
- <input type="text" id="GroupIndexInFBSDevice" data-mini="true" />
- </td>
- </tr>
- <tr>
- <td>鐢垫睜缁処D</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>
- <tr>
- <td>鐢垫睜缁勫悕绉�</td>
- <td>
- <input type="text" id="BattGroupName" data-mini="true" />
- </td>
- </tr>
+
<tr>
<td>娴厖鐢靛帇闃�鍊�(V)</td>
<td>
@@ -331,7 +304,77 @@
</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');
@@ -355,10 +398,10 @@
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("GroupIndexInFBSDevice").value = temp[12];
+ //document.getElementById("BattGroupId").value = temp[13];
document.getElementById("BattGroupNum").value = temp[14];
- document.getElementById("BattGroupName").value = temp[15];
+ //document.getElementById("BattGroupName").value = temp[15];
document.getElementById("FloatVolLevel").value = temp[16];
document.getElementById("OfflineVolLevel").value = temp[17];
document.getElementById("BattFloatCurrent").value = temp[18];
@@ -378,51 +421,65 @@
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 getUpdateArr(){
+ // 鏍煎紡鍖栨彁浜ゅ悗鍙颁俊鎭殑瀵硅薄鏁扮粍淇敼
+ function getUpdateArr(){
var arr = new Array();
- var obj = new Object();
- obj.StationId = $("#StationId").val(); // 鏈烘埧缂栧彿
- obj.StationName = ($("#station_name1").val()+"-"+$("#city").val()+"-"+$("#StationName3").val()+"-"+$("#StationName4").val()); // 鎷兼帴鏈烘埧鍚嶇О
- obj.StationName1 = $("#station_name1").val(); // 鐪�
- obj.StationName2 = $("#city").val(); // 甯�
- obj.StationName5 = $("#county").val(); // 鍖�/鍘�
- obj.StationName3 = $("#StationName3").val(); // 鏈烘埧鍚嶇О
- obj.StationName4 = $("#StationName4").val(); // 璁惧鍚嶇О
- obj.StationIp = $("#StationIp").val(); //鏈烘埧ip
- obj.FBSDeviceId = $("#FBSDeviceId").val(); //璁惧id
- obj.FbsDeviceIp = $("#FbsDeviceIp").val(); //璁惧ip
- obj.FbsDeviceIp_YM = $("#FbsDeviceIp_YM").val(); // 璁惧鎺╃爜
- obj.FbsDeviceIp_WG = $("#FbsDeviceIp_WG").val(); // 缃戝叧
- obj.FBSDeviceName = $("#FBSDeviceName").val(); //璁惧鍚嶇О
- obj.GroupIndexInFBSDevice = $("#GroupIndexInFBSDevice").val(); //fbs璁惧绱㈠紩
- obj.BattGroupId = $("#BattGroupId").val(); //鐢垫睜缁刬d
- obj.BattGroupNum = $("#BattGroupNum").val(); //鏈烘埧鍐呯數姹犵粍缂栧彿
- obj.BattGroupName = $("#BattGroupName").val(); //鐢垫睜缁勫悕绉�
- obj.FloatVolLevel = $("#FloatVolLevel").val(); //娴厖鐢靛帇闃�鍊�
- obj.OfflineVolLevel = $("#OfflineVolLevel").val(); //绂荤嚎鐢靛帇闃�鍊�
- obj.BattFloatCurrent = $("#BattFloatCurrent").val(); //娴厖鐢垫祦闃�鍊�
- obj.MonCount = $("#MonCount").val(); //鍗曚綋鏁伴噺
- obj.MonCapStd = $("#MonCapStd").val(); //鏍囩О瀹归噺
- obj.MonVolStd = $("#MonVolStd").val(); //鏍囩О鐢靛帇
- obj.MonResStd = $("#MonResStd").val(); //鏍囩О鍐呴樆
- obj.MonSerStd = $("#MonSerStd").val(); //鏍囩О鐢靛
- obj.MonVolLowToAvg = $("#MonVolLowToAvg").val(); //鍗曚綋鐢靛帇娆′綆鍋忕Щ閲�
-
-
- obj.Load_curr = $("#Load_curr").val(); //璐熻浇鐢垫祦
- obj.DisCurrMax = $("#DisCurrMax").val(); //鏈�澶ф牳瀹圭數娴�
- obj.station_phone = $("#station_phone").val(); //鍩虹珯鍙风爜
-
- obj.BattProducer = $("#BattProducer").val(); //鐢垫睜鍝佺墝
- obj.BattModel = $("#BattModel").val(); //鐢垫睜鍨嬪彿
- obj.BattProductDate = $("#startTestrecord").val(); //鐢垫睜鐢熶骇鏃ユ湡
- obj.BattInUseDate = $("#endTestrecord").val(); //鐢垫睜浣跨敤鏃ユ湡
- obj.install_user = $("#install_user").val(); //瀹夎浜哄憳
- arr.push(obj);
+ 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"),
+ num : tempnum[i],
+ binf:{
+ 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], //鐢垫睜缁刬d
+ 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(), //瀹夎浜哄憳
+
+ }
+ }
+ arr.push(obj);
+ }
console.info(arr);
return arr;
}
@@ -432,23 +489,16 @@
$(function(){
$(".unable").prop("readonly","readonly").attr("unselectable","on").addClass("uncheck");
$("#sure").click(function(){
- if(temp[33]&&temp[33]=="new"){
- addBatt();
- }else{
- editParm();
- }
- function backpage(){window.location.href="ele-param1.html";}
- setTimeout(backpage,500);
- });
- $("#cancel").click(function(){
- window.location.href="ele-param1.html";
+ editParm();
+
});
});
function editParm(){
var parm = getUpdateArr();
+ console.info(parm);
$.ajax({
type: "post",
- url: "BattInfAction!update",
+ url: "Battinf_applyAction!updatePro",
async:true,
dataType:'text',
data:"json="+JSON.stringify(parm),
@@ -458,45 +508,59 @@
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 addBatt(){
- var parm = getUpdateArr();
- $.ajax({
- type: "post",
- url: "BattInfAction!add",
- 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("娣诲姞鐢垫睜缁勫彂鐢熼敊璇�!");
- }
- });
+
+
+ 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>
\ No newline at end of file
+
+</html>
--
Gitblit v1.9.1