deliveryHouse.jsp 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <%--房源交付--%>
  2. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  3. <jsp:include page="../../common/include.jsp" />
  4. <% String basePath = request.getScheme()+ "://" + request.getServerName() + ":" +request.getServerPort() + request.getContextPath(); %>
  5. <script type="text/javascript">
  6. $(function(){
  7. $('#deliveryHouseDataGrid').datagrid({
  8. rownumbers:true,
  9. fit:true,
  10. pageSize:10,
  11. pageList : [ 10, 20, 30, 40, 50 ],
  12. fitColumns:false,
  13. border:false,
  14. sortOrder:'desc',
  15. pagination:true,
  16. idField:'id',
  17. toolbar:'#searchtool',
  18. url:whzl.basePath + '/yaohaoAction_deliveryHouseList',
  19. pageNumber:1,
  20. nowrap:true,
  21. loadFilter:function(result){
  22. if(result.success){
  23. return result.obj;
  24. }else{
  25. $.messager.alert("提示",result.message);
  26. return ;
  27. }
  28. }
  29. });
  30. })
  31. /**查询*/
  32. function searchFun(){
  33. $("#deliveryHouseDataGrid").datagrid("load", {
  34. "securityPersonHouse.house.community.id":trim($('#communityId').combobox("getValue")),
  35. "securityPersonHouse.house.no":trim($('#no').combobox("getValue")),
  36. "securityPersonHouse.house.houseNumber":trim($('#houseNumber').combobox("getValue")),
  37. "securityPersonHouse.securityPerson.idCard":trim($('#lesseeId').val())
  38. });
  39. }
  40. /*清除查询条件**/
  41. function ClearQuery() {
  42. $("#tblQuery").find("input").val("");
  43. $("#tblQuery").find("select").val("-1");
  44. }
  45. var securityPersonNameFormatter = function(value , row , index){
  46. return row.securityPerson.name;
  47. }
  48. var isOtherProtectFormatter = function(value , row , index){
  49. if(row.securityPerson.applyType != undefined && row.securityPerson.waitApplyType != undefined &&row.securityPerson.waitApplyType != ''){
  50. if(row.securityPerson.applyType == "1"){
  51. return "补贴在保";
  52. }
  53. }else{
  54. return "无其他保障";
  55. }
  56. }
  57. var houseAddressFormatter = function(value , row , index){
  58. return row.house.address;
  59. }
  60. var isExistHouseFormatter = function(value , row , index){
  61. if(row.house.isExistHouse == "1"){
  62. return "现房";
  63. }else if(row.house.isExistHouse == "2"){
  64. return "期房";
  65. }
  66. }
  67. var deliveryFormatter = function(value , row , index){
  68. if(row.state == "0"){
  69. return "<img src='<%=basePath%>/images/pencil.png' title='交付' onclick=changeApplyType(" + row.id +","+row.securityPerson.id +","+row.house.id+",'"+row.securityPerson.name+"','"+row.securityPerson.applyType+"','"+row.house.address+ "') style='cursor:pointer' />";
  70. }else if(row.state == "1"){
  71. return "已交付"
  72. }
  73. }
  74. function changeApplyType(id,securityPersonId,houseId,name,applyType,address){
  75. if(applyType != "2"){
  76. $.messager.confirm('提醒', '是否停止其他保障', function(r){
  77. if(r){
  78. $.ajax({
  79. type: "post",//使用get方法访问后台
  80. dataType: "json",//返回json格式的数据
  81. url: "securityPersonAction_changeApplyType",//要访问的后台地址
  82. data: "securityPerson.id="+securityPersonId,//要发送的数据
  83. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  84. success: function(msg){
  85. if(msg.success){
  86. deliveryHouse(id,houseId,name,address);
  87. }
  88. }
  89. })
  90. }
  91. })
  92. }else{
  93. deliveryHouse(id,houseId,name,address)
  94. }
  95. }
  96. function deliveryHouse(id,houseId,name,address){
  97. $.messager.confirm('提醒', '是否将'+address+'交付给'+name, function(r){
  98. if(r){
  99. $.ajax({
  100. type: "post",//使用get方法访问后台
  101. dataType: "json",//返回json格式的数据
  102. url: "houseAction_deliveryHouse",//要访问的后台地址
  103. async:false,
  104. data: "house.id="+houseId,//要发送的数据
  105. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  106. success: function(msg){
  107. if(msg.success){
  108. }
  109. }
  110. })
  111. $.ajax({
  112. type: "post",//使用get方法访问后台
  113. dataType: "json",//返回json格式的数据
  114. url: "securityPersonHouseAction_deliveryHouse",//要访问的后台地址
  115. async:false,
  116. data: "securityPersonHouse.id="+id,//要发送的数据
  117. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  118. success: function(msg){
  119. if(msg.success){
  120. }
  121. }
  122. })
  123. }
  124. })
  125. }
  126. </script>
  127. <div class="easyui-layout" data-options="fit:true,border:false">
  128. <div data-options="region:'center',border:false">
  129. <div id="searchtool" data-options="region:'north',border:false">
  130. <div class="clear"></div>
  131. <table id="tblQuery" style="width:100%;font-size:12px;">
  132. <tr>
  133. <td><span>小区名称</span></td>
  134. <td>
  135. <input id="communityId">
  136. <input id="no" style="width: 60px;">&nbsp;幢&nbsp;
  137. <input id="houseNumber" style="width: 80px;">&nbsp;室
  138. </td>
  139. <td>承租人身份证号</td>
  140. <td><input id="lesseeId"/></td>
  141. <td align="center">
  142. <a href="javascript:searchFun();" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">查询</a>
  143. <a href="javascript:ClearQuery();" class="easyui-linkbutton" data-options="iconCls:'icon-emptied',plain:true">清空</a>
  144. </td>
  145. </tr>
  146. </table>
  147. <div class="clear"></div>
  148. </div>
  149. <table id="deliveryHouseDataGrid">
  150. <thead frozen="true">
  151. <tr>
  152. <th data-options="field:'id',checkbox:true,width:30">ID</th>
  153. </tr>
  154. </thead>
  155. <thead>
  156. <tr>
  157. <th data-options="field:'securityPersonName',width:80,formatter:securityPersonNameFormatter">申请人</th>
  158. <th data-options="field:'isOtherProtect',width:90,formatter:isOtherProtectFormatter">是否有其他保障</th>
  159. <th data-options="field:'address',width:200,formatter:houseAddressFormatter">房源地址</th>
  160. <th data-options="field:'isExistHouse',width:60,formatter:isExistHouseFormatter">是否现房</th>
  161. <th data-options="field:'delivery',width:60,formatter:deliveryFormatter">交付</th>
  162. </tr>
  163. </thead>
  164. </table>
  165. </div>
  166. </div>
  167. <script type="text/javascript">
  168. $(function(){
  169. parent.$.messager.progress('close');
  170. $('#communityId').combobox({
  171. url: whzl.basePath + '/communityAction_findAll',
  172. valueField:'value',
  173. textField:'text',
  174. filter:function(q,row){
  175. var opts=$(this).combobox("options");
  176. return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
  177. },
  178. onChange:function (newValue,oldValue) {
  179. $('#no').combobox("setValue","");
  180. $('#houseNumber').combobox("setValue","");
  181. $('#no').combobox('reload',whzl.basePath + '/houseAction_findAllNo?house.community.id='+$('#communityId').combobox("getValue"));
  182. }
  183. });
  184. $('#no').combobox({
  185. url: whzl.basePath + '/houseAction_findAllNo?house.community.id='+$('#communityId').combobox("getValue"),
  186. valueField:'value',
  187. textField:'text',
  188. filter:function(q,row){
  189. var opts=$(this).combobox("options");
  190. return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
  191. },
  192. onChange:function (newValue,oldValue) {
  193. $('#houseNumber').combobox("setValue","");
  194. $('#houseNumber').combobox('reload',whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityId').combobox("getValue") + '&house.no='+encodeURIComponent(newValue));
  195. }
  196. });
  197. $('#houseNumber').combobox({
  198. url: whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityId').combobox("getValue") + '&house.no='+$('#no').combobox("getValue"),
  199. valueField:'value',
  200. textField:'text',
  201. filter:function(q,row){
  202. var opts=$(this).combobox("options");
  203. return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
  204. }
  205. });
  206. })
  207. </script>