btxtgxq-system-population/target/classes/static/route/buildinghouseuser/list-find-people-show.html
java_cuibaocheng@163.com 19d3a88fa0 基础人口信息
2023-10-25 10:25:13 +08:00

294 lines
12 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<base href="/population/">
<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-anim layui-anim-fadein">
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-body">
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
</div>
</div>
</div>
</div>
</div>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script>
layui.config({
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laytpl', 'form', 'upload'], function() {
var $ = layui.$;
var $win = $(window);
var table = layui.table;
var laytpl = layui.laytpl;
var form = layui.form;
var admin = layui.admin;
var resizeTimeout = null;
var tableUrl = 'api/buildinghouseuser/list-page-house-user';
var buildingHouseId = top.restAjax.params(window.location.href).id;
function init(){
initTable();
}
init();
// 初始化表格
function initTable() {
table.render({
elem: '#dataTable',
id: 'dataTable',
url: top.restAjax.path(tableUrl, []),
width: admin.screen() > 1 ? '100%' : '',
height: $win.height() - 25,
limit: 20,
limits: [20, 40, 60, 80, 100, 200],
defaultToolbar: [],
where:{
buildingHouseId : buildingHouseId,
},
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: 'fullName', width: 120, title: '姓名', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'idCardNumber', width: 180, title: '公民身份证号', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'gender', width: 60, title: '性别', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'telephone', width: 120, title: '联系方式', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'nation', width: 100, title: '民族', align:'left',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'education', width: 120, title: '学历', align:'left',
templet: function(row) {
var rowData = row[this.field];
return rowData;
}
},
{field: 'politicalStatus', width: 120, title: '政治面貌', align:'left',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'maritalStatus', width: 100, title: '婚姻情况', align:'left',
templet: function(row) {
var rowData = row[this.field];
return rowData;
}
},
{field: 'religion', width: 100, title: '宗教信仰', align:'center',
templet: function(row) {
var rowData = row[this.field];
return rowData;
}
},
{field: 'areaNames', width: 180, title: '现住址', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-'
}
return rowData;
}
},
{field: 'currentResidenceAddr', width: 180, title: '详细地址', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-'
}
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: {
buildingHouseId : buildingHouseId
},
page: {
curr: currentPage
},
height: $win.height() - 25,
});
}
// 事件 - 页面变化
$win.on('resize', function() {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function() {
reloadTable();
}, 500);
});
// 事件 - 搜索
$(document).on('click', '#search', function() {
reloadTable(1);
});
// 事件 - 增删改
table.on('toolbar(dataTable)', function(obj) {
var layEvent = obj.event;
var checkStatus = table.checkStatus('dataTable');
var checkDatas = checkStatus.data;
if(layEvent === 'saveEvent') {
layer.open({
type: 2,
title: '添加入住成员',
closeBtn: 0,
area: ['25%', '80%'],
shadeClose: false,
anim: 2,
content: top.restAjax.path('route/buildinghouse/add-user.html', []),
end: function() {
var selectUser = top.dialog.dialogData['selectHouseUser'];
if(typeof (selectUser) != 'undefined' && selectUser != null && selectUser.length > 0){
addHouseUser(selectUser);
}
}
});
} else if(layEvent === 'updateEvent') {
if(checkDatas.length === 0) {
top.dialog.msg(top.dataMessage.table.selectEdit);
} else if(checkDatas.length > 1) {
top.dialog.msg(top.dataMessage.table.selectOneEdit);
} else {
layer.open({
type: 2,
title: false,
closeBtn: 0,
area: ['100%', '100%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/basepopulationinfo/update-basepopulationinfo.html?basePopulationInfoId={basePopulationInfoId}', [checkDatas[0].basePopulationInfoId]),
end: function() {
reloadTable();
}
});
}
} else if(layEvent === 'removeEvent') {
if(checkDatas.length === 0) {
top.dialog.msg(top.dataMessage.table.selectDelete);
} else {
var ids = '';
for(var i = 0, item; item = checkDatas[i++];) {
if(i > 1) {
ids += ',';
}
ids += item['idCardNumber'];
}
removeData(ids);
}
}
});
// 添加入住人员
function addHouseUser(selectUser){
var idCardNumbers = "";
for(var i = 0,item; item = selectUser[i++];){
if(idCardNumbers == ''){
idCardNumbers += item.idCardNumber;
} else {
idCardNumbers += ',' + item.idCardNumber;
}
}
top.restAjax.post(top.restAjax.path('api/buildinghouseuser/save', []), {
buildingHouseId: buildingHouseId, idCardNumber : idCardNumbers
}, null, function(code, data) {
top.dialog.msg("添加完成");
reloadTable();
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
// 删除入住人员
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);
top.restAjax.post(top.restAjax.path('api/buildinghouseuser/remove-house-user', []), {buildingHouseId: buildingHouseId, idCardNumber:ids}, null, function (code, data) {
top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000});
reloadTable();
}, function (code, data) {
top.dialog.msg(data.msg);
});
}
});
}
});
</script>
</body>
</html>