456 lines
21 KiB
HTML
456 lines
21 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-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">
|
|
<div id="areaParentBox" class="layui-form layui-form-item" style="margin-bottom: 0px; width: 150px;"></div>
|
|
<script id="areaParentTemplate" type="text/html">
|
|
<select id="areaParentId" name="areaParentId" lay-filter="areaParentChange">
|
|
<option value="">街道选择</option>
|
|
{{# for(var i = 0, item; item = d[i++];) { }}
|
|
<option value="{{item.area_id}}">{{item.area_name}}</option>
|
|
{{# } }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<div id="areaBox" class="layui-form layui-form-item" style="margin-bottom: 0px; width: 150px;"></div>
|
|
<script id="areaTemplate" type="text/html">
|
|
<select id="areaId" name="areaId">
|
|
<option value="">社区选择</option>
|
|
{{# for(var i = 0, item; item = d[i++];) { }}
|
|
<option value="{{item.area_id}}">{{item.area_name}}</option>
|
|
{{# } }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<div id="nationBox" class="layui-form layui-form-item" style="margin-bottom: 0px; width: 150px;"></div>
|
|
<script id="nationTemplate" type="text/html">
|
|
<select id="nation" name="nation">
|
|
<option value="">民族筛选</option>
|
|
{{# for(var i = 0, item; item = d[i++];) { }}
|
|
<option value="{{item.nation}}">{{item.nation}}</option>
|
|
{{# } }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<div id="educationBox" class="layui-form layui-form-item" style="margin-bottom: 0px;width: 150px;"></div>
|
|
<script id="educationTemplate" type="text/html">
|
|
<select id="education" name="education">
|
|
<option value="">学历筛选</option>
|
|
{{# for(var i = 0, item; item = d[i++];) { }}
|
|
<option value="{{item.education}}">{{item.education}}</option>
|
|
{{# } }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<div id="politicalStatusBox" class="layui-form layui-form-item" style="margin-bottom: 0px; width: 150px;"></div>
|
|
<script id="politicalStatusTemplate" type="text/html">
|
|
<select id="politicalStatus" name="politicalStatus">
|
|
<option value="">政治面貌筛选</option>
|
|
{{# for(var i = 0, item; item = d[i++];) { }}
|
|
<option value="{{item.politicalStatus}}">{{item.politicalStatus}}</option>
|
|
{{# } }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<div id="religionBox" class="layui-form layui-form-item" style="margin-bottom: 0px; width: 150px;"></div>
|
|
<script id="religionTemplate" type="text/html">
|
|
<select id="religion" name="religion">
|
|
<option value="">宗教信仰筛选</option>
|
|
{{# for(var i = 0, item; item = d[i++];) { }}
|
|
<option value="{{item.religion}}">{{item.religion}}</option>
|
|
{{# } }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<div id="maritalBox" class="layui-form layui-form-item" style="margin-bottom: 0px; width: 150px;"></div>
|
|
<script id="maritalTemplate" type="text/html">
|
|
<select id="maritalStatus" name="maritalStatus">
|
|
<option value="">婚姻状况筛选</option>
|
|
{{# for(var i = 0, item; item = d[i++];) { }}
|
|
<option value="{{item.maritalStatus}}">{{item.maritalStatus}}</option>
|
|
{{# } }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<div class="layui-form layui-form-item" style="margin-bottom: 0px; width: 100px;">
|
|
<select id="gender" name="gender">
|
|
<option value="">性别筛选</option>
|
|
<option value="男">男</option>
|
|
<option value="女">女</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<input type="text" id="keywords" class="layui-input search-item" style="height: 38px;" autocomplete="off" 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>
|
|
layui.config({
|
|
base: 'assets/layuiadmin/'
|
|
}).extend({
|
|
index: 'lib/index'
|
|
}).use(['index', 'table', 'laytpl', 'form', 'upload', 'restajax', 'dialog'], function() {
|
|
var $ = layui.$;
|
|
var $win = $(window);
|
|
var table = layui.table;
|
|
var laytpl = layui.laytpl;
|
|
var form = layui.form;
|
|
var admin = layui.admin;
|
|
var restAjax = layui.restajax;
|
|
var dialog = layui.dialog;
|
|
var resizeTimeout = null;
|
|
var tableUrl = 'app/data-external-release/list-population';
|
|
var otherPeopleType = restAjax.params(window.location.href).otherPeopleType;
|
|
if(typeof (otherPeopleType) === 'undefined' || otherPeopleType == null){
|
|
otherPeopleType = '';
|
|
}
|
|
function init(){
|
|
initTable();
|
|
initAreaParentSelect();
|
|
initAreaSelect();
|
|
initNationSelect();
|
|
initEducationSelect();
|
|
initPoliticalStatusSelect();
|
|
initReligionSelect();
|
|
initMaritalSelect();
|
|
}
|
|
init();
|
|
|
|
// 初始化街道
|
|
function initAreaParentSelect() {
|
|
restAjax.get(restAjax.path('app/sys-basic-info/release/list-area-info', []), {areaParentId : '752234'}, null, function(code, data, args) {
|
|
laytpl(document.getElementById('areaParentTemplate').innerHTML).render(data, function(html) {
|
|
document.getElementById('areaParentBox').innerHTML = html;
|
|
});
|
|
form.render();
|
|
}, function(code, data) {
|
|
dialog.msg(data.msg);
|
|
});
|
|
}
|
|
|
|
form.on('select(areaParentChange)', function(data){
|
|
initAreaSelect(data.value);
|
|
});
|
|
|
|
// 初始化社区
|
|
function initAreaSelect(areaParentId){
|
|
if(typeof (areaParentId) == 'undefined' || areaParentId == ''){
|
|
laytpl(document.getElementById('areaTemplate').innerHTML).render([], function(html) {
|
|
document.getElementById('areaBox').innerHTML = html;
|
|
});
|
|
form.render();
|
|
return;
|
|
}
|
|
restAjax.get(restAjax.path('app/sys-basic-info/release/list-area-info', []), {areaParentId : areaParentId}, null, function(code, data, args) {
|
|
laytpl(document.getElementById('areaTemplate').innerHTML).render(data, function(html) {
|
|
document.getElementById('areaBox').innerHTML = html;
|
|
});
|
|
form.render();
|
|
}, function(code, data) {
|
|
dialog.msg(data.msg);
|
|
});
|
|
}
|
|
|
|
// 初始化民族下拉选择
|
|
function initNationSelect() {
|
|
restAjax.get(restAjax.path('app/sys-basic-info/release/list-population-info-nation', []), {}, null, function(code, data, args) {
|
|
laytpl(document.getElementById('nationTemplate').innerHTML).render(data, function(html) {
|
|
document.getElementById('nationBox').innerHTML = html;
|
|
});
|
|
form.render();
|
|
}, function(code, data) {
|
|
dialog.msg(data.msg);
|
|
});
|
|
}
|
|
|
|
// 初始化学历下拉选择
|
|
function initEducationSelect() {
|
|
restAjax.get(restAjax.path('app/sys-basic-info/release/list-population-info-education', []), {}, null, function(code, data, args) {
|
|
laytpl(document.getElementById('educationTemplate').innerHTML).render(data, function(html) {
|
|
document.getElementById('educationBox').innerHTML = html;
|
|
});
|
|
form.render();
|
|
}, function(code, data) {
|
|
dialog.msg(data.msg);
|
|
});
|
|
}
|
|
|
|
// 初始化政治面貌下拉选择
|
|
function initPoliticalStatusSelect() {
|
|
restAjax.get(restAjax.path('app/sys-basic-info/release/list-population-info-political', []), {}, null, function(code, data, args) {
|
|
laytpl(document.getElementById('politicalStatusTemplate').innerHTML).render(data, function(html) {
|
|
document.getElementById('politicalStatusBox').innerHTML = html;
|
|
});
|
|
form.render();
|
|
}, function(code, data) {
|
|
dialog.msg(data.msg);
|
|
});
|
|
}
|
|
|
|
// 初始化宗教信仰下拉选择
|
|
function initReligionSelect() {
|
|
restAjax.get(restAjax.path('app/sys-basic-info/release/list-population-info-religion', []), {}, null, function(code, data, args) {
|
|
laytpl(document.getElementById('religionTemplate').innerHTML).render(data, function(html) {
|
|
document.getElementById('religionBox').innerHTML = html;
|
|
});
|
|
form.render();
|
|
}, function(code, data) {
|
|
dialog.msg(data.msg);
|
|
});
|
|
}
|
|
|
|
// 初始化婚姻状况下拉选择
|
|
function initMaritalSelect() {
|
|
restAjax.get(restAjax.path('app/sys-basic-info/release/list-population-info-marital', []), {}, null, function(code, data, args) {
|
|
laytpl(document.getElementById('maritalTemplate').innerHTML).render(data, function(html) {
|
|
document.getElementById('maritalBox').innerHTML = html;
|
|
});
|
|
form.render();
|
|
}, function(code, data) {
|
|
dialog.msg(data.msg);
|
|
});
|
|
}
|
|
|
|
// 初始化表格
|
|
function initTable() {
|
|
table.render({
|
|
elem: '#dataTable',
|
|
id: 'dataTable',
|
|
url: restAjax.path(tableUrl, []),
|
|
width: admin.screen() > 1 ? '100%' : '',
|
|
height: $win.height() - 100,
|
|
limit: 20,
|
|
limits: [20, 40, 60, 80, 100, 200],
|
|
toolbar: '#headerToolBar',
|
|
defaultToolbar: [],
|
|
where:{
|
|
otherPeopleType : otherPeopleType,
|
|
},
|
|
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: restAjax.path(tableUrl, []),
|
|
where: {
|
|
otherPeopleType : otherPeopleType,
|
|
keywords: $('#keywords').val(),
|
|
gender : $('#gender').val(),
|
|
nation : $('#nation').val(),
|
|
education : $('#education').val(),
|
|
politicalStatus : $('#politicalStatus').val(),
|
|
religion : $('#religion').val(),
|
|
maritalStatus : $('#maritalStatus').val(),
|
|
areaParentId : $('#areaParentId').val(),
|
|
areaId : $('#areaId').val(),
|
|
},
|
|
page: {
|
|
curr: currentPage
|
|
},
|
|
height: $win.height() - 100,
|
|
});
|
|
}
|
|
|
|
// 事件 - 页面变化
|
|
$win.on('resize', function() {
|
|
clearTimeout(resizeTimeout);
|
|
resizeTimeout = setTimeout(function() {
|
|
reloadTable();
|
|
}, 500);
|
|
});
|
|
|
|
// 事件 - 搜索
|
|
$(document).on('click', '#search', function() {
|
|
reloadTable(1);
|
|
});
|
|
|
|
$(document).on('keydown', function(e){
|
|
if(e.keyCode == 13){
|
|
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: false,
|
|
closeBtn: 0,
|
|
area: ['100%', '100%'],
|
|
shadeClose: true,
|
|
anim: 2,
|
|
content: top.restAjax.path('route/basepopulationinfo/save-basepopulationinfo.html', []),
|
|
end: function() {
|
|
reloadTable();
|
|
}
|
|
});
|
|
} 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();
|
|
}
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |