parent
a1c399cebd
commit
a21dd867b9
@ -0,0 +1,276 @@
|
||||
<!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-table-view .layui-form-radio>i {
|
||||
margin: 0;
|
||||
font-size: 20px !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="pear-container">
|
||||
<form class="layui-form" action="">
|
||||
<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: 30px;">学部</label>
|
||||
<div class="layui-input-inline" id="xbView" style="width: 135px !important;"></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" style="width: 60px;">入学年份</label>
|
||||
<div class="layui-input-inline" id="yearView" style="width: 135px !important;"></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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<table id="data-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bottom">
|
||||
<div class="button-container">
|
||||
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="save">
|
||||
<i class="layui-icon layui-icon-ok"></i>
|
||||
提交
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<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 id = GetQueryString("id");
|
||||
var bureauId = GetQueryString("bureau_id");
|
||||
var personId = GetQueryString("person_id");
|
||||
|
||||
var classId = "";
|
||||
|
||||
|
||||
//学部
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
async: false,
|
||||
url: "/QingLong/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;
|
||||
});
|
||||
|
||||
$("#year").val(year);
|
||||
|
||||
form.render();
|
||||
}
|
||||
|
||||
|
||||
form.on('select(xb)', function (data) {
|
||||
getEntryYear();
|
||||
tableRender();
|
||||
});
|
||||
|
||||
form.on('select(year)', function (data) {
|
||||
tableRender();
|
||||
});
|
||||
|
||||
|
||||
|
||||
function tableRender() {
|
||||
table.render({
|
||||
elem: '#data-table',
|
||||
id: 'table',
|
||||
url: '/QingLong/class/getClassList',
|
||||
where: {
|
||||
bureau_id: bureauId,
|
||||
stage_id: $("#xb").val(),
|
||||
entry_year: $("#year").val()
|
||||
},
|
||||
height: 'full-190',
|
||||
page: {
|
||||
limit: 15
|
||||
, layout: ['count', 'prev', 'page', 'next', 'skip']
|
||||
, prev: "上一页"
|
||||
, next: "下一页"
|
||||
},
|
||||
cols: [[
|
||||
{ type: 'radio', width: "5%" },
|
||||
// { title: '序号', align: 'center', width: "5%", type: 'numbers' },
|
||||
{ title: '班级名称', field: 'class_name', align: 'center' },
|
||||
{ title: '入学年份', field: 'entry_year', align: 'center', width: "25%" },
|
||||
{ title: '学生总数', field: 'studentcount', align: 'center', width: "25%" }
|
||||
]],
|
||||
skin: 'line',
|
||||
defaultToolbar: [{
|
||||
title: '刷新',
|
||||
layEvent: 'refresh',
|
||||
icon: 'layui-icon-refresh',
|
||||
}, 'filter', 'print', 'exports']
|
||||
});
|
||||
}
|
||||
|
||||
form.on('submit(save)', function (obj) {
|
||||
if (classId === "") {
|
||||
layer.msg("请选择要调转的班级!", {
|
||||
icon: 2,
|
||||
time: 1500
|
||||
});
|
||||
return false;
|
||||
}
|
||||
layer.confirm('确定要调转班级吗?', {
|
||||
icon: 3,
|
||||
title: '提示'
|
||||
}, function (index) {
|
||||
layer.close(index);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
url: "/QingLong/studentYd/checkStudentTransfer",
|
||||
data: {
|
||||
"id": id,
|
||||
"status_id": 2,
|
||||
"class_id": classId,
|
||||
"echo_message": "通过"
|
||||
},
|
||||
success: function (res) {
|
||||
if (res.success) {
|
||||
layer.msg("调转成功!", {
|
||||
icon: 1,
|
||||
time: 1300
|
||||
}, function () {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
//parent.parentClose();
|
||||
|
||||
parent.closeLayer();
|
||||
});
|
||||
} else {
|
||||
layer.msg(res.message, {
|
||||
icon: 2,
|
||||
time: 2000
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
table.on('radio(table)', function (obj) {
|
||||
classId = obj.data["class_id"];
|
||||
});
|
||||
|
||||
|
||||
|
||||
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>
|
Loading…
Reference in new issue