以人找房,以房找人功能新增。

This commit is contained in:
Renpc-kilig 2021-09-07 17:17:28 +08:00
parent 2f934de38b
commit 208749f088
4 changed files with 561 additions and 0 deletions

View File

@ -213,6 +213,8 @@
1
FROM
city_building_house t1
LEFT JOIN city_building_house_user t2 ON t1.building_house_id = t2.building_house_id
AND t2.is_delete = 0
WHERE
t1.is_delete = 0
<if test="keywords != null and keywords != ''">
@ -221,9 +223,13 @@
OR
t1.district_name LIKE CONCAT('%', #{keywords}, '%')
OR
t1.house_number LIKE CONCAT('%', #{keywords}, '%')
OR
t1.owner_name LIKE CONCAT('%', #{keywords}, '%')
OR
t1.owner_card LIKE CONCAT('%', #{keywords}, '%')
OR
t2.card_number LIKE CONCAT('%', #{keywords}, '%')
)
</if>
<if test="cityBuildingId != null and cityBuildingId != ''">

View File

@ -0,0 +1,229 @@
<!doctype html>
<html lang="en">
<head>
<base href="/servicecity/">
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-body">
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
</div>
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
</div>
</div>
</div>
</div>
</div>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
<script>
layui.config({
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laydate', 'common','upload'], function() {
var $ = layui.$;
var $win = $(window);
var table = layui.table;
var admin = layui.admin;
var laydate = layui.laydate;
var laytpl = layui.laytpl;
var common = layui.common;
var resizeTimeout = null;
var tableUrl = 'api/buildinghouse/listpage?keywords={keywords}';
var keywords = top.restAjax.params(window.location.href).keywords;
// 初始化表格
function initTable() {
table.render({
elem: '#dataTable',
id: 'dataTable',
url: top.restAjax.path(tableUrl, [keywords]),
width: admin.screen() > 1 ? '100%' : '',
height: $win.height() - 90,
limit: 20,
limits: [20, 40, 60, 80, 100, 200],
request: {
pageName: 'page',
limitName: 'rows'
},
cols: [
[
{type:'checkbox', fixed: 'left'},
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
{field: 'cityBuildingName', width: 180, title: '楼宇名称', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'houseNumber', width: 180, title: '房屋编号(名称)', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{
field: 'districtName', width: 180, title: '小区名称', align: 'center',
templet: function (row) {
var rowData = row[this.field];
if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'houseStatus', width: 180, title: '房屋状态', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'dataType', width: 180, title: '数据生成方式', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
if('1' == rowData) {
rowData = '自动生成';
}
if('2' == rowData) {
rowData = '手动录入';
}
return rowData;
}
},
{field: 'ownerName', width: 180, title: '房主姓名', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'ownerCard', width: 180, title: '房主身份证号', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'ownerPhone', width: 180, title: '房主联系方式', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'houseStatus', fixed: 'right', width: 150, title: '租房记录', align:'center',
templet: function(row) {
var rowData = '<a class="layui-btn layui-btn-xs" lay-event="rentalHis">租住记录</a>';;
return rowData;
}
}
]
],
page: true,
parseData: function(data) {
return {
'code': 0,
'msg': '',
'count': data.total,
'data': data.rows
};
}
});
}
// 重载表格
function reloadTable(currentPage) {
table.reload('dataTable', {
url: top.restAjax.path(tableUrl, [keywords]),
where: {
keywords: keywords
},
page: {
curr: currentPage
},
height: $win.height() - 90,
});
}
// 初始化日期
function initDate() {
// 日期选择
laydate.render({
elem: '#startTime',
format: 'yyyy-MM-dd'
});
laydate.render({
elem: '#endTime',
format: 'yyyy-MM-dd'
});
}
// 房屋租住记录
function rentalHis(data) {
top.dialog.open({
url: top.restAjax.path('route/buildinghouseuser/list.html?buildingHouseId={buildingHouseId}', [data.buildingHouseId]),
title: "房屋租住记录",
width: '80%',
height: '80%',
onClose: function() {
console.log(keywords)
keywords = keywords;
reloadTable();
}
});
}
initTable();
initDate();
// 事件 - 页面变化
$win.on('resize', function() {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function() {
reloadTable();
}, 500);
});
// 事件 - 搜索
$(document).on('click', '#search', function() {
reloadTable(1);
});
//监听行单击事件
table.on('tool(dataTable)', function(obj){
var data = obj.data;
if('rentalHis' == obj.event) {
rentalHis(data);
}
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,257 @@
<!doctype html>
<html lang="en">
<head>
<base href="/servicecity/">
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-body">
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
<div class="layui-inline">
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入关键字">
</div>
<button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索
</button>
</div>
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
</div>
</div>
</div>
</div>
</div>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
<script>
layui.config({
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laydate', 'common','upload'], function() {
var $ = layui.$;
var $win = $(window);
var table = layui.table;
var admin = layui.admin;
var laydate = layui.laydate;
var laytpl = layui.laytpl;
var common = layui.common;
var resizeTimeout = null;
var tableUrl = 'api/buildinghouse/listpage';
// 初始化表格
function initTable() {
table.render({
elem: '#dataTable',
id: 'dataTable',
url: top.restAjax.path(tableUrl, []),
width: admin.screen() > 1 ? '100%' : '',
height: $win.height() - 90,
limit: 20,
limits: [20, 40, 60, 80, 100, 200],
request: {
pageName: 'page',
limitName: 'rows'
},
cols: [
[
{type:'checkbox', fixed: 'left'},
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
{field: 'cityBuildingName', width: 180, title: '楼宇名称', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'houseNumber', width: 180, title: '房屋编号(名称)', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{
field: 'districtName', width: 180, title: '小区名称', align: 'center',
templet: function (row) {
var rowData = row[this.field];
if (typeof (rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'houseStatus', width: 180, title: '房屋状态', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'dataType', width: 180, title: '数据生成方式', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
if('1' == rowData) {
rowData = '自动生成';
}
if('2' == rowData) {
rowData = '手动录入';
}
return rowData;
}
},
{field: 'ownerName', width: 180, title: '房主姓名', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'ownerCard', width: 180, title: '房主身份证号', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'ownerPhone', width: 180, title: '房主联系方式', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'houseStatus', fixed: 'right', width: 150, title: '租房记录', align:'center',
templet: function(row) {
var rowData = '<a class="layui-btn layui-btn-xs" lay-event="rentalHis">租住记录</a>';;
return rowData;
}
}
]
],
page: true,
parseData: function(data) {
return {
'code': 0,
'msg': '',
'count': data.total,
'data': data.rows
};
}
});
}
// 重载表格
function reloadTable(currentPage) {
table.reload('dataTable', {
url: top.restAjax.path(tableUrl, []),
where: {
keywords: $('#keywords').val(),
startTime: $('#startTime').val(),
endTime: $('#endTime').val()
},
page: {
curr: currentPage
},
height: $win.height() - 90,
});
}
// 初始化日期
function initDate() {
// 日期选择
laydate.render({
elem: '#startTime',
format: 'yyyy-MM-dd'
});
laydate.render({
elem: '#endTime',
format: 'yyyy-MM-dd'
});
}
// 删除
function removeData(ids) {
top.dialog.msg(top.dataMessage.delete, {
time: 0,
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
shade: 0.3,
yes: function (index) {
top.dialog.close(index);
var layIndex;
top.restAjax.delete(top.restAjax.path('api/buildinghouse/remove/{ids}', [ids]), {}, null, function (code, data) {
top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000});
reloadTable();
}, function (code, data) {
top.dialog.msg(data.msg);
}, function () {
layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3});
}, function () {
top.dialog.close(layIndex);
});
}
});
}
// 房屋租住记录
function rentalHis(data) {
top.dialog.open({
url: top.restAjax.path('route/buildinghouseuser/list.html?buildingHouseId={buildingHouseId}', [data.buildingHouseId]),
title: "房屋租住记录",
width: '80%',
height: '80%',
onClose: function() {
reloadTable();
}
});
}
initTable();
initDate();
// 事件 - 页面变化
$win.on('resize', function() {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function() {
reloadTable();
}, 500);
});
// 事件 - 搜索
$(document).on('click', '#search', function() {
reloadTable(1);
});
//监听行单击事件
table.on('tool(dataTable)', function(obj){
var data = obj.data;
if('rentalHis' == obj.event) {
rentalHis(data);
}
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,69 @@
<!doctype html>
<html lang="en">
<head>
<base href="/servicecity/">
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
<style>
*{padding:0;margin:0;}
.container{position: absolute;top:1000%;left:50%;transform: translate(-50%,-50%);}
.title{text-align: center;font-size: 28px;color: #000;margin-bottom: 20px;}
.search{overflow: hidden;white-space: nowrap;text-align: center;min-width:800px;}
.search input{width: 700px;height: 40px;padding: 0 10px;box-sizing: border-box;border: 1px solid #DDD;vertical-align: top;outline: none;font-size: 16px;float: left;}
.search button{border: none;outline: none;cursor: pointer;width: 90px;height: 40px;color: #fff;font-size: 16px;background: #4e6ef2;vertical-align: top;float: left;}
.tip{text-align: center;font-size: 14px;margin-top: 20px;color: #CCC;}
</style>
</head>
<body>
<div id="LAY-app" class="layui-fluid">
<div class="container">
<div class="title">以人找房</div>
<div class="search">
<input type="text" id="kw"/>
<button @click="searchData">搜索</button>
</div>
<div class="tip">请输入居民身份证号查询</div>
</div>
</div>
<script type="text/javascript" src="assets/js/vue.min.js"></script>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script src="assets/js/vendor/safety/jutils.min.js"></script>
<script src="assets/js/vendor/safety/echarts.js"></script>
<script>
layui.config({
base: 'assets/layuiadmin/' //静态资源所在路径
}).extend({
index: 'lib/index' //主入口模块
}).use(['index', 'animate-numbers', 'table'], function() {
var $ = layui.$;
var table = layui.table;
new Vue({
el: '#LAY-app',
data: {},
methods: {
searchData: function() {
var keywords = $('#kw').val();
top.dialog.open({
url: top.restAjax.path('route/buildinghouse/list-check.html?keywords={keywords}', [keywords]),
title: "查看考生信息",
width: '80%',
height: '80%',
onClose: function() {
}
});
}
},
mounted: function() {
}
})
});
</script>
</body>
</html>