rentList6.jsp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  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":"personType" ,"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. $('#houseDataGrid6').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. url:whzl.basePath + '/rent10Action_houseList',
  35. pageNumber:1,
  36. nowrap:true,
  37. loadFilter:function(result){
  38. if(result.success){
  39. return result.obj;
  40. }else{
  41. $.messager.alert("提示",result.message);
  42. return ;
  43. }
  44. },
  45. rowStyler:function(index,row){
  46. if("1" == row.status){
  47. if(typeof(row.endTime) == 'undefined'){
  48. }else{
  49. var day = countDay(row.endTime);
  50. if(day < 0){
  51. if(day > -30){
  52. return 'background-color:#FFFACD;';
  53. }else{
  54. return 'background-color:#98FB98';
  55. }
  56. }else{
  57. return "background-color:#FFC0CB;";
  58. }
  59. }
  60. }
  61. }
  62. });
  63. });
  64. /**计算今天到结束时间的天数*/
  65. var countDay = function(time){
  66. var today = new Date();
  67. var endTime = new Date(time.replace(/\-/g, "/"));
  68. return parseInt(parseInt(today - endTime)/1000/60/60/24);
  69. }
  70. /**查询*/
  71. function searchFun(){
  72. $("#houseDataGrid6").datagrid("load", {
  73. "house.community.id":trim($('#communityId').combobox("getValue")),
  74. "house.no":trim($('#no').combobox("getValue")),
  75. "house.houseNumber":trim($('#houseNumber').combobox("getValue")),
  76. "house.lesseeId":trim($('#lesseeId').val())
  77. });
  78. }
  79. /*清除查询条件**/
  80. function ClearQuery() {
  81. $("#tblQuery").find("input").val("");
  82. $("#tblQuery").find("select").val("-1");
  83. }
  84. /**导入房源*/
  85. function houseImport() {
  86. $('#importHouseDialog').dialog({
  87. buttons : [{
  88. text : '确定',
  89. iconCls : 'icon-ok',
  90. handler : function(){
  91. $("#importHouseDialog").dialog("close");
  92. }
  93. },{
  94. text : '取消',
  95. iconCls : 'icon-cancel',
  96. handler : function(){
  97. $("#importHouseDialog").dialog("close");
  98. }
  99. }]
  100. });
  101. }
  102. //收租
  103. var addRentsFormatter = function(value , row , index){
  104. if(row.lessee!=null&&row.lessee!=""){
  105. if(row.endTime != null && row.endTime !=""){
  106. var day = countDay(row.endTime);
  107. if(day>-30){
  108. return "<img src='<%=basePath%>/js/easyui/themes/itemicon/pay.png' title='收租' onclick=addRents(" + row.id + ") style='cursor:pointer' />"
  109. }else{
  110. return "";
  111. }
  112. }
  113. }else{
  114. return "<img src='<%=basePath%>/js/easyui/themes/itemicon/pay.png' title='收租' onclick=addRents(" + row.id + ") style='cursor:pointer' />"
  115. }
  116. }
  117. //退租
  118. var checkoutFormatter = function(value , row , index){
  119. if(row.status == '1'){
  120. return "<img src='<%=basePath%>/js/easyui/themes/itemicon/export.png' title='收租' onclick=checkout(" + row.id + ") style='cursor:pointer' />"
  121. }
  122. }
  123. function addRents(houseId){
  124. $("#addRentsDialog").dialog({
  125. buttons : [{
  126. text : '确定',
  127. iconCls : 'icon-ok',
  128. handler : function(){
  129. addRents_submit();
  130. }
  131. },{
  132. text : '取消',
  133. iconCls : 'icon-cancel',
  134. handler : function(){
  135. $("#addRentsDialog").dialog("close");
  136. }
  137. }],
  138. onLoad : function(){
  139. addRents_load(houseId);
  140. }
  141. })
  142. }
  143. function checkout(houseId){
  144. $("#checkoutDialog").dialog({
  145. buttons : [{
  146. text : '确定',
  147. iconCls : 'icon-ok',
  148. handler : function(){
  149. checkoutRents_submit();
  150. }
  151. },{
  152. text : '取消',
  153. iconCls : 'icon-cancel',
  154. handler : function(){
  155. $("#checkoutDialog").dialog("close");
  156. }
  157. }],
  158. onLoad : function(){
  159. checkoutRents_load(houseId);
  160. }
  161. })
  162. }
  163. //详情
  164. var detailFormatter = function(value , row , index){
  165. return "<img src='<%=basePath%>/images/details.png' title='详情' onclick=houseDetail(" + row.id + ") style='cursor:pointer' />"
  166. }
  167. function houseDetail(houseId){
  168. $("#houseDetailDialog").dialog({
  169. buttons : [{
  170. text : '确定',
  171. iconCls : 'icon-ok',
  172. handler : function(){
  173. $("#houseDetailDialog").dialog("close");
  174. }
  175. }],
  176. onLoad : function(){
  177. detail_load(houseId);
  178. }
  179. })
  180. }
  181. /**上传文件*/
  182. function formSubmit(){
  183. var upload = $("#upload").val();
  184. if(upload == null || upload == ''){
  185. $.messager.alert("系统提示","请选择文件上传!","error");
  186. }else{
  187. parent.$.messager.progress({
  188. title : '提示',
  189. text : '上传数据中,请稍候....'
  190. });
  191. $('#importHouseForm').form('submit',
  192. {
  193. url : whzl.basePath+"/houseAction_uploadExcel",//要访问的后台地址
  194. success : function(result){
  195. parent.$.messager.progress('close');
  196. result = $.parseJSON(result);
  197. if(result.success){
  198. $("#message").text(result.message);
  199. $("#errorShowList").hide();
  200. $("#exportBtn").hide();
  201. }else{
  202. $("#message").text(result.message + "一共存在" + result.obj.length + "错误。");
  203. $("#errorShowList").show();
  204. $("#exportBtn").show();
  205. var error = "";//全部错误信息
  206. var errorShow = "";//只显示前6条错误信息
  207. for(var i = 0; i < result.obj.length; i++){
  208. error += (i+1) + "、" + result.obj[i] + "\r\n";
  209. if(i < 6){
  210. errorShow += "<p>" + (i+1) + "、" + result.obj[i] + "</p>";
  211. }
  212. }
  213. $("#errorShowList").html(errorShow);
  214. $("#errorList").html(error);
  215. $("#errorText").val(error);
  216. parent.$.messager.progress('close');
  217. }
  218. }
  219. }
  220. );
  221. }
  222. }
  223. //新增
  224. function add(){
  225. $("#addHouseDialog").dialog({
  226. buttons : [{
  227. text : '确定',
  228. iconCls : 'icon-ok',
  229. handler : function(){
  230. addHouse_submit();
  231. }
  232. },{
  233. text : '取消',
  234. iconCls : 'icon-cancel',
  235. handler : function(){
  236. $("#addHouseDialog").dialog("close");
  237. }
  238. }]
  239. })
  240. }
  241. //修改房源信息
  242. var updateFormatter = function(value , row , index){
  243. return "<img src='<%=basePath%>/js/easyui/themes/itemicon/update.png' title='修改' onclick=updateHouse(" + row.id + ") style='cursor:pointer' />"
  244. }
  245. function updateHouse(id){
  246. $("#updateHouseDialog").dialog({
  247. buttons : [{
  248. text : '确定',
  249. iconCls : 'icon-ok',
  250. handler : function(){
  251. updateHouse_submit();
  252. }
  253. },{
  254. text : '取消',
  255. iconCls : 'icon-cancel',
  256. handler : function(){
  257. $("#updateHouseDialog").dialog("close");
  258. }
  259. }],
  260. onLoad : function(){
  261. updateHouse_load(id);
  262. }
  263. })
  264. }
  265. var endTimeFormatter = function(value , row , index){
  266. if(row.lessee == ""||row.lessee==null){
  267. return "";
  268. }else{
  269. return dealDate(value);
  270. }
  271. }
  272. var statsuFormatter = function(value , row , index){
  273. if("1" == value){
  274. console.log(row.endTime);
  275. if(typeof(row.endTime) == 'undefined'){
  276. return "已配租";
  277. }else{
  278. var day = countDay(row.endTime);
  279. if(day < 0){
  280. if(day > -30){
  281. return "即将到期";
  282. }else{
  283. return "已配租";
  284. }
  285. }else{
  286. return "欠费";
  287. }
  288. }
  289. }else if("2" == value){
  290. return "预配租";
  291. }else{
  292. return "未租";
  293. }
  294. }
  295. /**打印租金合同*/
  296. var printRentFormatter = function(value , row , index){
  297. if(row.contractNo!=null&&row.contractNo!=""){
  298. return "<img src='<%=basePath%>/js/easyui/themes/itemicon/print.png' title='打印' onclick=printRent(" + row.id + ") style='cursor:pointer' />"
  299. }else{
  300. return "";
  301. }
  302. }
  303. /**模板选择对话框*/
  304. var printRent = function(id){
  305. $("#templetSelectDialog").dialog(
  306. {
  307. buttons : [
  308. {
  309. text : '关闭',
  310. iconCls : 'icon-ok',
  311. handler : function(){
  312. $("#templetSelectDialog").dialog("close");
  313. }
  314. }
  315. ],
  316. onLoad : function(){
  317. templet_load(id);
  318. }
  319. }
  320. );
  321. };
  322. /**打印租金合同*/
  323. var rentDetailFormatter = function(value , row , index){
  324. return "<img src='<%=basePath%>/js/easyui/themes/itemicon/print.png' title='打印' onclick=rentDetail(" + row.id + ") style='cursor:pointer' />"
  325. }
  326. /**模板选择对话框*/
  327. var rentDetail = function(id){
  328. $("#rentDetailDialog").dialog(
  329. {
  330. buttons : [
  331. {
  332. text : '关闭',
  333. iconCls : 'icon-ok',
  334. handler : function(){
  335. $("#rentDetailDialog").dialog("close");
  336. }
  337. }
  338. ],
  339. onLoad : function(){
  340. rentDetail_load(id);
  341. }
  342. }
  343. );
  344. };
  345. </script>
  346. <div class="easyui-layout" data-options="fit:true,border:false">
  347. <div data-options="region:'center',border:false">
  348. <div id="searchtool" data-options="region:'north',border:false">
  349. <div class="clear"></div>
  350. <table id="tblQuery" style="width:100%;font-size:12px;">
  351. <tr>
  352. <td><span>小区名称</span></td>
  353. <td>
  354. <input id="communityId">
  355. <input id="no" style="width: 60px;">幢
  356. <input id="houseNumber" style="width: 80px;">室
  357. </td>
  358. <td>承租人身份证号</td>
  359. <td><input id="lesseeId"/></td>
  360. <td align="center">
  361. <a href="javascript:searchFun();" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">查询</a>
  362. <a href="javascript:ClearQuery();" class="easyui-linkbutton" data-options="iconCls:'icon-emptied',plain:true">清空</a>
  363. <!-- <a href="javascript:add();" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">增加</a>
  364. <a href="javascript:houseImport();" class="easyui-linkbutton" data-options="iconCls:'icon-import',plain:true">导入</a> -->
  365. </td>
  366. </tr>
  367. </table>
  368. <div class="clear"></div>
  369. </div>
  370. <table id="houseDataGrid6">
  371. <thead frozen="true">
  372. <tr>
  373. <th data-options="field:'id',checkbox:true,width:30">ID</th>
  374. <th data-options="field:'communityName',sortable:true,width:100">小区名称</th>
  375. </tr>
  376. </thead>
  377. <thead>
  378. <tr>
  379. <th data-options="field:'no',width:80">楼号</th>
  380. <th data-options="field:'houseNumber',width:80">房号</th>
  381. <th data-options="field:'area',width:60">面积</th>
  382. <th data-options="field:'garageArea',width:60">车库面积</th>
  383. <th data-options="field:'status',width:70,formatter:statsuFormatter">状态</th>
  384. <th data-options="field:'lessee',width:60">承租人</th>
  385. <th data-options="field:'lesseeId',width:160">承租人身份证号</th>
  386. <th data-options="field:'endTime',width:80,formatter:endTimeFormatter">到期时间</th>
  387. <th data-options="field:'detail',width:60,formatter:detailFormatter">详情</th>
  388. </tr>
  389. </thead>
  390. </table>
  391. </div>
  392. </div>
  393. <div id="houseDetailDialog" data-options="title:'&nbsp;房源详情信息',iconCls:'icon-detail',width:1000,height:500,modal:true,href:'<%=basePath %>/rent10Action_toDetail'">
  394. </div>
  395. <div id="rentDetailDialog" data-options="title:'&nbsp;合同详情信息',iconCls:'icon-detail',width:1000,height:500,modal:true,href:'<%=basePath %>/rent10Action_toRentDetail'">
  396. </div>
  397. <div id="addRentsDialog" data-options="title:'&nbsp;收租信息',iconCls:'icon-add',width:1000,height:500,modal:true,href:'<%=basePath %>/rent10Action_toAddRent1'">
  398. </div>
  399. <div id="checkoutDialog" data-options="title:'&nbsp;退租信息',iconCls:'icon-add',width:1000,height:500,modal:true,href:'<%=basePath %>/rent10Action_toCheckout'">
  400. </div>
  401. <div id="addHouseDialog" data-options="title:'&nbsp;增加房源信息',iconCls:'icon-add',width:500,height:300,modal:true,href:'<%=basePath %>/houseAction_toAddHouse'">
  402. </div>
  403. <div id="updateHouseDialog" data-options="title:'&nbsp;修改房源信息',iconCls:'icon-update',width:500,height:300,modal:true,href:'<%=basePath %>/houseAction_toUpdateHouse'">
  404. </div>
  405. <div id="templetSelectDialog" data-options="title:'&nbsp;选择合同模板',iconCls:'icon-details',width:420,height:320,modal:true,href:'<%=basePath %>/rent10Action_toSelectList'">
  406. </div>
  407. <script type="text/javascript">
  408. $(function(){
  409. parent.$.messager.progress('close');
  410. $('#communityId').combobox({
  411. url: whzl.basePath + '/communityAction_findAll',
  412. valueField:'value',
  413. textField:'text',
  414. filter:function(q,row){
  415. var opts=$(this).combobox("options");
  416. //return row[opts.textField].indexOf(q)==0;//
  417. return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
  418. },
  419. onChange:function (newValue,oldValue) {
  420. $('#no').combobox("setValue","");
  421. $('#houseNumber').combobox("setValue","");
  422. $('#no').combobox('reload',whzl.basePath + '/houseAction_findAllNo?house.community.id='+$('#communityId').combobox("getValue"));
  423. }
  424. });
  425. $('#no').combobox({
  426. //editable:false,
  427. url: whzl.basePath + '/houseAction_findAllNo?house.community.id='+$('#communityId').combobox("getValue"),
  428. valueField:'value',
  429. textField:'text',
  430. filter:function(q,row){
  431. var opts=$(this).combobox("options");
  432. //return row[opts.textField].indexOf(q)==0;//
  433. return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
  434. },
  435. onChange:function (newValue,oldValue) {
  436. $('#houseNumber').combobox("setValue","");
  437. $('#houseNumber').combobox('reload',whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityId').combobox("getValue") + '&house.no='+newValue);
  438. }
  439. });
  440. $('#houseNumber').combobox({
  441. //editable:false,
  442. url: whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityId').combobox("getValue") + '&house.no='+$('#no').combobox("getValue"),
  443. valueField:'value',
  444. textField:'text',
  445. filter:function(q,row){
  446. var opts=$(this).combobox("options");
  447. //return row[opts.textField].indexOf(q)==0;//
  448. return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
  449. }
  450. });
  451. })
  452. </script>