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-conf-temp1.html | 325 ++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 257 insertions(+), 68 deletions(-)
diff --git a/gx_tieta/WebRoot/mobil/batt-infor-conf-temp1.html b/gx_tieta/WebRoot/mobil/batt-infor-conf-temp1.html
index 88bd059..9f027bb 100644
--- a/gx_tieta/WebRoot/mobil/batt-infor-conf-temp1.html
+++ b/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>
@@ -111,7 +112,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>
@@ -153,13 +154,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>
@@ -171,7 +172,7 @@
<tr>
<td>缃戝叧</td>
<td>
- <input type="text" id="FbsDeviceIp_WG" class="unable" data-mini="true" value="456"/>
+ <input type="text" id="FbsDeviceIp_WG" class="unable" data-mini="true" value="456"/>
</td>
</tr>
<tr>
@@ -184,13 +185,13 @@
<tr>
<td>鐢垫睜缁処D</td>
<td>
- <input type="text" readonly unselectable="on" value="123" id="BattGroupId" class="uncheck" data-mini="true" />
+ <input type="text" readonly unselectable="on" value="123"class="unable" 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>
@@ -202,29 +203,29 @@
<tr>
<td>绂荤嚎鐢靛帇闃�鍊�(V)</td>
<td>
- <input type="text" id="OfflineVolLevel" data-mini="true" />
+ <input type="text" id="OfflineVolLevel" class="unable" data-mini="true" />
</td>
</tr>
<tr>
<td>娴厖鐢垫祦闃�鍊�(A)</td>
<td>
- <input type="text" id="BattFloatCurrent" data-mini="true" />
+ <input type="text" id="BattFloatCurrent" class="unable" data-mini="true" />
</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 ,鍒欐墽琛屾坊鍔營D锛屽鏋滀负淇敼锛屽垯鎵ц涓烘嬁鍒癐D
+ }else{
+ }
installstartdata(temp);
});
@@ -363,8 +370,9 @@
,data: null
,dataType: 'json'
,success:function(res) {
- //console.info(res);
+ console.info(res);
var data = JSON.parse(res.result);
+ console.info(data);
if(data.length!=0){
data = data.data;
dev_id = data;
@@ -408,48 +416,129 @@
$('#OfflineVolLevel').val(outlineVol); // 绂荤嚎鐢靛帇闃�鍊�
}
+ $('#MonVolStd').change(function(){
+ setFloatAndoutLine();
+ });
+ $('#MonCount').change(function(){
+ setFloatAndoutLine();
+ })
function prefixInteger(num, length) {
return (num/Math.pow(3,length)).toFixed(length).substr(2);
}
//瀵煎叆琛ㄦ牸榛樿鏁版嵁
function installstartdata(temp){
- creatgroupid();
- document.getElementById("StationId").value = temp[0];
- document.getElementById("station_name1").value = temp[1];
- document.getElementById("city").value = temp[2]; //甯�
- document.getElementById("county").value = temp[3]; //鍖哄幙
- 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("FbsDeviceIp").value = temp[8];
- 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("BattGroupNum").value = temp[14];
- //document.getElementById("BattGroupName").value = temp[15];
- document.getElementById("FloatVolLevel").value = temp[16];
- document.getElementById("OfflineVolLevel").value = temp[17];
- document.getElementById("BattFloatCurrent").value = temp[18];
- document.getElementById("MonCount").value = temp[19];
- document.getElementById("MonCapStd").value = temp[20];
- document.getElementById("MonVolStd").value = temp[21];
- document.getElementById("MonResStd").value = temp[22];
- document.getElementById("MonSerStd").value = temp[23];
- document.getElementById("MonVolLowToAvg").value = temp[24];
- document.getElementById("Load_curr").value = temp[25];
- document.getElementById("DisCurrMax").value = temp[26];
- document.getElementById("station_phone").value = temp[27];
- document.getElementById("BattProducer").value = temp[28];
- document.getElementById("BattModel").value = temp[29];
- //document.getElementById("startTestrecord").value = temp[30];
- //document.getElementById("endTestrecord").value = temp[31];
- setTimes($("#startTestrecord"),temp[30]);
- setTimes($("#endTestrecord"),temp[31]);
- document.getElementById("install_user").value = temp[32];
+
+ var data = {
+ StationId: '4011100'
+ ,StationName1: '骞胯タ鐪�'
+ ,StationName2: '鐧借壊甯�'
+ ,StationName5: '涔愪笟鍘�'
+ ,StationName3: 'GX鐧捐壊涔愪笟鍘跨珛鏂板皬鍖篧F'
+ ,StationName4: 'BTS璁惧'
+ ,StationIp: '192.168.0.1'
+ ,FBSDeviceId: '960000111'
+ ,FbsDeviceIp: '127.0.0.1'
+ ,FbsDeviceIp_YM: '255.255.255.0'
+ ,FbsDeviceIp_WG: '127.0.0.1'
+ ,FBSDeviceName: 'BTS'
+ ,GroupIndexInFBSDevice: 1
+ ,BattGroupId: 1000005
+ ,BattGroupNum: 2
+ ,BattGroupName: '鐢垫睜缁�1'
+ ,FloatVolLevel: 54
+ ,OfflineVolLevel: 42.9
+ ,BattFloatCurrent: 10
+ ,MonCount: 24
+ ,MonCapStd: 300
+ ,MonVolStd: 2
+ ,MonResStd: 0.2
+ ,MonSerStd: 5000
+ ,MonVolLowToAvg: 0.05
+ ,Load_curr: 15
+ ,DisCurrMax: '0'
+ ,station_phone: 12345678912
+ ,BattProducer: '鍗囬槼'
+ ,BattModel: ''
+ ,productDate: '2018-09-18 00:00:00'
+ ,useDate: '2018-09-18 00:00:00'
+ ,install_user: '鍛靛懙'
+ };
+ console.info(data.StationId);
+ if(temp[34]!="edit"){
+ creatgroupid();
+ document.getElementById("StationId").value = data.StationId;
+ // document.getElementById("station_name1").value = data.StationName1;
+ // document.getElementById("city").value = data.StationName2; //甯�
+ // document.getElementById("county").value = data.StationName5; //鍖哄幙
+ // document.getElementById("StationName3").value = data.StationName3; //鏈烘埧鍚嶇О
+ document.getElementById("StationName4").value = data.StationName4; //璁惧鍚嶇О
+ document.getElementById("StationIp").value = data.StationIp; //璁惧IP
+ //document.getElementById("FBSDeviceId").value = dev_id;
+ document.getElementById("FbsDeviceIp").value = data.FbsDeviceIp;
+ 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("MonCount").value = data.MonCount;
+ // document.getElementById("MonCapStd").value = data.MonCapStd;
+ // 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("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("BattModel").value = data.BattModel;
+ //document.getElementById("startTestrecord").value = temp[30];
+ //document.getElementById("endTestrecord").value = temp[31];
+ setTimes($("#startTestrecord"),data.productDate);
+ setTimes($("#endTestrecord"),data.useDate);
+ // document.getElementById("install_user").value = data.install_user;
+ }else{
+ document.getElementById("StationId").value = temp[0];
+ document.getElementById("station_name1").value = temp[1];
+ document.getElementById("city").value = temp[2]; //甯�
+ document.getElementById("county").value = temp[3]; //鍖哄幙
+ document.getElementById("StationName3").value = temp[4]; //鏈烘埧鍚嶇О
+ document.getElementById("StationName4").value = temp[5]; //璁惧鍚嶇О
+ document.getElementById("StationIp").value = temp[6]; //璁惧IP
+ 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];
+ document.getElementById("FBSDeviceName").value = temp[11];
+ //document.getElementById("GroupIndexInFBSDevice").value = temp[12];
+ document.getElementById("BattGroupId").value = temp[13];
+ document.getElementById("BattGroupNum").value = suoyin;
+ //document.getElementById("BattGroupName").value = temp[15];
+ document.getElementById("FloatVolLevel").value = temp[16];
+ document.getElementById("OfflineVolLevel").value = temp[17];
+ document.getElementById("BattFloatCurrent").value = temp[18];
+ document.getElementById("MonCount").value = temp[19];
+ document.getElementById("MonCapStd").value = temp[20];
+ document.getElementById("MonVolStd").value = temp[21];
+ document.getElementById("MonResStd").value = temp[22];
+ document.getElementById("MonSerStd").value = temp[23];
+ document.getElementById("MonVolLowToAvg").value = temp[24];
+ document.getElementById("Load_curr").value = temp[25];
+ document.getElementById("DisCurrMax").value = temp[26];
+ document.getElementById("station_phone").value = temp[27];
+ document.getElementById("BattProducer").value = temp[28];
+ document.getElementById("BattModel").value = temp[29];
+ //document.getElementById("startTestrecord").value = temp[30];
+ //document.getElementById("endTestrecord").value = temp[31];
+ setTimes($("#startTestrecord"),temp[30]);
+ setTimes($("#endTestrecord"),temp[31]);
+ document.getElementById("install_user").value = temp[32];
+ }
setFloatAndoutLine();
}
@@ -507,21 +596,88 @@
return arr;
}
+ function getUpdateArredit(){
+ var arr = new Array();
+ for(var i=0;i<suoyin;i++){
+ var battString = "#battname"+i;
+ var index = String(i);
+ console.info(battString);
+ var obj = {
+ 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 : $("#BattGroupId").val(), //鐢垫睜缁刬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;
+ }
</script>
- <script type="text/javascript">
- $(function(){
- $(".unable").prop("readonly","readonly").attr("unselectable","on").addClass("uncheck");
- $("#sure").click(function(){
- addBatt();
- function backpage(){window.location.href="ele-param1.html";}
- setTimeout(backpage,500);
- });
- // $("#cancel").click(function(){
- // window.location.href="ele-param1.html";
- // });
- });
+<script type="text/javascript">
+ $(function(){
+ $(".unable").prop("readonly","readonly").attr("unselectable","on").addClass("uncheck");
+ $("#sure").click(function(){
+ if(nullOrn()){
+ if(temp[34]!="edit"){
+ creatgroupid();//鎻愪氦涔嬪墠鍐嶆楠岃瘉锛屽垱寤篒D
+ addBattnew(); //鎻愪氦
+ }else{
+ addBattnew();
+ }
+ }else{
+ } //楠岃瘉閲嶈椤规槸鍚︿负绌猴紝涓虹┖鍒欐彁绀猴紱
+ //function backpage(){window.location.href="ele-param1.html";}
+ // setTimeout(backpage,500);
+ });
+ $("#cancel").click(function(){
+ 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({
@@ -531,11 +687,44 @@
data: "json="+temp,
dataType: 'json',
success:function(data) {
+ data = JSON.parse(data.result);
console.info(data);
+ if(data.code==1){
+ alert("娣诲姞鎴愬姛");
+ window.location.href="batt-unapproved.html";
+ }else{
+ alert("娣诲姞澶辫触");
+ window.location.href="batt-unapproved.html";
+ }
}
});
}
-
+
+ //淇敼鐢垫睜缁勶紝娣诲姞鍒癇ATTINF
+ function editBatt(){
+ var parm = getUpdateArredit();
+ console.info(parm);
+ $.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');
鎿嶄綔澶辫触
--
Gitblit v1.9.1