houseSelectList.jsp 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <script>
  3. $(function(){
  4. $('#communityId').combobox({
  5. url: whzl.basePath + '/communityAction_findAll',
  6. valueField:'value',
  7. textField:'text',
  8. filter:function(q,row){
  9. var opts=$(this).combobox("options");
  10. //return row[opts.textField].indexOf(q)==0;//
  11. return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
  12. },
  13. onChange:function (newValue,oldValue) {
  14. $('#no').combobox("setValue","");
  15. $('#houseNumber').combobox("setValue","");
  16. $('#no').combobox('reload',whzl.basePath + '/houseAction_findAllNo?house.community.id='+$('#communityId').combobox("getValue"));
  17. }
  18. });
  19. $('#no').combobox({
  20. //editable:false,
  21. url: whzl.basePath + '/houseAction_findAllNo?house.community.id='+$('#communityId').combobox("getValue"),
  22. valueField:'value',
  23. textField:'text',
  24. filter:function(q,row){
  25. var opts=$(this).combobox("options");
  26. //return row[opts.textField].indexOf(q)==0;//
  27. return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
  28. },
  29. onChange:function (newValue,oldValue) {
  30. $('#houseNumber').combobox("setValue","");
  31. $('#houseNumber').combobox('reload',whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityId').combobox("getValue") + '&house.no='+newValue);
  32. }
  33. });
  34. $('#houseNumber').combobox({
  35. //editable:false,
  36. url: whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityId').combobox("getValue") + '&house.no='+$('#no').combobox("getValue"),
  37. valueField:'value',
  38. textField:'text',
  39. filter:function(q,row){
  40. var opts=$(this).combobox("options");
  41. //return row[opts.textField].indexOf(q)==0;//
  42. return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
  43. }
  44. });
  45. //户型
  46. $.ajax({
  47. type: "post",//使用post方法访问后台
  48. dataType: "json",//返回json格式的数据
  49. url: "aa10Action_listAa10All",//要访问的后台地址
  50. data:{"aa10.letter":"roomType" ,"aa10.name":"户型" },
  51. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  52. success: function(msg){//msg为返回的数据,在这里做数据绑定
  53. if(msg.success){
  54. roomTypeObj = msg.obj.rows;
  55. var select_arr = [];
  56. var data = roomTypeObj;
  57. for(var nItem = 0; nItem < data.length; nItem++ ){
  58. select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
  59. }
  60. roomType_array = select_arr.join("");
  61. $("#roomType").append(roomType_array);
  62. }
  63. }
  64. });
  65. });
  66. /**查询*/
  67. function searchFun1(){
  68. var params = encodeURI("house.community.id="+trim($('#communityId').combobox("getValue"))+
  69. "&house.no="+trim($('#no').combobox("getValue"))+
  70. "&house.houseNumber="+trim($('#houseNumber').combobox("getValue"))+
  71. "&house.roomType="+trim($('#roomType').val())//+paramValue
  72. );
  73. $('#houseSelectDataGrid').datagrid({url:whzl.basePath + '/houseAction_listHouseAll?'+params,pageNumber:1});
  74. }
  75. var house_select_load = function(){
  76. $('#houseSelectDataGrid').datagrid({
  77. rownumbers:true,
  78. fit:true,
  79. fitColumns:false,
  80. border:false,
  81. sortOrder:'desc',
  82. url:whzl.basePath + '/houseAction_listHouseAll?x=0',
  83. toolbar:'#searchtoolHouse',
  84. singleSelect:true,
  85. checkOnSelect:true,
  86. selectOnCheck:true,
  87. nowrap:true,
  88. loadFilter:function(result){
  89. if(result.success){
  90. return result.obj;
  91. }else{
  92. return ;
  93. }
  94. }
  95. });
  96. }
  97. var house_select_submit = function(){
  98. var selectedItems = $('#houseSelectDataGrid').datagrid('getSelected');
  99. houseId = selectedItems.id;
  100. return houseId;
  101. }
  102. </script>
  103. <div class="easyui-layout" data-options="fit:true,border:false">
  104. <div data-options="region:'center',border:false">
  105. <div id="searchtoolHouse" data-options="region:'north',border:false">
  106. <div class="clear"></div>
  107. <table id="tblQuery" style="width:100%;font-size:12px;">
  108. <tr>
  109. <td align="right"><span>小区名称</span></td>
  110. <td colspan="4">
  111. <input id="communityId">
  112. <input id="no" style="width: 60px;">幢
  113. <input id="houseNumber" style="width: 80px;">室
  114. </td>
  115. </tr>
  116. <tr>
  117. <td align="right"><span>户型</span></td>
  118. <td>
  119. <select id="roomType">
  120. <option value="">全部</option>
  121. </select>
  122. </td>
  123. <td align="left">
  124. <a href="javascript:searchFun1();" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">查询</a>
  125. <a href="javascript:ClearQuery();" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true">清空</a>
  126. </td>
  127. </tr>
  128. </table>
  129. <div class="clear"></div>
  130. </div>
  131. <table id="houseSelectDataGrid" >
  132. <thead frozen="true">
  133. <tr><th data-options="field:'id',checkbox:true,width:30">ID</th>
  134. </tr>
  135. </thead>
  136. <thead>
  137. <tr>
  138. <th data-options="field:'communityName',width:100">小区名称</th>
  139. <th data-options="field:'address',width:200">居住地点</th>
  140. <th data-options="field:'houseNumber',width:40">房号</th>
  141. <th data-options="field:'area',width:60">面积</th>
  142. </tr>
  143. </thead>
  144. </table>
  145. </div>
  146. </div>