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.

170 lines
4.4 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">
<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>
layui.use(['table', 'form', 'jquery'], function () {
var table = layui.table;
var form = layui.form;
var $ = layui.jquery;
table.render({
elem: '#data-table',
url: '/QingLong/loginPerson/getPrintCityBureau',
height: 'full-45',
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']
});
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 = "/QingLong/loginPerson/getPrintCityBureauForExcel";
}
//重置密码
window.restPwd = function (obj) {
layer.confirm('确定要重置密码吗?', {
icon: 3,
title: '提示'
}, function (index) {
layer.close(index);
$.ajax({
type: "POST",
dataType: "json",
url: "/QingLong/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>