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.
321 lines
9.3 KiB
321 lines
9.3 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;
|
|
}
|
|
</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="xbView"></div>
|
|
<script id="xbScript" type="text/html">
|
|
<select id="xb" lay-filter="xb">
|
|
{{# layui.each(d, function(index, item){ }}
|
|
<option value="{{item.stage_id}}">{{item.stage_name}}</option>
|
|
{{# }); }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
<div class="layui-form-item layui-inline">
|
|
<label class="layui-form-label">入学年份</label>
|
|
<div class="layui-input-inline" id="yearView"></div>
|
|
<script id="yearScript" type="text/html">
|
|
<select id="year" lay-filter="year">
|
|
{{# layui.each(d, function(index, item){ }}
|
|
<option value="{{item.id}}">{{item.name}}</option>
|
|
{{# }); }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
<div class="layui-form-item layui-inline">
|
|
<label class="layui-form-label" style="width: 45px;">班级</label>
|
|
<div class="layui-input-inline" id="classView"></div>
|
|
<script id="classScript" type="text/html">
|
|
<select id="class" lay-filter="class">
|
|
{{# layui.each(d.data, function(index, item){ }}
|
|
<option value="{{item.class_id}}">{{item.class_name}}</option>
|
|
{{# }); }}
|
|
{{# if(d.data.length === 0){ }}
|
|
<option value="-1">暂无班级</option>
|
|
{{# } }}</p>
|
|
</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-download-circle"></i>
|
|
导出全部账号
|
|
</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', 'common', 'dtree', 'laytpl'], function () {
|
|
var table = layui.table;
|
|
var form = layui.form;
|
|
var $ = layui.jquery;
|
|
var common = layui.common;
|
|
var dtree = layui.dtree;
|
|
var laytpl = layui.laytpl;
|
|
|
|
var bureauId = "";
|
|
|
|
var loginPersonInfo = getPersonLoginInfo($);
|
|
if (loginPersonInfo.identity_id == "4") {
|
|
bureauId = loginPersonInfo.bureau_id;
|
|
} else {
|
|
bureauId = GetQueryString('bureau_id');
|
|
}
|
|
|
|
//学部
|
|
$.ajax({
|
|
type: "GET",
|
|
async: false,
|
|
url: "/dsBase/class/getStageList?bureau_id=" + bureauId,
|
|
success: function (res) {
|
|
var xbTpl = xbScript.innerHTML;
|
|
var xbView = document.getElementById('xbView');
|
|
laytpl(xbTpl).render(res.list, function (html) {
|
|
xbView.innerHTML = html;
|
|
});
|
|
form.render();
|
|
getEntryYear();
|
|
tableRender();
|
|
}
|
|
});
|
|
|
|
|
|
//获取入学年份
|
|
function getEntryYear() {
|
|
var id = $("#xb").val();
|
|
var len = "";
|
|
if (id == 4) {
|
|
len = 5;
|
|
} else {
|
|
len = 2;
|
|
}
|
|
var date = new Date();
|
|
var year = date.getFullYear();
|
|
var data = {};
|
|
var lis = [];
|
|
for (var i = len; i >= 0; i--) {
|
|
lis.push({
|
|
id: year - i,
|
|
name: year - i
|
|
});
|
|
}
|
|
lis.push({
|
|
id: year + 1,
|
|
name: year + 1
|
|
});
|
|
|
|
data = {
|
|
data: lis
|
|
}
|
|
|
|
var yearTpl = yearScript.innerHTML;
|
|
var yearView = document.getElementById('yearView');
|
|
laytpl(yearTpl).render(data.data, function (html) {
|
|
yearView.innerHTML = html;
|
|
});
|
|
|
|
form.render();
|
|
|
|
$("#year").val(year);
|
|
|
|
getClass();
|
|
|
|
}
|
|
|
|
//获取班级
|
|
function getClass() {
|
|
//学部
|
|
$.ajax({
|
|
type: "GET",
|
|
async: false,
|
|
url: '/dsBase/class/getClassList?bureau_id=' + bureauId + '&stage_id=' + $("#xb").val() + '&entry_year=' + $("#year").val() + '&page=1&limit=9999',
|
|
success: function (res) {
|
|
if (res.data.length > 0) {
|
|
$('#add').prop('disabled', true);
|
|
} else {
|
|
$('#add').prop('disabled', false);
|
|
}
|
|
var classTpl = classScript.innerHTML;
|
|
var classView = document.getElementById('classView');
|
|
laytpl(classTpl).render(res, function (html) {
|
|
classView.innerHTML = html;
|
|
});
|
|
form.render();
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
form.on('select(xb)', function (data) {
|
|
getEntryYear();
|
|
tableRender();
|
|
});
|
|
|
|
form.on('select(year)', function (data) {
|
|
getClass();
|
|
tableRender();
|
|
});
|
|
|
|
form.on('select(class)', function (data) {
|
|
tableRender();
|
|
});
|
|
|
|
|
|
function tableRender() {
|
|
table.render({
|
|
elem: '#data-table',
|
|
url: '/dsBase/student/getParentListPage',
|
|
where: {
|
|
class_id: $("#class").val()
|
|
},
|
|
height: 'full-150',
|
|
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' },
|
|
{ title: '登录名', field: 'login_name', align: 'center', width: "15%" },
|
|
{ title: '初始密码', field: 'original_pwd', align: 'center', width: "15%" },
|
|
{ title: '操作', toolbar: '#table-bar', align: 'center', width: "25%" }
|
|
]],
|
|
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 = "/dsBase/student/exportParentInfo?class_id=" + $("#class").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> |