|
|
<!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 inline " id="div3">
|
|
|
<label for="" class="layui-form-label" style="padding:9px 0;text-align: left;">
|
|
|
授课单位
|
|
|
</label>
|
|
|
<div class="layui-input-inline" id="select_3" style="width: 188px"></div>
|
|
|
<script type="text/html" id="test3">
|
|
|
<select name="service_type" id="sel3" onchange="changeUnit()">
|
|
|
<option value="0">全部</option>
|
|
|
<% for (var i = 0; i < data.length; i ++) { %>
|
|
|
<option value="<%=data[i].unit_id%>"><%=data[i].unit_name%></option>
|
|
|
<% } %>
|
|
|
</select>
|
|
|
</script>
|
|
|
</div>
|
|
|
<div class="layui-form-item inline" id="div4">
|
|
|
<label for="" class="layui-form-label" style="padding:9px 0;text-align: left;width:120px">
|
|
|
课程类型
|
|
|
</label>
|
|
|
<div class="layui-input-inline" id="select_4" style="width: 188px"></div>
|
|
|
<script type="text/html" id="test4">
|
|
|
<select name="service_type" id="sel4" onchange="changeCourseType()">
|
|
|
<option value="0">全部</option>
|
|
|
<% for (var i = 0; i < data.length; i ++) { %>
|
|
|
<option value="<%=data[i].course_type_id%>"><%=data[i].course_type_name%></option>
|
|
|
<% } %>
|
|
|
</select>
|
|
|
</script>
|
|
|
</div>
|
|
|
<div class="layui-form-item inline" style="float:right">
|
|
|
<span id="importAcc">
|
|
|
<div class="layui-btn" type="button" id="addCourse" onclick="addCourse();">
|
|
|
<span class="layui-icon layui-icon-shrink-right"></span>增加课程
|
|
|
</div>
|
|
|
|
|
|
<div class="layui-btn layui-btn-normal" type="button" id="addBatchCourse"
|
|
|
onclick="addBatchCourse();">
|
|
|
<span class="layui-icon layui-icon-shrink-right"></span>批量增加课程
|
|
|
</div>
|
|
|
|
|
|
<div class="layui-btn layui-btn-primary" type="button" id="exportCourse"
|
|
|
onclick="exportCourse();">
|
|
|
<span class="layui-icon layui-icon-shrink-right"></span>课程导出
|
|
|
</div>
|
|
|
</span>
|
|
|
</div>
|
|
|
<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" lay-event="update">修改</a>
|
|
|
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="delete">删除</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.getUnit = function () {
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
dataType: "json",
|
|
|
url: "/baseService/teachbase/getUnitList?page=1&limit=100",
|
|
|
success: function (data) {
|
|
|
var html = template.render('test3', data);
|
|
|
document.getElementById('select_3').innerHTML = html;
|
|
|
}
|
|
|
})
|
|
|
};
|
|
|
getUnit();
|
|
|
|
|
|
//绑定课程类型
|
|
|
window.getCourseType = function () {
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
dataType: "json",
|
|
|
url: "/baseService/teachbase/getCourseType?page=1&limit=100",
|
|
|
success: function (data) {
|
|
|
var html = template.render('test4', data);
|
|
|
document.getElementById('select_4').innerHTML = html;
|
|
|
}
|
|
|
})
|
|
|
};
|
|
|
getCourseType();
|
|
|
//授课单位变更
|
|
|
window.changeUnit = function () {
|
|
|
bindCourse();
|
|
|
};
|
|
|
//课程类型变更
|
|
|
window.changeCourseType = function () {
|
|
|
bindCourse();
|
|
|
};
|
|
|
//增加课程
|
|
|
window.addCourse = function () {
|
|
|
WeAdminShow('增加课程', './courseUpdate.html', 430, 720);
|
|
|
};
|
|
|
//批量增加课程
|
|
|
window.addBatchCourse = function () {
|
|
|
WeAdminShow('批量增加课程', './courseBatch.html', 460, 460);
|
|
|
};
|
|
|
//课程导出
|
|
|
window.exportCourse=function()
|
|
|
{
|
|
|
window.location.href = "/baseService/teachbase/exportCourse";
|
|
|
};
|
|
|
// 绑定课程
|
|
|
window.bindCourse = function () {
|
|
|
var unit_id = $("#sel3").val();
|
|
|
var course_type_id = $("#sel4").val();
|
|
|
table.render({
|
|
|
elem: '#idTest',
|
|
|
url: '/baseService/teachbase/getCourseList?unit_id=' + unit_id + "&course_type_id=" + course_type_id,
|
|
|
cols: [[
|
|
|
{field: 'id', title: '序号', align: 'center', type: 'numbers', width: 40}
|
|
|
, {field: 'course_name', title: '课程名称', align: 'center', width: 140}
|
|
|
, {field: 'course_code', title: '课程代码', align: 'center'}
|
|
|
, {field: 'unit_name', title: '授课单位', align: 'center'}
|
|
|
, {field: 'is_netcourse_name', title: '网络课程', align: 'center'}
|
|
|
, {field: 'course_type_name', title: '课程类型', align: 'center'}
|
|
|
, {field: 'credit_hours', title: '默认学时', align: 'center'}
|
|
|
, {field: 'credit_points', title: '默认学分', align: 'center'}
|
|
|
, {field: 'theory', title: '默认理论课时数', align: 'center'}
|
|
|
, {field: 'practice', title: '默认实践课时数', align: 'center'}
|
|
|
, {
|
|
|
field: 'exam_mode_id', title: '默认考试方式', align: 'center',
|
|
|
templet: function (d) {
|
|
|
if (d.exam_mode_id === '1') {
|
|
|
return '考试'
|
|
|
} else {
|
|
|
return '考查'
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
, {field: 'sort_id', title: '排序号', align: 'center', width: 120}
|
|
|
, {fixed: 'right', title: '操作', toolbar: '#barDemo', align: 'center', width: 120}
|
|
|
]]
|
|
|
, page: true
|
|
|
, height: 'full'
|
|
|
, done: function () {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
//绑定课程
|
|
|
bindCourse();
|
|
|
|
|
|
//编辑与删除
|
|
|
table.on('tool(idTest)', function (obj) {
|
|
|
var data = obj.data;
|
|
|
if (obj.event === 'update') {
|
|
|
var course_id = data.course_id;
|
|
|
var course_name = data.course_name;
|
|
|
WeAdminShow("正在为" + course_name + '修改相关信息', './courseUpdate.html?course_id=' + course_id, 430, 720);
|
|
|
}
|
|
|
if (obj.event === "delete") {
|
|
|
//删除功能
|
|
|
var course_id = data.course_id;
|
|
|
var course_name = data.course_name;
|
|
|
var tip = '您确定要删除课程' + course_name + '吗?';
|
|
|
layer.confirm(tip, {
|
|
|
btn: ['确定', '取消']
|
|
|
}, function (index, layero) {
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
dataType: "json",
|
|
|
async: false,
|
|
|
data: {
|
|
|
"course_id": course_id
|
|
|
},
|
|
|
url: "/baseService/teachbase/deleteCourse",
|
|
|
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
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
);
|
|
|
}
|
|
|
});
|
|
|
})
|
|
|
</script>
|
|
|
</body>
|
|
|
</html> |