houseSingleSelectList.jsp 6.2 KB

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