123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269 |
- <%-- 退房 --%>
- <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
- <jsp:include page="../../common/include.jsp" />
- <% String basePath = request.getScheme()+ "://" + request.getServerName() + ":" +request.getServerPort() + request.getContextPath(); %>
- <script type="text/javascript">
- /**小区显示区*/
- $(function() {
- $('#rentDataGrid7').datagrid({
- rownumbers:true,
- fit:true,
- pageSize:10,
- pageList : [ 10, 20, 30, 40, 50 ],
- fitColumns:false,
- border:false,
- sortOrder:'desc',
- pagination:true,
- idField:'id',
- toolbar:'#searchtool',
- url:whzl.basePath + '/rent10Action_houseList',
- pageNumber:1,
- nowrap:true,
- loadFilter:function(result){
- if(result.success){
- return result.obj;
- }else{
- $.messager.alert("提示",result.message);
- return ;
- }
- },
- rowStyler:function(index,row){
- if("1" == row.status){
- if(typeof(row.endTime) == 'undefined'){
-
- }else{
- var day = countDay(row.endTime);
- if(day < 0){
- if(day > -30){
- return 'background-color:#FFFACD;';
- }else{
- return 'background-color:#98FB98';
- }
- }else{
- return "background-color:#FFC0CB;";
- }
- }
- }
- }
- });
- });
-
- /**计算今天到结束时间的天数*/
- var countDay = function(time){
- var today = new Date();
- var endTime = new Date(time.replace(/\-/g, "/"));
- return parseInt(parseInt(today - endTime)/1000/60/60/24);
- }
-
- /**查询*/
- function searchFun(){
- $("#rentDataGrid7").datagrid("load", {
- "rent10.house.community.id":trim($('#communityId').combobox("getValue")),
- "rent10.house.no":trim($('#no').combobox("getValue")),
- "rent10.house.houseNumber":trim($('#houseNumber').combobox("getValue")),
- "rent10.lesseeId":trim($('#lesseeId').val())
- });
- }
-
- /*清除查询条件**/
- function ClearQuery() {
- $("#tblQuery").find("input").val("");
- $("#tblQuery").find("select").val("-1");
- }
-
- var endTimeFormatter = function(value , row , index){
- if(row.lessee == ""||row.lessee==null){
- return "";
- }else{
- return dealDate(value);
- }
- }
-
- var statsuFormatter = function(value , row , index){
- if("1" == value){
- console.log(row.endTime);
- if(typeof(row.endTime) == 'undefined'){
- return "已配租";
- }else{
- var day = countDay(row.endTime);
- if(day < 0){
- if(day > -30){
- return "即将到期";
- }else{
- return "已配租";
- }
- }else{
- return "欠费";
- }
- }
- }else if("2" == value){
- return "预配租";
- }else{
- return "未租";
- }
- }
-
- //详情
- var detailFormatter = function(value , row , index){
- return "<img src='<%=basePath%>/images/details.png' title='详情' onclick=houseDetail(" + row.id + ") style='cursor:pointer' />"
- }
-
- function houseDetail(houseId){
- $("#houseDetailDialog").dialog({
- buttons : [{
- text : '确定',
- iconCls : 'icon-ok',
- handler : function(){
- $("#houseDetailDialog").dialog("close");
- }
- }],
- onLoad : function(){
- detail_load(houseId);
- }
- })
- }
-
- //退房
- var checkoutFormatter = function(value , row , index){
- if(row.status == '1'){
- return "<img src='<%=basePath%>/js/easyui/themes/itemicon/export.png' title='退租' onclick=checkout(" + row.id + ") style='cursor:pointer' />"
- }
- }
- function checkout(houseId){
- $("#checkoutDialog").dialog({
- buttons : [{
- text : '确定',
- iconCls : 'icon-ok',
- handler : function(){
- checkoutRents_submit();
- }
- },{
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#checkoutDialog").dialog("close");
- }
- }],
- onLoad : function(){
- checkoutRents_load(houseId);
- }
- })
- }
-
- var applicationFormFormatter = function(value , row , index){
- if(row.status == '1'){
- return "<img src='<%=basePath%>/js/easyui/themes/itemicon/print.png' title='打印' onclick=printApplicationForm(" + row.id + ") style='cursor:pointer' />"
- }
- }
- function printApplicationForm(houseId){
- window.open(whzl.basePath+"/rent10Action_toApplicationFrom?house.id="+houseId);
- }
-
- /**导出合同*/
- function checkOutExport(){
- window.location.href = whzl.basePath+"/rent10Action_checkOutExport";
- }
-
-
- </script>
- <div class="easyui-layout" data-options="fit:true,border:false">
- <div data-options="region:'center',border:false">
- <div id="searchtool" data-options="region:'north',border:false">
- <div class="clear"></div>
- <table id="tblQuery" style="width:100%;font-size:12px;">
- <tr>
- <td><span>小区名称</span></td>
- <td>
- <input id="communityId">
- <input id="no" style="width: 60px;">幢
- <input id="houseNumber" style="width: 80px;">室
- </td>
- <td>承租人身份证号</td>
- <td><input id="lesseeId"/></td>
- <td align="center">
- <a href="javascript:searchFun();" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">查询</a>
- <a href="javascript:ClearQuery();" class="easyui-linkbutton" data-options="iconCls:'icon-emptied',plain:true">清空</a>
- <a href="javascript:checkOutExport();" class="easyui-linkbutton" data-options="iconCls:'icon-import',plain:true">导出</a>
- </td>
- </tr>
- </table>
- <div class="clear"></div>
- </div>
-
- <table id="rentDataGrid7">
- <thead frozen="true">
- <thead frozen="true">
- <tr>
- <th data-options="field:'id',checkbox:true,width:30">ID</th>
- <th data-options="field:'communityName',sortable:true,width:100">小区名称</th>
- </tr>
- </thead>
- <thead>
- <tr>
- <th data-options="field:'no',width:80">楼号</th>
- <th data-options="field:'houseNumber',width:80">房号</th>
- <th data-options="field:'area',width:60">面积</th>
- <th data-options="field:'garageArea',width:60">车库面积</th>
- <th data-options="field:'status',width:70,formatter:statsuFormatter">状态</th>
- <th data-options="field:'lessee',width:60">承租人</th>
- <th data-options="field:'lesseeId',width:160">承租人身份证号</th>
- <th data-options="field:'endTime',width:80,formatter:endTimeFormatter">到期时间</th>
- <th data-options="field:'detail',width:60,formatter:detailFormatter">详情</th>
- <th data-options="field:'applicationForm',align:'center',width:60,formatter:applicationFormFormatter">申请表</th>
- <th data-options="field:'checkout',align:'center',width:60,formatter:checkoutFormatter">退房</th>
- </tr>
- </thead>
- </table>
- </div>
- </div>
- <div id="houseDetailDialog" data-options="title:' 房源详情信息',iconCls:'icon-detail',width:1000,height:500,modal:true,href:'<%=basePath %>/rent10Action_toDetail'">
- </div>
- <div id="checkoutDialog" data-options="title:' 退租信息',iconCls:'icon-add',width:1000,height:500,modal:true,href:'<%=basePath %>/rent10Action_toCheckout'">
- </div>
- <script type="text/javascript">
- $(function(){
- parent.$.messager.progress('close');
- $('#communityId').combobox({
- url: whzl.basePath + '/communityAction_findAll',
- valueField:'value',
- textField:'text',
- filter:function(q,row){
- var opts=$(this).combobox("options");
- //return row[opts.textField].indexOf(q)==0;//
- return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
- },
- onChange:function (newValue,oldValue) {
- $('#no').combobox("setValue","");
- $('#houseNumber').combobox("setValue","");
- $('#no').combobox('reload',whzl.basePath + '/houseAction_findAllNo?house.community.id='+$('#communityId').combobox("getValue"));
- }
- });
- $('#no').combobox({
- //editable:false,
- url: whzl.basePath + '/houseAction_findAllNo?house.community.id='+$('#communityId').combobox("getValue"),
- valueField:'value',
- textField:'text',
- filter:function(q,row){
- var opts=$(this).combobox("options");
- //return row[opts.textField].indexOf(q)==0;//
- return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
- },
- onChange:function (newValue,oldValue) {
- $('#houseNumber').combobox("setValue","");
- $('#houseNumber').combobox('reload',whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityId').combobox("getValue") + '&house.no='+newValue);
- }
- });
- $('#houseNumber').combobox({
- //editable:false,
- url: whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityId').combobox("getValue") + '&house.no='+$('#no').combobox("getValue"),
- valueField:'value',
- textField:'text',
- filter:function(q,row){
- var opts=$(this).combobox("options");
- //return row[opts.textField].indexOf(q)==0;//
- return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
- }
- });
- })
- </script>
|