From ff7b4b991990e8528faa686f8db5f101239c6bd1 Mon Sep 17 00:00:00 2001 From: CJJ <Administrator@192.168.10.25> Date: 星期五, 30 十一月 2018 17:32:31 +0800 Subject: [PATCH] 2222 --- gx_tieta/WebRoot/mobil/batt-infor-conf-temp.html | 51 +++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 41 insertions(+), 10 deletions(-) diff --git a/gx_tieta/WebRoot/mobil/batt-infor-conf-temp.html b/gx_tieta/WebRoot/mobil/batt-infor-conf-temp.html index 45e7224..5e02643 100644 --- a/gx_tieta/WebRoot/mobil/batt-infor-conf-temp.html +++ b/gx_tieta/WebRoot/mobil/batt-infor-conf-temp.html @@ -283,9 +283,13 @@ temp=JSON.parse(temp); console.info(temp); console.info(temp[30]); + console.info(temp[33]); installstartdata(temp); - - getUpdateArr(); + if(temp[33]&&temp[33]=="new"){ + + }else{ + + } function installstartdata(temp){ //$("#StationId").value=temp[0]; //var t=document.getElementById("station_name1"); @@ -378,13 +382,17 @@ $(function(){ $(".unable").prop("readonly","readonly").attr("unselectable","on").addClass("uncheck"); $("#sure").click(function(){ - editParm(); - function backpage(){window.location.href="ele-param.html";} - setTimeout(backpage,3000); - }); - $("#cancel").click(function(){ - window.location.href="ele-param.html"; - }); + if(temp[33]&&temp[33]=="new"){ + addBatt(); + }else{ + editParm(); + } + function backpage(){window.location.href="ele-param.html";} + setTimeout(backpage,500); + }); + $("#cancel").click(function(){ + window.location.href="ele-param.html"; + }); }); function editParm(){ var parm = getUpdateArr(); @@ -409,7 +417,30 @@ } }); } - + 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("娣诲姞鐢垫睜缁勫彂鐢熼敊璇�!"); + } + }); + } + /* 鎿嶄綔鎴愬姛 $('#changeSuc').popup('open'); 鎿嶄綔澶辫触 -- Gitblit v1.9.1