You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

215 lines
6.2 KiB

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="../../../../component/pear/css/pear.css" />
<style>
.woo-tool-text-delimiter {
width: 1px;
height: 12px;
background: #EEEEEE;
display: inline-block;
margin: 0 6px 0 4px;
}
.woo-theme-color {
color: #2d8cf0 !important;
}
.woo-tool-span {
margin: 0 3px;
position: relative;
top: -1px;
cursor: pointer;
}
.layui-card-body .layui-form {
margin-top: 0 !important;
}
</style>
</head>
<body class="pear-container layui-form">
<div class="layui-card" style="margin-bottom: 10px !important;">
<div class="layui-card-body">
<div class="layui-form-item" style="margin: 10px 0 5px 0 !important;">
<div class="layui-form-item layui-inline">
<label class="layui-form-label" style="width: 45px;">地区</label>
<div class="layui-input-inline" id="areaView"></div>
<script id="areaScript" type="text/html">
<select id="area" name="area" lay-filter="area">
{{# layui.each(d, function(index, item){ }}
<option value="{{item.id}}">{{item.area_name}}</option>
{{# }); }}
</select>
</script>
</div>
</div>
</div>
</div>
<div class="layui-card">
<div class="layui-card-body">
<table id="data-table"></table>
</div>
</div>
<script type="text/html" id="table-toolbar">
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="export">
<i class="layui-icon layui-icon-add-1"></i>
导出全部账号
</button>
</button>
</script>
<script type="text/html" id="table-bar">
<span class="woo-tool-span woo-tool-text-span" lay-event="restPwd"><a
class="woo-theme-color">重置密码</a></span>
</script>
<script src="../../../../component/layui/layui.js"></script>
<script src="../../../../component/pear/pear.js"></script>
<script src="../../../../component/pear/base64.js"></script>
<script>
layui.use(['table', 'form', 'jquery', 'laytpl'], function () {
var table = layui.table;
var form = layui.form;
var $ = layui.jquery;
var laytpl = layui.laytpl;
var loginPersonInfo = getPersonLoginInfo($);
var globalInfo = getGlobalInfo($, Base64.encode("install_area"));
var areaId = globalInfo.data[0].global_value;
//单位类型
$.ajax({
type: "GET",
async: false,
url: "/dsBase/dm/getAreaByParentId?parent_id=" + areaId,
success: function (res) {
var areaTpl = areaScript.innerHTML;
var areaView = document.getElementById('areaView');
laytpl(areaTpl).render(res.data, function (html) {
areaView.innerHTML = html;
form.render();
tableRender();
});
}
});
function tableRender() {
table.render({
elem: '#data-table',
url: '/dsBase/loginPerson/getPrintAreaBureau',
where: {
"area_id": $("#area").val()
},
height: 'full-135',
page: {
limit: 15
, layout: ['count', 'prev', 'page', 'next', 'skip']
, prev: "上一页"
, next: "下一页"
},
cols: [[
{ title: '序号', align: 'center', width: "5%", type: 'numbers' },
{ title: '用户', field: 'person_name', align: 'center', width: "25%" },
{ title: '登录名', field: 'login_name', align: 'center', width: "25%" },
{ title: '初始密码', field: 'original_pwd', align: 'center', width: "25%" },
{ title: '操作', toolbar: '#table-bar', align: 'center', width: "20%" }
]],
skin: 'line',
toolbar: '#table-toolbar',
defaultToolbar: [{
title: '刷新',
layEvent: 'refresh',
icon: 'layui-icon-refresh',
}, 'filter', 'print', 'exports']
});
}
form.on('select(area)', function (data) {
tableRender();
});
table.on('tool(data-table)', function (obj) {
if (obj.event === 'restPwd') {
window.restPwd(obj);
}
});
table.on('toolbar(data-table)', function (obj) {
if (obj.event === 'export') {
window.export();
} else if (obj.event === 'refresh') {
window.refresh();
}
});
window.export = function () {
window.location.href = "/dsBase/loginPerson/getPrintAreaBureauForExcel?area_id=" + $("#area").val();
}
//重置密码
window.restPwd = function (obj) {
layer.confirm('确定要重置密码吗?', {
icon: 3,
title: '提示'
}, function (index) {
layer.close(index);
$.ajax({
type: "POST",
dataType: "json",
url: "/dsBase/loginPerson/ResetPwd",
data: {
person_id: obj.data['person_id']
},
success: function (data) {
if (data.success) {
layer.msg('重置密码成功!', {
icon: 1,
time: 1000
}, function () {
table.reload('data-table');
});
} else {
layer.msg(result.message, {
icon: 2,
time: 1000
});
}
}
});
});
}
window.refresh = function (param) {
table.reload('data-table');
}
function GetQueryString(name, istop) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (typeof (istop) != "undefined") r = top.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
});
</script>
</body>
</html>