checkOutHouseList.jsp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  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. /**小区显示区*/
  7. $(function() {
  8. $('#checkOutHouseDataGrid').datagrid({
  9. rownumbers:true,
  10. fit:true,
  11. pageSize:10,
  12. pageList : [ 10, 20, 30, 40, 50 ],
  13. fitColumns:false,
  14. border:false,
  15. sortOrder:'desc',
  16. pagination:true,
  17. idField:'id',
  18. toolbar:'#searchtool',
  19. url:whzl.basePath + '/rent10Action_checkOutHouseList',
  20. pageNumber:1,
  21. nowrap:true,
  22. loadFilter:function(result){
  23. if(result.success){
  24. return result.obj;
  25. }else{
  26. $.messager.alert("提示",result.message);
  27. return ;
  28. }
  29. }
  30. });
  31. });
  32. /**查询*/
  33. function searchFun(){
  34. $("#checkOutHouseDataGrid").datagrid("load", {
  35. "checkOutHouse.name":trim($('#name').val()),
  36. "checkOutHouse.idCard":trim($('#idCard').val()),
  37. });
  38. }
  39. /*清除查询条件**/
  40. function ClearQuery() {
  41. $("#tblQuery").find("input").val("");
  42. $("#tblQuery").find("select").val("-1");
  43. }
  44. /**详情*/
  45. var detailFormatter = function(value , row , index){
  46. return "<img src='<%=basePath%>/images/details.png' title='详情' onclick=checkOutDetail(" + row.id + ") style='cursor:pointer' />";
  47. }
  48. var checkOutDetail = function(id){
  49. $("#checkOutDetailDialog").dialog(
  50. {
  51. buttons : [
  52. {
  53. text : '关闭',
  54. iconCls : 'icon-ok',
  55. handler : function(){
  56. $("#checkOutDetailDialog").dialog("close");
  57. }
  58. }
  59. ],
  60. onLoad : function(){
  61. detail_load(id);
  62. }
  63. }
  64. );
  65. };
  66. /**打印注销申请书*/
  67. var printFormatter = function(value , row , index){
  68. if(value != undefined && value !=""){
  69. return "<span onclick=cancelApplicationPrint("+row.id+") style='cursor:pointer'>"+value+"</span>";
  70. }else{
  71. return "<img src='<%=basePath%>/images/printer.png' title='打印委托书' onclick=addCheckOutNo(" + row.id + ") style='cursor:pointer' />"
  72. }
  73. }
  74. /**生成注销编号*/
  75. function addCheckOutNo(id){
  76. parent.$.messager.progress({
  77. title : '提示',
  78. text : '数据处理中,请稍候....'
  79. });
  80. $.ajax({
  81. type: "post",//使用get方法访问后台
  82. dataType: "json",//返回json格式的数据
  83. url: "rent10Action_addCheckOutNo",//要访问的后台地址
  84. data: "checkOutHouse.id="+id,//要发送的数据
  85. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  86. success: function(msg){
  87. parent.$.messager.progress('close');
  88. if(msg.success){
  89. $.messager.alert("提醒","已生成注销编号 ");
  90. $("#checkOutHouseDataGrid").datagrid("reload");
  91. }
  92. }
  93. })
  94. }
  95. function cancelApplicationPrint(id){
  96. window.open(whzl.basePath+"/rent10Action_toCancelApplication?checkOut.id="+id);
  97. }
  98. /**上传附件*/
  99. uploadFormatter = function(value , row , index){
  100. return "<img src='<%=basePath%>/images/up.png' title='确认退房' onclick=uploadCheckOutHouse(" + row.id + ") style='cursor:pointer' />"
  101. }
  102. function uploadCheckOutHouse(id){
  103. $("#uploadCheckOutHouseDialog").dialog({
  104. buttons : [{
  105. text : '提交',
  106. iconCls : 'icon-ok',
  107. handler : function(){
  108. uploadCheckOutHouse_submit(id);
  109. $("#uploadCheckOutHouseDialog").dialog("close");
  110. }
  111. },{
  112. text : '取消',
  113. iconCls : 'icon-cancel',
  114. handler : function(){
  115. $("#uploadCheckOutHouseDialog").dialog("close");
  116. }
  117. }],
  118. onLoad : function(){
  119. detail_load(id);
  120. }
  121. });
  122. }
  123. /**确认退房*/
  124. var checkOutFormatter = function(value , row , index){
  125. if(row.state =="3"||row.state =="1"){
  126. return "";
  127. }else{
  128. return "<img src='<%=basePath%>/images/error.png' title='确认退房' onclick=checkOutHouse(" + row.id + ") style='cursor:pointer' />"
  129. }
  130. }
  131. function checkOutHouse(id){
  132. $.messager.confirm('提示','确定退房吗?',function(r){
  133. if(r){
  134. $.ajax({
  135. type: "post",//使用get方法访问后台
  136. dataType: "json",//返回json格式的数据
  137. url: "rent10Action_checkOutHouse",//要访问的后台地址
  138. data: "checkOutHouse.id="+id,//要发送的数据
  139. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  140. success: function(msg){
  141. parent.$.messager.progress('close');
  142. if(msg.success){
  143. $("#checkOutHouseDataGrid").datagrid("reload");
  144. }
  145. }
  146. })
  147. }
  148.      });
  149. }
  150. var rentTransferSubsidyFormatter = function(value , row , index){
  151. if(row.state =="3"||row.state =="1"){
  152. return "";
  153. }else{
  154. return "<img src='<%=basePath%>/js/easyui/themes/itemicon/update.png' title='公转补' onclick=rentTransferSubsidy(" + row.id + ") style='cursor:pointer' />"
  155. }
  156. }
  157. function rentTransferSubsidy(id){
  158. $.ajax({
  159. type: "post",//使用post方法访问后台
  160. dataType: "json",//返回json格式的数据
  161. url: "rent10Action_rentTransferSubsidy",//要访问的后台地址
  162. data:{"checkOutHouse.id":id},
  163. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  164. success: function(msg){//msg为返回的数据,在这里做数据绑定
  165. if(msg.success){
  166. $("#checkOutHouseDataGrid").datagrid("reload");
  167. }
  168. }
  169. });
  170. }
  171. /**导出退房信息*/
  172. function checkOutExport(){
  173. window.location.href = whzl.basePath+"/rent10Action_checkOutExport";
  174. }
  175. function checkOutPDF(){
  176. var ids = [];
  177. var rows = $('#checkOutHouseDataGrid').datagrid('getSelections');
  178. if(rows.length>0){
  179. for(var i=0; i<rows.length; i++){
  180. ids.push(rows[i].id);
  181. }
  182. var checkOutHouseIds = ids.join(',');
  183. parent.$.messager.progress({
  184. title : '提示',
  185. text : '正在生成审批表,请稍候....'
  186. });
  187. $.ajax({
  188. type: "post",//使用get方法访问后台
  189. dataType: "json",//返回json格式的数据
  190. url: "rent10Action_addCheckOutHousePDF?ids="+checkOutHouseIds,//要访问的后台地址
  191. success: function(msg){
  192. parent.$.messager.progress('close');
  193. $("#checkOutHouseDataGrid").datagrid("reload");
  194. if(msg.success){
  195. $.messager.alert('成功','审批表完成');
  196. }else{
  197. $.messager.alert('失败',msg.message);
  198. }
  199. }
  200. })
  201. }else{
  202. $.messager.alert('提示',"请选择数据");
  203. }
  204. }
  205. function checkOutHouseFile(){
  206. var ids = [];
  207. var rows = $('#checkOutHouseDataGrid').datagrid('getSelections');
  208. if(rows.length>0){
  209. for(var i=0; i<rows.length; i++){
  210. ids.push(rows[i].id);
  211. }
  212. var checkOutHouseIds = ids.join(',');
  213. parent.$.messager.progress({
  214. title : '提示',
  215. text : '正在下载,请稍候....'
  216. });
  217. $.ajax({
  218. type: "post",//使用get方法访问后台
  219. dataType: "json",//返回json格式的数据
  220. url: "rent10Action_checkOutHouseFileDownload?ids="+checkOutHouseIds,//要访问的后台地址
  221. success: function(msg){
  222. parent.$.messager.progress('close');
  223. $("#checkOutHouseDataGrid").datagrid("reload");
  224. if(msg.success){
  225. $.messager.alert('成功','下载完成');
  226. }else{
  227. $.messager.alert('失败',msg.message);
  228. }
  229. }
  230. })
  231. }else{
  232. $.messager.alert('提示',"请选择数据");
  233. }
  234. }
  235. function checkOutHouseExcelDownload(){
  236. var ids = [];
  237. var rows = $('#checkOutHouseDataGrid').datagrid('getSelections');
  238. if(rows.length>0){
  239. for(var i=0; i<rows.length; i++){
  240. ids.push(rows[i].id);
  241. }
  242. var checkOutHouseIds = ids.join(',');
  243. window.location.href = whzl.basePath+"/rent10Action_checkOutHouseExcelDownload?ids="+checkOutHouseIds
  244. }else{
  245. $.messager.alert('提示',"请选择数据");
  246. }
  247. }
  248. </script>
  249. <div class="easyui-layout" data-options="fit:true,border:false">
  250. <div data-options="region:'center',border:false">
  251. <div id="searchtool" data-options="region:'north',border:false">
  252. <div class="clear"></div>
  253. <table id="tblQuery" style="width:100%;font-size:12px;">
  254. <tr>
  255. <td align="right">承租人姓名</td>
  256. <td><input id="name"/></td>
  257. <td align="right"><span>承租人身份证号</span></td>
  258. <td><input id="idCard"/></td>
  259. <td align="center">
  260. <a href="javascript:searchFun();" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">查询</a>
  261. <a href="javascript:ClearQuery();" class="easyui-linkbutton" data-options="iconCls:'icon-emptied',plain:true">清空</a>
  262. <a href="javascript:checkOutExport();" class="easyui-linkbutton" data-options="iconCls:'icon-import',plain:true">导出</a>
  263. <a href="javascript:checkOutPDF();" class="easyui-linkbutton" data-options="iconCls:'icon-nextstep',plain:true">生成审批表</a>
  264. <a href="javascript:checkOutHouseFile();" class="easyui-linkbutton" data-options="iconCls:'icon-nextstep',plain:true">附件下载</a>
  265. <a href="javascript:checkOutHouseExcelDownload();" class="easyui-linkbutton" data-options="iconCls:'icon-nextstep',plain:true">下载Excel</a>
  266. </td>
  267. </tr>
  268. </table>
  269. <div class="clear"></div>
  270. </div>
  271. <table id="checkOutHouseDataGrid">
  272. <thead frozen="true">
  273. <tr>
  274. <th data-options="field:'id',checkbox:true,width:30">ID</th>
  275. <th data-options="field:'address',align:'center',sortable:true,width:210">房源地址</th>
  276. </tr>
  277. </thead>
  278. <thead>
  279. <tr>
  280. <th data-options="field:'name',sortable:true,width:100">申请人</th>
  281. <th data-options="field:'idCard',width:150">身份证号</th>
  282. <th data-options="field:'detail',width:80,align:'center',formatter:detailFormatter">详情</th>
  283. <th data-options="field:'checkOutNo',width:150,align:'center',formatter:printFormatter">打印注销申请书</th>
  284. <th data-options="field:'upload',width:150,align:'center',formatter:uploadFormatter">上传附件</th>
  285. <th data-options="field:'checkOut',width:80,align:'center',formatter:checkOutFormatter">确认退房</th>
  286. <th data-options="field:'rentTransferSubsidy',align:'center',width:60,formatter:rentTransferSubsidyFormatter">公转补</th>
  287. </tr>
  288. </thead>
  289. </table>
  290. </div>
  291. </div>
  292. <div id="checkOutDetailDialog" data-options="title:'&nbsp;退房注销详情',iconCls:'icon-detail',width:1000,height:500,modal:true,href:'<%=basePath %>/rent10Action_toCheckOutHouseDetail'">
  293. </div>
  294. <div id="uploadCheckOutHouseDialog" data-options="title:'&nbsp;上传附件',iconCls:'icon-detail',width:1000,height:500,modal:true,href:'<%=basePath %>/rent10Action_toUploadCheckOutHouse'">
  295. </div>
  296. <script type="text/javascript">
  297. $(function(){
  298. parent.$.messager.progress('close');
  299. })
  300. </script>