123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
- <script>
- /**户型*/
- var roomTypeFormatter_houseSelect = function(value , row , index){
- if(row.roomType ==2){
- return "二居室";
- }else{
- return "一居室";
- }
- };
- $(function(){
-
- $('#houseSelectDataGrid').datagrid({
- onSelect: function (rowIndex, rowData) {
- $('#colSize').text($('#houseSelectDataGrid').datagrid('getSelections').length);
- }
- });
-
-
- $('#area').combobox({
- url: whzl.basePath + '/houseRegisterAction_listChildrenCombobox',
- valueField:'value',
- textField:'text',
- onChange:function (newValue,oldValue) {
- $('#communityId').combobox("setValue","");
- $('#no').combobox("setValue","");
- $('#houseNumber').combobox("setValue","");
- $('#communityId').combobox('reload',whzl.basePath + '/communityAction_findAll?community.area='+newValue);
- }
- });
- $('#communityId').combobox({
- url: whzl.basePath + '/communityAction_findAll',
- valueField:'value',
- textField:'text',
- filter:function(q,row){
- var opts=$(this).combobox("options");
- //return row[opts.textField].indexOf(q)==0;//
- return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
- },
- onChange:function (newValue,oldValue) {
- $('#no').combobox("setValue","");
- $('#houseNumber').combobox("setValue","");
- $('#no').combobox('reload',whzl.basePath + '/houseAction_findAllNo?house.community.id='+$('#communityId').combobox("getValue"));
- }
- });
- $('#no').combobox({
- //editable:false,
- url: whzl.basePath + '/houseAction_findAllNo?house.community.id='+$('#communityId').combobox("getValue"),
- valueField:'value',
- textField:'text',
- filter:function(q,row){
- var opts=$(this).combobox("options");
- //return row[opts.textField].indexOf(q)==0;//
- return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
- },
- onChange:function (newValue,oldValue) {
- $('#houseNumber').combobox("setValue","");
- $('#houseNumber').combobox('reload',whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityId').combobox("getValue") + '&house.no='+newValue);
- }
- });
- $('#houseNumber').combobox({
- //editable:false,
- url: whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityId').combobox("getValue") + '&house.no='+$('#no').combobox("getValue"),
- valueField:'value',
- textField:'text',
- filter:function(q,row){
- var opts=$(this).combobox("options");
- //return row[opts.textField].indexOf(q)==0;//
- return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
- }
- });
-
- //户型
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "aa10Action_listAa10All",//要访问的后台地址
- data:{"aa10.letter":"roomType" ,"aa10.name":"户型" },
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- roomTypeObj = msg.obj.rows;
- var select_arr = [];
- var data = roomTypeObj;
- for(var nItem = 0; nItem < data.length; nItem++ ){
- select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
- }
- roomType_array = select_arr.join("");
- $("#roomType").append(roomType_array);
- }
- }
- });
- });
-
- /**查询*/
- function searchFun(){
- var params = encodeURI("house.community.id="+trim($('#communityId').combobox("getValue"))+
- "&house.no="+trim($('#no').combobox("getValue"))+
- "&house.houseNumber="+trim($('#houseNumber').combobox("getValue"))+
- "&house.roomType="+trim($('#roomType').val())+
- paramValue
- );
- $('#houseSelectDataGrid').datagrid({url:whzl.basePath + '/houseAction_listHouseAll?'+params,pageNumber:1});
- }
- var paramValue;
- var house_select_load = function(param){
- paramValue = param;
- $('#houseSelectDataGrid').datagrid({
- rownumbers:true,
- fit:true,
- fitColumns:false,
- border:false,
- sortOrder:'desc',
- url:whzl.basePath + '/houseAction_listHouseAll?x=0' + param,
- toolbar:'#searchtoolHouse',
- checkOnSelect:true,
- selectOnCheck:true,
- nowrap:true,
- rowStyler:function(index,row){
- if(row.roomType == 1){
- return 'background-color:yellow;color:blue;font-weight:bold;';
- }
- },
- loadFilter:function(result){
- if(result.success){
- return result.obj;
- }else{
- return ;
- }
- }
- });
- }
-
-
- var house_select_submit = function(){
-
- var selectedItems = $('#houseSelectDataGrid').datagrid('getSelections');
- var ids = [];
- $.each(selectedItems,function(index,item){
- ids.push(item.id);
- })
- if(ids.length==0){
- $.messager.alert("警告","请选择至少一条记录!");
- return;
- }
- var idsStr = ids.join(",");
- return idsStr;
- }
-
- </script>
- <div class="easyui-layout" data-options="fit:true,border:false">
- <div data-options="region:'center',border:false">
- <div id="searchtoolHouse" data-options="region:'north',border:false">
- <div class="clear"></div>
- <table id="tblQuery" style="width:100%;font-size:12px;">
- <tr>
- <td align="right"><span>小区名称</span></td>
- <td colspan="4">
- <select id="area" style="width:100px;">
- <option value="">全部</option>
- </select>
- <input id="communityId">
- <input id="no" style="width: 60px;">幢
- <input id="houseNumber" style="width: 80px;">室
- </td>
- </tr>
- <tr>
- <td align="right"><span>户型</span></td>
- <td>
- <select id="roomType">
- <option value="">全部</option>
- </select>
- </td>
- <td align="left">
- <a href="javascript:searchFun();" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">查询</a>
- <a href="javascript:ClearQuery();" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true">清空</a>
-
- 已选中<span id="colSize" >0</span>行
- </td>
- </tr>
- </table>
- <div class="clear"></div>
- </div>
- <table id="houseSelectDataGrid" >
- <thead frozen="true">
- <tr><th data-options="field:'id',checkbox:true,width:30">ID</th>
- </tr>
- </thead>
- <thead>
- <tr>
- <th data-options="field:'communityName',width:150">小区名称</th>
- <th data-options="field:'address',width:200">居住地点</th>
- <th data-options="field:'roomType',width:60,formatter:roomTypeFormatter_houseSelect">户型</th>
- <th data-options="field:'houseNumber',width:40">房号</th>
- <th data-options="field:'area',width:60">面积</th>
- </tr>
- </thead>
- </table>
- </div>
- </div>
|