rentList4.jsp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  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. var incomeTypeObj = null;
  8. var incomeType_array = null;
  9. $.ajax({
  10. type: "post",//使用post方法访问后台
  11. dataType: "json",//返回json格式的数据
  12. url: "aa10Action_listAa10All",//要访问的后台地址
  13. data:{"aa10.letter":"incomeType" ,"aa10.name":"家庭收入类型" },
  14. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  15. success: function(msg){//msg为返回的数据,在这里做数据绑定
  16. if(msg.success){
  17. incomeTypeObj = msg.obj.rows;
  18. }
  19. }
  20. });
  21. /**小区显示区*/
  22. $(function() {
  23. $('#rentDataGrid4').datagrid({
  24. rownumbers:true,
  25. fit:true,
  26. pageSize:10,
  27. pageList : [ 10, 20, 30, 40, 50 ],
  28. fitColumns:false,
  29. border:false,
  30. sortOrder:'desc',
  31. pagination:true,
  32. idField:'id',
  33. toolbar:'#searchtool',
  34. pageNumber:1,
  35. nowrap:true,
  36. loadFilter:function(result){
  37. if(result.success){
  38. return result.obj;
  39. }else{
  40. $.messager.alert("提示",result.message);
  41. return ;
  42. }
  43. }
  44. });
  45. });
  46. /**查询*/
  47. function searchFun(){
  48. $("#rentDataGrid4").datagrid("load", {
  49. "rent10.house.community.id":trim($('#communityId').combobox("getValue")),
  50. "rent10.house.no":trim($('#no').combobox("getValue")),
  51. "rent10.house.houseNumber":trim($('#houseNumber').combobox("getValue")),
  52. "rent10.lesseeId":trim($('#lesseeId').val()),
  53. "rent10.lessee":trim($('#lessee').val()),
  54. "createStartDay":trim($('#createStartDay').datebox('getValue')),
  55. "createEndDay":trim($('#createEndDay').datebox('getValue')),
  56. "rent10.startDay":trim($('#startDay').datebox('getValue')),
  57. "rent10.endDay":trim($('#endDay').datebox('getValue')),
  58. "rent10.rentStatus":$('#rentStatus').val()
  59. });
  60. $('#rentDataGrid4').datagrid({url:whzl.basePath + '/rent10Action_rentList'});
  61. }
  62. /*清除查询条件**/
  63. function ClearQuery() {
  64. $("#tblQuery").find("input").val("");
  65. $("#tblQuery").find("select").val("-1");
  66. }
  67. var communityNameFormatter = function(value , row , index){
  68. return row.house.communityName;
  69. }
  70. var noFormatter = function(value , row , index){
  71. return row.house.no;
  72. }
  73. var houseNumberFormatter = function(value , row , index){
  74. return row.house.houseNumber;
  75. }
  76. var dateFormatter = function(value , row , index){
  77. return dealDate(value);
  78. }
  79. //合同当前状态
  80. var rentStatusFormatter = function(value , row , index){
  81. if(value == 1) {
  82. return "正常";
  83. }else if(value == 0) {
  84. return "作废";
  85. }else if(value == 2) {
  86. return "申请作废中";
  87. }
  88. }
  89. /**详情*/
  90. var detailFormatter = function(value , row , index){
  91. return "<img src='<%=basePath%>/images/details.png' title='详情' onclick=rentDetail(" + row.id + ") style='cursor:pointer' />";
  92. }
  93. var rentDetail = function(id){
  94. $("#rentDetailDialog").dialog({
  95. buttons : [{
  96. text : '关闭',
  97. iconCls : 'icon-ok',
  98. handler : function(){
  99. $("#rentDetailDialog").dialog("close");
  100. }
  101. }],
  102. onLoad : function(){
  103. rentDetail_load(id);
  104. }
  105. });
  106. };
  107. /**导出合同*/
  108. function rentExport(){
  109. var params = encodeURI("rent10.house.community.id="+trim($('#communityId').combobox("getValue"))+
  110. "&rent10.house.no="+trim($('#no').combobox("getValue")) +
  111. "&rent10.house.houseNumber="+trim($('#houseNumber').combobox("getValue"))+
  112. "&rent10.lesseeId="+trim($('#lesseeId').val())+
  113. "&rent10.lessee="+trim($('#lessee').val())+
  114. "&rent10.startDay="+$('#startDay').datebox('getValue')+
  115. "&rent10.endDay="+$('#endDay').datebox('getValue')+
  116. "&rent10.rentStatus="+$('#rentStatus').val()+
  117. "&createStartDay="+trim($('#createStartDay').datebox('getValue'))+
  118. "&createEndDay="+trim($('#createEndDay').datebox('getValue'))
  119. );
  120. window.location.href = whzl.basePath+"/rent10Action_export?"+params;
  121. /*$("#exportColumnDialog").dialog({
  122. buttons : [{
  123. text : '确认',
  124. iconCls : 'icon-ok',
  125. handler : function(){
  126. var columnValue = [];
  127. var columnName = [];
  128. $("input[name='columnName']:checked").each(function () {
  129. columnValue.push($(this).val());
  130. columnName.push($(this).attr('valueText'));
  131. });
  132. if(columnValue==""){
  133. $.messager.alert("提示","请选择导出的字段名称!");
  134. return;
  135. }else{
  136. var params = encodeURI("house.community.id="+trim($('#communityId').combobox("getValue"))+
  137. "&rent10.house.no="+trim($('#no').combobox("getValue")) +
  138. "&rent10.house.houseNumber="+trim($('#houseNumber').combobox("getValue"))+
  139. "&createStartDay="+$('#createStartDay').datebox('getValue')+
  140. "&createEndDay="+$('#createEndDay').datebox('getValue')+
  141. "&rent10.rentStatus="+$('#rentStatus').val()+
  142. "&rent10.lesseeId="+trim($('#lesseeId').val())+
  143. "&rent10.lessee="+trim($('#lessee').val())+
  144. "&rent10.startDay="+trim($('#startDay').datebox('getValue'))+
  145. "&rent10.endDay="+trim($('#endDay').datebox('getValue'))
  146. );
  147. window.location.href = whzl.basePath+"/rent10Action_houseAllExport?columnValue="+columnValue+"&columnName="+columnName+"&"+params;
  148. }
  149. }
  150. }]
  151. })*/
  152. }
  153. function onCheckRows(){
  154. var rows = $('#rentDataGrid4').datagrid('getSelections');
  155. var ptotal = 0//计算rentYear的总和
  156. for (var i = 0; i < rows.length; i++) {
  157. ptotal += rows[i]['rentYear'];
  158. }
  159. $('#rentDataGrid4').datagrid('getPager').pagination({
  160. buttons:[{
  161. text:'总租金为:'+ptotal.toFixed(2)
  162. }]
  163. });
  164. }
  165. /**上传附件*/
  166. var uploadFormatter = function(value , row , index){
  167. return "<img src='<%=basePath%>/images/up.png' title='确认退房' onclick=uploadRent10File(" + row.id + ") style='cursor:pointer' />"
  168. }
  169. function uploadRent10File(id){
  170. $("#uploadCheckOutHouseDialog").dialog({
  171. buttons : [{
  172. text : '提交',
  173. iconCls : 'icon-ok',
  174. handler : function(){
  175. uploadRent10File_submit(id);
  176. $("#uploadCheckOutHouseDialog").dialog("close");
  177. }
  178. },{
  179. text : '取消',
  180. iconCls : 'icon-cancel',
  181. handler : function(){
  182. $("#uploadCheckOutHouseDialog").dialog("close");
  183. }
  184. }],
  185. onLoad : function(){
  186. detail_load(id);
  187. }
  188. });
  189. }
  190. function rent10File(){
  191. var ids = [];
  192. var rows = $('#rentDataGrid4').datagrid('getSelections');
  193. if(rows.length>0){
  194. for(var i=0; i<rows.length; i++){
  195. ids.push(rows[i].id);
  196. }
  197. var checkOutHouseIds = ids.join(',');
  198. parent.$.messager.progress({
  199. title : '提示',
  200. text : '正在下载,请稍候....'
  201. });
  202. $.ajax({
  203. type: "post",//使用get方法访问后台
  204. dataType: "json",//返回json格式的数据
  205. url: "rent10Action_rent10FileDownload?ids="+checkOutHouseIds,//要访问的后台地址
  206. success: function(msg){
  207. parent.$.messager.progress('close');
  208. $("#checkOutHouseDataGrid").datagrid("reload");
  209. if(msg.success){
  210. $.messager.alert('成功','下载完成');
  211. }else{
  212. $.messager.alert('失败',msg.message);
  213. }
  214. }
  215. })
  216. }else{
  217. $.messager.alert('提示',"请选择数据");
  218. }
  219. }
  220. function rent10ExcelDownload(){
  221. var ids = [];
  222. var rows = $('#rentDataGrid4').datagrid('getSelections');
  223. if(rows.length>0){
  224. for(var i=0; i<rows.length; i++){
  225. ids.push(rows[i].id);
  226. }
  227. var checkOutHouseIds = ids.join(',');
  228. window.location.href = whzl.basePath+"/rent10Action_rent10ExcelDownload?ids="+checkOutHouseIds
  229. }else{
  230. $.messager.alert('提示',"请选择数据");
  231. }
  232. }
  233. var updateFormatter = function(value , row , index){
  234. return "<img src='<%=basePath%>/images/update.png' title='更新' onclick=updateRent10(" + row.id + ") style='cursor:pointer' />"
  235. }
  236. function updateRent10(id){
  237. $("#updateDialog").dialog({
  238. buttons : [{
  239. text : '提交',
  240. iconCls : 'icon-ok',
  241. handler : function(){
  242. updateRent10_submit(id);
  243. $("#updateDialog").dialog("close");
  244. }
  245. },{
  246. text : '取消',
  247. iconCls : 'icon-cancel',
  248. handler : function(){
  249. $("#updateDialog").dialog("close");
  250. }
  251. }],
  252. onLoad : function(){
  253. detail_load(id);
  254. }
  255. });
  256. }
  257. var incomeTypeFormatter= function(value , row , index){
  258. var incomeType = "";
  259. for(var nItem = 0; nItem < incomeTypeObj.length; nItem++ ){
  260. if(incomeTypeObj[nItem].code == value){
  261. incomeType = incomeTypeObj[nItem].value;
  262. break;
  263. }
  264. }
  265. return incomeType;
  266. }
  267. </script>
  268. <div class="easyui-layout" data-options="fit:true,border:false">
  269. <div data-options="region:'center',border:false">
  270. <div id="searchtool" data-options="region:'north',border:false">
  271. <div class="clear"></div>
  272. <table id="tblQuery" style="width:100%;font-size:12px;">
  273. <tr>
  274. <td align="right">承租人身份证号</td>
  275. <td><input id="lesseeId"/></td>
  276. <td align="right"><span>承租人姓名</span></td>
  277. <td><input id="lessee"/></td>
  278. </tr>
  279. <tr>
  280. <td align="right"><span>小区名称</span></td>
  281. <td>
  282. <input id="communityId">
  283. <input id="no" style="width: 60px;">幢
  284. <input id="houseNumber" style="width: 80px;">室
  285. </td>
  286. <td align="right"><span>合同状态</span></td>
  287. <td>
  288. <select id="rentStatus" style="width: 173px">
  289. <option value="1" selected="selected">正常</option>
  290. <option value="0">已作废</option>
  291. <option value="2">申请作废中</option>
  292. <option value="">全部</option>
  293. </select>
  294. </td>
  295. </tr>
  296. <tr>
  297. <td align="right"><span>交钱时间从</span></td>
  298. <td>
  299. <input class="easyui-datebox" id="createStartDay"/>&nbsp;至&nbsp;
  300. <input class="easyui-datebox" id="createEndDay"/>
  301. </td>
  302. <td align="right"><span>合同时间从</span></td>
  303. <td>
  304. <input class="easyui-datebox" id="startDay"/>&nbsp;至&nbsp;
  305. <input class="easyui-datebox" id="endDay"/>
  306. </td>
  307. <td align="center">
  308. <a href="javascript:searchFun();" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">查询</a>
  309. <a href="javascript:ClearQuery();" class="easyui-linkbutton" data-options="iconCls:'icon-emptied',plain:true">清空</a>
  310. <a href="javascript:rentExport();" class="easyui-linkbutton" data-options="iconCls:'icon-export',plain:true">导出</a>
  311. <a href="javascript:rent10File();" class="easyui-linkbutton" data-options="iconCls:'icon-nextstep',plain:true">附件下载</a>
  312. <a href="javascript:rent10ExcelDownload();" class="easyui-linkbutton" data-options="iconCls:'icon-nextstep',plain:true">下载Excel</a>
  313. </td>
  314. </tr>
  315. </table>
  316. <div class="clear"></div>
  317. </div>
  318. <table id="rentDataGrid4">
  319. <thead frozen="true">
  320. <tr>
  321. <th data-options="field:'id',checkbox:true,width:30">ID</th>
  322. <th data-options="field:'contractNo',align:'center',sortable:true,width:110">合同编号</th>
  323. <th data-options="field:'house.communityName',sortable:true,width:100,formatter:communityNameFormatter">小区名称</th>
  324. </tr>
  325. </thead>
  326. <thead>
  327. <tr>
  328. <th data-options="field:'no',width:80,formatter:noFormatter">楼号</th>
  329. <th data-options="field:'houseNumber',width:80,formatter:houseNumberFormatter">房号</th>
  330. <th data-options="field:'lessee',width:80">承租人</th>
  331. <th data-options="field:'lesseeId',width:150">承租人身份证</th>
  332. <th data-options="field:'startDay',width:80,sortable:true,formatter:dateFormatter">开始时间</th>
  333. <th data-options="field:'endDay',width:80,sortable:true,formatter:dateFormatter">结束时间</th>
  334. <th data-options="field:'createDay',width:80,sortable:true,formatter:dateFormatter">录入时间</th>
  335. <th data-options="field:'rentYear',width:80">年租金</th>
  336. <th data-options="field:'incomeType',width:80,formatter:incomeTypeFormatter">家庭收入情况</th>
  337. <th data-options="field:'rentStatus',width:80,formatter:rentStatusFormatter">当前状态</th>
  338. <th data-options="field:'detail',width:80,formatter:detailFormatter">详情</th>
  339. <th data-options="field:'update',width:80,align:'center',formatter:updateFormatter">更新</th>
  340. <th data-options="field:'upload',width:80,align:'center',formatter:uploadFormatter">上传附件</th>
  341. </tr>
  342. </thead>
  343. </table>
  344. </div>
  345. </div>
  346. <div id="rentDetailDialog" data-options="title:'&nbsp;合同详情信息',iconCls:'icon-detail',width:1000,height:500,modal:true,href:'<%=basePath %>/rent10Action_toRentDetail'">
  347. </div>
  348. <div id="exportColumnDialog" data-options="title:'&nbsp;选择导出字段',iconCls:'icon-details',width:850,height:400,modal:true,href:'<%=basePath %>/rent10Action_toExportColumn2'">
  349. </div>
  350. <div id="uploadCheckOutHouseDialog" data-options="title:'&nbsp;上传附件',iconCls:'icon-detail',width:1000,height:500,modal:true,href:'<%=basePath %>/rent10Action_toUploadCheckOutHouse'">
  351. </div>
  352. <div id="updateDialog" data-options="title:'&nbsp;修改合同信息',iconCls:'icon-detail',width:700,height:300,modal:true,href:'<%=basePath %>/rent10Action_toUpdate'">
  353. </div>
  354. <script type="text/javascript">
  355. $(function(){
  356. parent.$.messager.progress('close');
  357. $('#communityId').combobox({
  358. url: whzl.basePath + '/communityAction_findAll',
  359. valueField:'value',
  360. textField:'text',
  361. filter:function(q,row){
  362. var opts=$(this).combobox("options");
  363. //return row[opts.textField].indexOf(q)==0;//
  364. return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
  365. },
  366. onChange:function (newValue,oldValue) {
  367. $('#no').combobox("setValue","");
  368. $('#houseNumber').combobox("setValue","");
  369. $('#no').combobox('reload',whzl.basePath + '/houseAction_findAllNo?house.community.id='+$('#communityId').combobox("getValue"));
  370. }
  371. });
  372. $('#no').combobox({
  373. //editable:false,
  374. url: whzl.basePath + '/houseAction_findAllNo?house.community.id='+$('#communityId').combobox("getValue"),
  375. valueField:'value',
  376. textField:'text',
  377. filter:function(q,row){
  378. var opts=$(this).combobox("options");
  379. //return row[opts.textField].indexOf(q)==0;//
  380. return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
  381. },
  382. onChange:function (newValue,oldValue) {
  383. $('#houseNumber').combobox("setValue","");
  384. $('#houseNumber').combobox('reload',whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityId').combobox("getValue") + '&house.no='+newValue);
  385. }
  386. });
  387. $('#houseNumber').combobox({
  388. //editable:false,
  389. url: whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityId').combobox("getValue") + '&house.no='+$('#no').combobox("getValue"),
  390. valueField:'value',
  391. textField:'text',
  392. filter:function(q,row){
  393. var opts=$(this).combobox("options");
  394. //return row[opts.textField].indexOf(q)==0;//
  395. return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
  396. }
  397. });
  398. })
  399. </script>