From ee60b65f6fe4caff943d4ef7f51ca590bf14dfe7 Mon Sep 17 00:00:00 2001 From: CJJ <Administrator@192.168.10.26> Date: 星期三, 21 十一月 2018 15:52:44 +0800 Subject: [PATCH] 手机 电池实时状态查询 --- gx_tieta/WebRoot/mobil/elestatus.html | 345 +++++++++++++++++++++++++++++++++++-------------- gx_tieta/WebRoot/mobil/taskplan2.html | 40 ++-- 2 files changed, 267 insertions(+), 118 deletions(-) diff --git a/gx_tieta/WebRoot/mobil/elestatus.html b/gx_tieta/WebRoot/mobil/elestatus.html index 9a1d445..d2dc51d 100644 --- a/gx_tieta/WebRoot/mobil/elestatus.html +++ b/gx_tieta/WebRoot/mobil/elestatus.html @@ -21,18 +21,26 @@ <div class="fg-panel-header">绛涢��</div> <div class="fg-panel-content"> <fieldset data-role="controlgroup"> - <p>缁存姢鍖�</p> - <select id="privince" data-mini="true"> - <option value="">鍏ㄩ儴</option> - </select> - <p>鏈烘埧鍚嶇О</p> + <p>鐪�</p> + <select id="mainteArea" data-mini="true"> + <option value="">鍏ㄩ儴</option> + </select> + <p>甯�</p> <select id="city" data-mini="true"> <option value="">鍏ㄩ儴</option> </select> - <p>鐢垫睜缁勫悕绉�</p> - <select id="battgroup_name" data-mini="true"> + <p>鍖�/鍘�</p> + <select id="country" data-mini="true"> <option value="">鍏ㄩ儴</option> - </select> + </select> + <p>鏈烘埧绔欑偣</p> + <select id="homeName" data-mini="true"> + <option value="">鍏ㄩ儴</option> + </select> + <p>钃勭數姹犵粍</p> + <select id="battgroup_name" data-mini="true"> + <option value="0">鍏ㄩ儴</option> + </select> <p>鐢垫睜鐘舵��</p> <select id="eleStatus" data-mini="true"> <option value="100">鍏ㄩ儴</option> @@ -114,9 +122,11 @@ var temp={ binf:{ num:$('#eleStatus').val(), //鐢垫睜鐘舵�� - StationName:$('#city').val(), //鏈烘埧鍚� - StationName1:$('#privince').val(), //缁存姢鍖� - BattGroupId:$('#battgroup_name').val(), //鐢垫睜缁勫悕绉� + StationName1:$('#mainteArea').val(), + StationName2:$('#city').val(), + StationName5: $('#country').val(), + StationName:$('#homeName').val(), + BattGroupId:$('#battgroup_name').val(), }, page:{ pageSize:Page.pageSize, //椤甸潰澶у皬 @@ -206,98 +216,237 @@ min_num = value; return day_num+"澶�"+hour_num+"灏忔椂"+min_num+"鍒�"; } - - //鐐瑰嚮绛涢�夊脊鍑洪�夋嫨妗嗘椂,鏌ヨ缁存姢鍖轰腑鐨勬灑绾界被鍨�(灏濊瘯鍔犺浇灏辫繑鍥炴暟鎹�) + //椤甸潰鍔犺浇鏃舵煡璇㈢渷 $.post("BattInfAction_serchByStation",null,function(data){ - data=data.result; - data=eval("("+data+")"); - console.info(data); + data = data.result; + data = eval("("+data+")"); + //console.info(data); + //console.info(data.code); + if(data.code==1&&data.data.length>0){ + var $Ostation_name1=$("#mainteArea"); + $Ostation_name1.text(""); + var arr = new Array(); + for(var i=0;i<=data.data.length;i++) + { + if(i == 0){ + arr.push({ + val:"", + txt:"鍏ㄩ儴(鍏�"+data.sum+"涓�)", + }); + }else{ + arr.push({ + val:data.data[i-1].StationName1, + txt:data.data[i-1].StationName1, + }); + } + } + updataSel($Ostation_name1, arr); + } + findCity(); + }); + + +//褰撶渷鏀瑰彉鏃舵洿鏂板競 + function findCity(){ + var data = { + StationName1: $("#mainteArea").val() + }; + //console.info(data); + // 璇锋眰鑾峰彇褰撳墠鐪佷笅鐨勫競 + $.ajax({ + type: "post", + url: "BattInfAction!serchStationName2", + async:true, + dataType:'json', + data:"json = "+JSON.stringify(data), + success: function(data){ + data = data.result; + data = eval("("+data+")"); + //console.info(data); + //console.info(data.code); + if(data.code==1&&data.data.length>0){ + var $Ostation_name1=$("#city"); + $Ostation_name1.text(""); + var arr = new Array(); + for(var i=0;i<=data.data.length;i++) + { + if(i == 0){ + arr.push({ + val:"", + txt:"鍏ㄩ儴(鍏�"+data.data.length+"涓�)", + }); + }else{ + arr.push({ + val:data.data[i-1].StationName2, + txt:data.data[i-1].StationName2, + }); + } + } + updataSel($Ostation_name1, arr); + } + findCounty(); + } + }); + } - if(data.code==1 && data.data.length>0){ - var $select=$("#privince"); - $select.text(""); - for(var i=0;i<=data.data.length;i++){ - $option=$("<option></option>"); - if(i==0){ - $option.html("鍏ㄩ儴(鍏�"+data.sum+"鑺�)"); - $option.attr("value", ""); - $select.siblings('span').text($option.text()); - }else{ - $option.text(data.data[i-1].StationName1); - $option.attr("value",data.data[i-1].StationName1); - } - $select.append($option); - } - } - findStationNamebyStationname1(); - }); - - //褰撶淮鎶ゅ尯鐨勫�煎彉鎹㈡椂鏇存柊鏈烘埧绔欑偣 - $('#privince').change(function(){ - findStationNamebyStationname1(); - }); - - //鏍规嵁缁存姢鍖烘煡璇㈢珯鐐� - function findStationNamebyStationname1(){ - var selectvalue=$("#privince option:selected").val(); - //alert(selectvalue); - $.post("BattInfAction_serchByStationName","bif.StationName1="+selectvalue,function(data){ - data=data.result; - data=eval("("+data+")"); - console.info(data); - if(data.code==1 && data.data.length>0){ - var $select = $("#city"); - $select.text(""); - for(var i=0;i<data.data.length;i++){ - var $option=$("<option></option>"); - $option.text(data.data[i].StationName); - $option.attr("value",data.data[i].StationName); - if(i==0){ - //$option.html("鍏ㄩ儴(鍏�"+data.sum+"绉�)"); - //$option.attr("value", ""); - $select.siblings('span').text($option.text()); - }else{ - - } - $select.append($option); - } - } - findserchByBattGroupNamebystationname(); - }); - } +//褰撳競鏀瑰彉鏃舵洿鏂板尯/鍘� + function findCounty(){ + var data = { + StationName1: $("#mainteArea").val(), + StationName2:$("#city").val(), + }; + //console.info(data); + $.ajax({ + type: "post", + url: "BattInfAction!serchStationName5", + async:true, + dataType:'json', + data:"json = "+JSON.stringify(data), + success: function(data){ + data = data.result; + data = eval("("+data+")"); + //console.info(data); + //console.info(data.code); + if(data.code==1&&data.data.length>0){ + var $Ostation_name1=$("#country"); + $Ostation_name1.text(""); + var arr = new Array(); + for(var i=0;i<=data.data.length;i++) + { + if(i == 0){ + arr.push({ + val:"", + txt:"鍏ㄩ儴(鍏�"+data.data.length+"涓�)", + }); + }else{ + arr.push({ + val:data.data[i-1].StationName5, + txt:data.data[i-1].StationName5, + }); + } + } + updataSel($Ostation_name1, arr); + } + findStationNamebyStationname1(); + } + }); + } + + //褰撳尯鍘挎洿鏂版椂鏇存柊鏈烘埧 + function findStationNamebyStationname1(){ + var data = { + StationName1: $("#mainteArea").val(), + StationName2:$("#city").val(), + StationName5:$("#country").val() + }; + //console.info(data); + $.ajax({ + type: "post", + url: "BattInfAction!serchStationName3", + async:true, + dataType:'json', + data:"json = "+JSON.stringify(data), + success: function(data){ + data = data.result; + data = eval("("+data+")"); + //console.info(data); + //console.info(data.code); + if(data.code==1&&data.data.length>0){ + var $Ostation_name1=$("#homeName"); + $Ostation_name1.text(""); + var arr = new Array(); + for(var i=0;i<=data.data.length;i++) + { + if(i == 0){ + arr.push({ + val:"", + stationid:"", + txt:"鍏ㄩ儴(鍏�"+data.data.length+"涓�)", + }); + }else{ + arr.push({ + val:data.data[i-1].StationName, + stationid:data.data[i-1].StationId, + txt:data.data[i-1].StationName3, + }); + } + } + //console.info(111111111111111); + updataSelStation($Ostation_name1, arr); + } + + findserchByBattGroupNamebystationname(); + } + }); + } + + //鏍规嵁鏈烘埧鑾峰彇鐢垫睜缁� + function findserchByBattGroupNamebystationname(){ + var stationid = $("#station_name").find('option:selected').attr('stationid')?$("#station_name").find('option:selected').attr('stationid'):''; + + var data = { + StationName1: $("#mainteArea").val(), + StationName2:$("#city").val(), + StationName5:$("#country").val(), + StationName: $("#homeName").val(), + StationId: stationid + }; - $("#city").on('change',function(){ + //console.info(data); + $.ajax({ + type: "post", + url: "BattInfAction!serchBattByStation", + async:true, + dataType:'json', + data:"json = "+JSON.stringify(data), + success: function(data){ + data = data.result; + data = eval("("+data+")"); + //console.warn(); + //console.info(data); + //console.info(data.code); + if(data.code==1&&data.data.length>0){ + var $Ostation_name1=$("#battgroup_name"); + $Ostation_name1.text(""); + var arr = new Array(); + for(var i=0;i<=data.data.length;i++) + { + if(i == 0){ + arr.push({ + val:0, + txt:"鍏ㄩ儴(鍏�"+data.data.length+"涓�)", + }); + }else{ + arr.push({ + val:data.data[i-1].BattGroupId, + txt:data.data[i-1].BattGroupName, + }); + } + } + updataSel($Ostation_name1, arr); + } + + } + }); + } + + //褰撶渷鏀瑰彉鏃舵洿鏂板競 + $('#mainteArea').change(function(){ + findCity(); + }); + //褰撳競鏀瑰彉鏃舵敼鍙樺尯/鍘� + $('#city').change(function(){ + findCounty(); + }); + //褰撳尯/鍘挎敼鍙樻椂鏀瑰彉鏈烘埧 + $('#country').change(function(){ + findStationNamebyStationname1(); + }); + //褰撴満鎴挎敼鍙樻椂锛屾洿鏂扮數姹犵粍 + $('#homeName').change(function(){ findserchByBattGroupNamebystationname(); }); - - //鏍规嵁缁存姢鍖哄拰鏈烘埧鏌ヨ钃勭數姹犵粍 - function findserchByBattGroupNamebystationname(){ - var station_name1=$("#privince option:selected").val(); - var station_name=$("#city option:selected").val(); - $.post("BattInfAction_serchByBattGroupName","bif.StationName1="+station_name1+"&bif.StationName="+station_name,function(data){ - data=data.result; - //console.info(data); - data=eval("("+data+")"); - //console.info(data.data.length); - if(data.code==1 && data.data.length>0){ - var $Obattgroup_name = $("#battgroup_name"); - $Obattgroup_name.text(""); - for(var i=0;i<=data.data.length;i++){ - var $option = $("<option></option>"); - if(i!=0){ - $option.text(data.data[i-1].BattGroupName+"-"+data.data[i-1].MonCount+"鑺�"); - $option.attr("value",data.data[i-1].BattGroupId); - }else{ - $option.html("鍏ㄩ儴(鍏�"+data.sum+"绉�)"); - $option.attr("value", "0"); - $Obattgroup_name.siblings('span').text($option.text()); - } - $Obattgroup_name.append($option); - } - } - }); - } - + //璁剧疆椤甸潰鐨勮烦杞摼鎺� function setPage(){ if(Page.pageCurr <= 1){ diff --git a/gx_tieta/WebRoot/mobil/taskplan2.html b/gx_tieta/WebRoot/mobil/taskplan2.html index 1870775..c1e8fea 100644 --- a/gx_tieta/WebRoot/mobil/taskplan2.html +++ b/gx_tieta/WebRoot/mobil/taskplan2.html @@ -19,25 +19,25 @@ <div class="fg-panel-header">绛涢��</div> <div class="fg-panel-content"> <p>鐪�</p> - <select id="mainteArea" data-mini="true"> - <option value="">鍏ㄩ儴</option> - </select> - <p>甯�</p> - <select id="city" data-mini="true"> - <option value="">鍏ㄩ儴</option> - </select> - <p>鍖�/鍘�</p> - <select id="country" data-mini="true"> - <option value="">鍏ㄩ儴</option> - </select> - <p>鏈烘埧绔欑偣</p> - <select id="homeName" data-mini="true"> - <option value="">鍏ㄩ儴</option> - </select> - <p>钃勭數姹犵粍</p> - <select id="battgroup_name" data-mini="true"> - <option value="0">鍏ㄩ儴</option> - </select> + <select id="mainteArea" data-mini="true"> + <option value="">鍏ㄩ儴</option> + </select> + <p>甯�</p> + <select id="city" data-mini="true"> + <option value="">鍏ㄩ儴</option> + </select> + <p>鍖�/鍘�</p> + <select id="country" data-mini="true"> + <option value="">鍏ㄩ儴</option> + </select> + <p>鏈烘埧绔欑偣</p> + <select id="homeName" data-mini="true"> + <option value="">鍏ㄩ儴</option> + </select> + <p>钃勭數姹犵粍</p> + <select id="battgroup_name" data-mini="true"> + <option value="0">鍏ㄩ儴</option> + </select> <fieldset data-role="collapsible" data-collapsed="false" data-mini="true"> <legend><strong>鏃堕棿娈甸�夋嫨锛�</strong></legend> <label for="startTime"><strong>寮�濮嬫椂闂达細</strong></label> @@ -263,7 +263,7 @@ function creatObj(){ var temp={ binf:{ - StationName1:$('#mainteArea').val(), + StationName1:$('#mainteArea').val(), StationName2:$('#city').val(), StationName5: $('#country').val(), StationName:$('#homeName').val(), -- Gitblit v1.9.1