| | |
| | | <form action="" id="search_form">
|
| | | <table>
|
| | | <tr class="fWeight">
|
| | | <td><s:text name="Maintenance_area"/></td> <!-- 维护区 -->
|
| | | <td>省</td> <!-- 省 -->
|
| | | <td>市</td> <!-- 市 -->
|
| | | <td><s:text name="Computer_name"/></td> <!-- 机房名称 -->
|
| | | <td><s:text name="Cruising_ability"/><s:text name="Type"/></td> <!-- 续航能力类型 -->
|
| | | <td colspan="2"><s:text name="Battery_record_time"/></td> <!-- 电池测试记录时间段 -->
|
| | |
| | | <tr>
|
| | | <td>
|
| | | <select id="station_name1">
|
| | | |
| | | </select>
|
| | | </td>
|
| | | <td>
|
| | | <select id="city">
|
| | |
|
| | | </select>
|
| | | </td>
|
| | |
| | | });
|
| | | }
|
| | |
|
| | | $(document).ready(function(){
|
| | | // 省-市-机房-电池组
|
| | | $(document).ready(function(){
|
| | | //页面加载时查询维护区中的枢纽类型
|
| | | $.post("User_battgroup_baojigroup_battgroupAction!serchStationName1InGroup",null,function(data){
|
| | | data=data.result;
|
| | |
| | | }else{
|
| | | $("#station_name1").text('').html('<option>暂无管理的维护区</option>');
|
| | | }
|
| | | findStationNamebyStationname1(); |
| | | findCity(); |
| | | });
|
| | | });
|
| | |
|
| | | //当维护区的值变换时更新机房站点
|
| | | // 根据维护区的内容查询市
|
| | | function findCity() {
|
| | | var data = {
|
| | | StationName1: $("#station_name1").val()
|
| | | };
|
| | | // 请求获取当前省下的市
|
| | | $.ajax({ |
| | | type: "post", |
| | | url: "BattInfAction!serchStationName2", |
| | | async:true, |
| | | dataType:'json',
|
| | | data:"json = "+JSON.stringify(data), |
| | | success: function(data){
|
| | | var rs = JSON.parse(data.result);
|
| | | var $select = $("#city");
|
| | | if(rs.code == 1) {
|
| | | var _data= rs.data;
|
| | | // 根据数据构造生成下拉列表的数据
|
| | | var optsList = [];
|
| | | for(var i=0;i<_data.length;i++){
|
| | | var __data = _data[i];
|
| | | var tmp = getOptionsData(__data.StationName2, __data.StationName2, __data);
|
| | | optsList.push(tmp);
|
| | | }
|
| | | // 根据数据生成下拉列表
|
| | | createOptions($select, optsList, true);
|
| | | }else {
|
| | | $select.text('').html('<option>暂无可测市</option>');
|
| | | }
|
| | | findStationNamebyStationname1();
|
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | //当维护区的值变换时更新市
|
| | | $('#station_name1').change(function(){
|
| | | findCity();
|
| | | });
|
| | | |
| | | //当维护区的值变换时更新机房站点
|
| | | $('#city').change(function(){
|
| | | findStationNamebyStationname1();
|
| | | });
|
| | |
|
| | | //根据维护区查询站点
|
| | | //根据省,市查询站点
|
| | | function findStationNamebyStationname1(){
|
| | | var user = {
|
| | | UNote:$("#station_name1 option:selected").val()
|
| | | var tmp = {
|
| | | StationName1:$("#station_name1").val(),
|
| | | StationName2:$("#city").val()
|
| | | };
|
| | | //var selectvalue=$("#station_name1 option:selected").val();
|
| | | //alert(selectvalue);
|
| | | $.post("User_battgroup_baojigroup_battgroupAction!serchStationNameInGroup","json="+JSON.stringify(user),function(data){
|
| | | //console.info(data);
|
| | | data=data.result;
|
| | | data=eval("("+data+")");
|
| | | if(data.code==1 && data.data.length>0){
|
| | | $.post("BattInfAction!serchStationName3","json="+JSON.stringify(tmp),function(data){
|
| | | var rs = JSON.parse(data.result);
|
| | | if(rs.code==1){
|
| | | var _data = rs.data;
|
| | | var $select = $("#station_name");
|
| | | $select.text('');
|
| | | for(var i=0;i<data.data.length;i++){
|
| | | var $option=$("<option></option>");
|
| | | /* if(i==0){
|
| | | $option.html("<s:text name='All'/>(<s:text name='Common'/>"+data.data.length+"<s:text name='Species'/>)"); |
| | | $option.attr("value", ""); |
| | | }else */
|
| | | {
|
| | | $option.text(data.data[i]);
|
| | | $option.attr("value",data.data[i]); |
| | | } |
| | | $select.append($option);
|
| | | // 根据数据构造生成下拉列表的数据
|
| | | var optsList = [];
|
| | | for(var i=0;i<_data.length;i++){
|
| | | var __data = _data[i];
|
| | | var _attr = {
|
| | | StationId: __data.StationId
|
| | | };
|
| | | var tmp = getOptionsData(__data.StationName3, __data.StationName3, __data, _attr);
|
| | | optsList.push(tmp);
|
| | | }
|
| | | |
| | | // 根据数据生成下拉列表
|
| | | createOptions($select, optsList, true);
|
| | | }else{
|
| | | $("#station_name").text('').html('<option>暂无管理的机房站点</option>');
|
| | | $("#station_name").text('').html('<option>暂无可测机房站点</option>');
|
| | | }
|
| | | ///findserchByBattGroupNamebystationname();
|
| | | });
|
| | | }
|
| | | |
| | | /* //页面加载时查询维护区中的枢纽类型
|
| | | $.post("BattInfAction_serchByStation",null,function(data){
|
| | | data=data.result;
|
| | | data=eval("("+data+")");
|
| | | //console.info(data);
|
| | | if(data.code==1 && data.data.length>0){
|
| | | var $select=$("#station_name1");
|
| | | $select.text("");
|
| | | for(var i=0;i<=data.data.length;i++){
|
| | | $option=$("<option></option>");
|
| | | if(i==0){
|
| | | $option.html("<s:text name='All'/>(<s:text name='Common'/>"+data.sum+"<s:text name='Species'/>)"); |
| | | $option.attr("value", ""); |
| | | }else{
|
| | | $option.text(data.data[i-1].StationName1);
|
| | | $option.attr("value",data.data[i-1].StationName1); |
| | | } |
| | | $select.append($option);
|
| | | } |
| | | }
|
| | | findStationNamebyStationname1(); |
| | | });
|
| | | |
| | | //当维护区的值变换时更新机房站点
|
| | | $('#station_name1').change(function(){
|
| | | findStationNamebyStationname1();
|
| | | });
|
| | | |
| | | //根据维护区查询站点
|
| | | function findStationNamebyStationname1(){
|
| | | //var stationid = getQueryString("stationId");
|
| | | var selectvalue=$("#station_name1 option:selected").val();
|
| | | //alert(selectvalue);
|
| | | $.post("BattInfAction_serchByStationName","bif.StationName1="+selectvalue,function(data){
|
| | | //console.info(data);
|
| | | data=data.result;
|
| | | data=eval("("+data+")");
|
| | | if(data.code==1 && data.data.length>0){
|
| | | var $select = $("#station_name");
|
| | | $select.text("");
|
| | | for(var i=0;i<=data.data.length;i++){
|
| | | var $option=$("<option></option>");
|
| | | if(i==0){
|
| | | $option.html("<s:text name='All'/>(<s:text name='Common'/>"+data.sum+"<s:text name='Species'/>)"); |
| | | $option.attr("value", ""); |
| | | }else{
|
| | | $option.text(data.data[i-1].StationName);
|
| | | $option.attr("value",data.data[i-1].StationName); |
| | | |
| | | } |
| | | $select.append($option);
|
| | | }
|
| | | }
|
| | | });
|
| | | } */
|
| | | |
| | |
|
| | | //构造查询条件
|
| | | function createSearchParam(){
|
| | |
| | | num:3, //电池状态
|
| | | BattGroupId:$("#endu_type").val(), //查询数据
|
| | | StationName:$('#station_name').val(), //机房名
|
| | | StationName2:$('#city').val(), //市
|
| | | StationName1:$('#station_name1').val(), //维护区
|
| | | BattProductDate:$('#starttime').val()+" 00:00:00",
|
| | | BattProductDate1:$('#endtime').val()+" 23:59:59", //生产日期段
|