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.

154 lines
6.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>学期管理</title>
<meta http-equiv="Content-Type" content="text/html; 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="../../static/css/font.css">
<link rel="stylesheet" href="../../static/css/weadmin.css">
<link rel="stylesheet" href="../../lib/layui/css/layui.css">
<script src="../../lib/jquery-1.12.4.min.js"></script>
<script src="../../lib/ztree/jquery.ztree.core-3.5.min.js"></script>
<!-- 让IE8/9支持媒体查询从而兼容栅格 -->
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
select {
width: 180px;
height: 38px;
line-height: 38px;
border: 1px solid #ccc;
border-radius: 3px;
font-size: 15px;
padding-left: 6px;
color: #666;
}
.inline {
display: inline-block;
vertical-align: top;
}
ul.log li {
color: #666666;
list-style: none;
padding-left: 10px;
}
</style>
</head>
<body>
<div class="weadmin-nav">
<span class="layui-breadcrumb">
<a href="">首页</a>
<a href="">基础信息维护</a>
<a>
<cite>学期管理</cite></a>
</span>
<a class="layui-btn layui-btn-sm" style="line-height:1.6em;margin-top:3px;float:right"
href="javascript:location.reload();" title="刷新">
<i class="layui-icon layui-icon-refresh-3" style="line-height:30px"></i></a>
</div>
<div class="weadmin-body">
<div class="layui-form-item">
<table class="layui-table" lay-filter="idTest" id="idTest"></table>
<script type="text/html" id="barDemo">
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="edit">设为当前学期</a>
<a class="layui-btn layui-btn-xs" lay-event="update">编辑</a>
</script>
</div>
</div>
<script src="../../lib/layui/layui.js"></script>
<script src="../../lib/template.js"></script>
<script src="../../lib/base64.js"></script>
<script>
layui.extend({
admin: '{/}../../static/js/admin'
});
layui.use(['form', 'jquery', 'laytpl', 'admin', 'layer', 'table'], function () {
var form = layui.form,
$ = layui.jquery,
admin = layui.admin,
layer = layui.layer,
table = layui.table,
laytpl = layui.laytpl;
// 绑定学期列表
window.bindTerm = function () {
var type_id = $("#sel3").val();
table.render({
elem: '#idTest',
url: '/baseService/base/getTermList?action_asc=1',
cols: [[
{field: 'xq_id', title: '序号', align: 'center', type: 'numbers', width: 80}
// , {field: 'xq_id', title: '学期ID', align: 'center'}
// , {field: 'xn', title: '学年', align: 'center'}
// , {field: 'xq', title: '学期', align: 'center'}
, {field: 'xqmc', title: '学期名称', align: 'center'}
, {field: 'ksrq', title: '开始日期', align: 'center'}
, {field: 'jsrq', title: '结束日期', align: 'center'}
, {
field: 'is_current', title: '是否当前学期', align: 'center', templet: function (d) {
return d.is_current == 1 ? '是' : '否';
}
}
, {fixed: 'right', title: '操作', toolbar: '#barDemo', align: 'center', width: 200}
]]
, page: false
, height: 'full'
, done: function () {
}
});
};
//绑定场地
bindPersonDepartment();
// 编辑学期
table.on('tool(idTest)', function (obj) {
var data = obj.data;
var xq_id=data.xq_id;
var xqmc = data.xqmc;
// 修改
if (obj.event === 'edit') {
var tip = '您确定要设置' + xqmc + '为当前学期吗?';
layer.confirm(tip, {
btn: ['确定', '取消']
}, function (index, layero) {
$.ajax({
type: "POST",
dataType: "json",
async: false,
data: {
"xq_id": xq_id
},
url: "/baseService/base/saveTermId",
success: function (data) {
layer.msg("保存成功", {icon: 1, time: 1000, shade: [0.5, '#000', true]}, function () {
var index = layer.getFrameIndex(window.name);
layer.close(index);
layui.table.reload('idTest', {
where: {}
, page: {
curr: 1
}
});
});
}
});
}
);
}
if (obj.event === 'update') {
//alert(xq_id);
WeAdminShow("正在为" + xqmc + '修改相关信息', './termListUpdate.html?xq_id=' + xq_id, 550, 450);
}
});
})
</script>
</body>
</html>