123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477 |
- <%-- 房源状态查询 --%>
- <%@ 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">
- //家庭收入情况
- var incomeTypeObj = null;
- var incomeType_array = null;
-
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "aa10Action_listAa10All",//要访问的后台地址
- data:{"aa10.letter":"personType" ,"aa10.name":"保障人员类别" },
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- incomeTypeObj = msg.obj.rows;
- }
- }
- });
-
- /**小区显示区*/
- $(function() {
- $('#houseDataGrid6').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(){
- $("#houseDataGrid6").datagrid("load", {
- "house.community.id":trim($('#communityId').combobox("getValue")),
- "house.no":trim($('#no').combobox("getValue")),
- "house.houseNumber":trim($('#houseNumber').combobox("getValue")),
- "house.lesseeId":trim($('#lesseeId').val())
- });
- }
-
- /*清除查询条件**/
- function ClearQuery() {
- $("#tblQuery").find("input").val("");
- $("#tblQuery").find("select").val("-1");
- }
-
- /**导入房源*/
- function houseImport() {
- $('#importHouseDialog').dialog({
- buttons : [{
- text : '确定',
- iconCls : 'icon-ok',
- handler : function(){
- $("#importHouseDialog").dialog("close");
- }
- },{
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#importHouseDialog").dialog("close");
- }
- }]
- });
- }
-
- //收租
- var addRentsFormatter = function(value , row , index){
- if(row.lessee!=null&&row.lessee!=""){
- if(row.endTime != null && row.endTime !=""){
- var day = countDay(row.endTime);
- if(day>-30){
- return "<img src='<%=basePath%>/js/easyui/themes/itemicon/pay.png' title='收租' onclick=addRents(" + row.id + ") style='cursor:pointer' />"
- }else{
- return "";
- }
- }
- }else{
- return "<img src='<%=basePath%>/js/easyui/themes/itemicon/pay.png' title='收租' onclick=addRents(" + row.id + ") style='cursor:pointer' />"
- }
- }
-
- //退租
- 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 addRents(houseId){
- $("#addRentsDialog").dialog({
- buttons : [{
- text : '确定',
- iconCls : 'icon-ok',
- handler : function(){
- addRents_submit();
- }
- },{
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#addRentsDialog").dialog("close");
- }
- }],
- onLoad : function(){
- addRents_load(houseId);
- }
- })
- }
-
- 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 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);
- }
- })
- }
-
- /**上传文件*/
- function formSubmit(){
- var upload = $("#upload").val();
- if(upload == null || upload == ''){
- $.messager.alert("系统提示","请选择文件上传!","error");
- }else{
- parent.$.messager.progress({
- title : '提示',
- text : '上传数据中,请稍候....'
- });
- $('#importHouseForm').form('submit',
- {
- url : whzl.basePath+"/houseAction_uploadExcel",//要访问的后台地址
- success : function(result){
- parent.$.messager.progress('close');
- result = $.parseJSON(result);
- if(result.success){
- $("#message").text(result.message);
- $("#errorShowList").hide();
- $("#exportBtn").hide();
- }else{
- $("#message").text(result.message + "一共存在" + result.obj.length + "错误。");
- $("#errorShowList").show();
- $("#exportBtn").show();
-
- var error = "";//全部错误信息
- var errorShow = "";//只显示前6条错误信息
- for(var i = 0; i < result.obj.length; i++){
- error += (i+1) + "、" + result.obj[i] + "\r\n";
- if(i < 6){
- errorShow += "<p>" + (i+1) + "、" + result.obj[i] + "</p>";
- }
- }
- $("#errorShowList").html(errorShow);
- $("#errorList").html(error);
- $("#errorText").val(error);
- parent.$.messager.progress('close');
- }
- }
- }
- );
- }
- }
- //新增
- function add(){
- $("#addHouseDialog").dialog({
- buttons : [{
- text : '确定',
- iconCls : 'icon-ok',
- handler : function(){
- addHouse_submit();
- }
- },{
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#addHouseDialog").dialog("close");
- }
- }]
- })
- }
-
- //修改房源信息
- var updateFormatter = function(value , row , index){
- return "<img src='<%=basePath%>/js/easyui/themes/itemicon/update.png' title='修改' onclick=updateHouse(" + row.id + ") style='cursor:pointer' />"
- }
- function updateHouse(id){
- $("#updateHouseDialog").dialog({
- buttons : [{
- text : '确定',
- iconCls : 'icon-ok',
- handler : function(){
- updateHouse_submit();
- }
- },{
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#updateHouseDialog").dialog("close");
- }
- }],
- onLoad : function(){
- updateHouse_load(id);
- }
- })
- }
-
- 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 printRentFormatter = function(value , row , index){
- if(row.contractNo!=null&&row.contractNo!=""){
- return "<img src='<%=basePath%>/js/easyui/themes/itemicon/print.png' title='打印' onclick=printRent(" + row.id + ") style='cursor:pointer' />"
- }else{
- return "";
- }
- }
-
-
- /**模板选择对话框*/
- var printRent = function(id){
- $("#templetSelectDialog").dialog(
- {
- buttons : [
- {
- text : '关闭',
- iconCls : 'icon-ok',
- handler : function(){
- $("#templetSelectDialog").dialog("close");
- }
- }
- ],
- onLoad : function(){
- templet_load(id);
- }
- }
- );
- };
-
- /**打印租金合同*/
- var rentDetailFormatter = function(value , row , index){
- return "<img src='<%=basePath%>/js/easyui/themes/itemicon/print.png' title='打印' onclick=rentDetail(" + row.id + ") style='cursor:pointer' />"
- }
-
- /**模板选择对话框*/
- var rentDetail = function(id){
- $("#rentDetailDialog").dialog(
- {
- buttons : [
- {
- text : '关闭',
- iconCls : 'icon-ok',
- handler : function(){
- $("#rentDetailDialog").dialog("close");
- }
- }
- ],
- onLoad : function(){
- rentDetail_load(id);
- }
- }
- );
- };
-
- </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:add();" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">增加</a>
- <a href="javascript:houseImport();" class="easyui-linkbutton" data-options="iconCls:'icon-import',plain:true">导入</a> -->
- </td>
- </tr>
- </table>
- <div class="clear"></div>
- </div>
-
- <table id="houseDataGrid6">
- <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>
- </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="rentDetailDialog" data-options="title:' 合同详情信息',iconCls:'icon-detail',width:1000,height:500,modal:true,href:'<%=basePath %>/rent10Action_toRentDetail'">
- </div>
- <div id="addRentsDialog" data-options="title:' 收租信息',iconCls:'icon-add',width:1000,height:500,modal:true,href:'<%=basePath %>/rent10Action_toAddRent1'">
- </div>
- <div id="checkoutDialog" data-options="title:' 退租信息',iconCls:'icon-add',width:1000,height:500,modal:true,href:'<%=basePath %>/rent10Action_toCheckout'">
- </div>
- <div id="addHouseDialog" data-options="title:' 增加房源信息',iconCls:'icon-add',width:500,height:300,modal:true,href:'<%=basePath %>/houseAction_toAddHouse'">
- </div>
- <div id="updateHouseDialog" data-options="title:' 修改房源信息',iconCls:'icon-update',width:500,height:300,modal:true,href:'<%=basePath %>/houseAction_toUpdateHouse'">
- </div>
- <div id="templetSelectDialog" data-options="title:' 选择合同模板',iconCls:'icon-details',width:420,height:320,modal:true,href:'<%=basePath %>/rent10Action_toSelectList'">
- </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>
|