bt-yjj-system-examination-s.../src/main/resources/static/route/classplan/show.html

294 lines
16 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<base href="/signup/">
<meta 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="assets/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
</head>
<body>
<div class="layui-anim layui-anim-fadein">
<div class="layui-card">
<div class="layui-card-body" style="padding: 15px;">
<form class="layui-form layui-form-pane" lay-filter="dataForm">
<div class="layui-row">
<div class="layui-col-md6">
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>班号</label>
<div class="layui-input-block">
<input type="text" id="planNumber" name="planNumber" class="layui-input" value="" readonly="readonly" maxlength="100">
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>班级名称</label>
<div class="layui-input-block">
<input type="text" id="planName" name="planName" class="layui-input" value=""
autocomplete="off" placeholder="请输入班级名称" lay-verify="required" maxlength="255">
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md3">
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>培训类型</label>
<div class="layui-input-block">
<select id="planType" name="planType" readonly="readonly">
<option value="1">初训</option>
<option value="2">复训</option>
</select>
</div>
</div>
</div>
<div class="layui-col-md3">
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>培训项目</label>
<div class="layui-input-block">
<input type="hidden" id="projectCatalogId" name="projectCatalogId" value="">
<input type="text" id="projectCatalogName" name="projectCatalogName" class="layui-input" value="" style="cursor: pointer;" lay-verify="required" placeholder="请选择培训项目" readonly="readonly">
</div>
</div>
</div>
<div class="layui-col-md3">
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>开始时间</label>
<div class="layui-input-block">
<input type="text" id="planStartTime" name="planStartTime" class="layui-input" value="" placeholder="请选择培训开始时间" readonly style="cursor: pointer;" lay-verify="required">
</div>
</div>
</div>
<div class="layui-col-md3">
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>结束时间</label>
<div class="layui-input-block">
<input type="text" id="planEndTime" name="planEndTime" class="layui-input" value="" placeholder="请选择培训结束时间" readonly style="cursor: pointer;" lay-verify="required">
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md6">
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>负责人</label>
<div class="layui-input-block">
<input type="text" id="chargePerson" name="chargePerson" class="layui-input" value=""
autocomplete="off" placeholder="请输入负责人" lay-verify="required" maxlength="50">
</div>
</div>
</div>
<div class="layui-col-md6">
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>联系方式</label>
<div class="layui-input-block">
<input type="text" id="chargePersonTel" name="chargePersonTel" class="layui-input" value=""
autocomplete="off" placeholder="请输入联系方式" lay-verify="required" maxlength="255">
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>培训地点</label>
<div class="layui-input-block">
<input type="text" id="planAddress" name="planAddress" class="layui-input" value=""
autocomplete="off" placeholder="请输入培训地点" lay-verify="required" maxlength="255">
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md12">
<table class="layui-table" id="dataTable" lay-filter="dataTable">
<thead>
<tr>
<th style="width: 50px; text-align: center"><b>确认课程</b></th>
<th style="width: 100px; text-align: center"><b>选择讲师</b></th>
<th style="width: 200px; text-align: center"><b>授课时间</b></th>
<th style="width: 260px; text-align: center"><b>课程名称</b></th>
<th style="width: 100px; text-align: center"><b>课程类型</b></th>
<th style="width: 100px; text-align: center"><b>授课方式</b></th>
</tr>
</thead>
<tbody id="lessonTbodyBox"></tbody>
<script type="text/html" id="lessonTbodyTemplate">
{{# for(var i = 0, item; item = d.lesson[i++];) { }}
<tr id="lesson-{{item.lessonId}}" data-lesson-id="{{item.lessonId}}">
<td style="text-align: center">
<input data-lesson-id="{{item.lessonId}}" type="checkbox" name="lessonCheckBox" lay-skin="primary" lay-filter="lessonCheckBox" disabled>
</td>
<td style="text-align: center">
<select id="select-{{item.lessonId}}">
<option value="">请选择</option>
{{# for(var j = 0, teacher; teacher = d.teacher[j++];) { }}
<option value="{{teacher.teacherId}}">{{teacher.teacherName}}</option>
{{# } }}
</select>
</td>
<td>
<div class="test-table-reload-btn">
<div class="layui-inline">
<input type="text" id="date-start-{{item.lessonId}}" value="" class="layui-input search-item lessons-date"
style="width: 150px" placeholder="开始时间" readonly>
</div>
<div class="layui-inline">
<input type="text" id="date-end-{{item.lessonId}}" value="" class="layui-input search-item lessons-date"
style="width: 150px" placeholder="结束时间" readonly>
</div>
</div>
</td>
<td style="text-align: center">
{{item.lessonName}}
</td>
<td style="text-align: center">
{{# if(item.lessonType == '1'){ }}
必修
{{# } }}
{{# if(item.lessonType == '2'){ }}
选修
{{# } }}
</td>
<td style="text-align: center">
{{# if(item.teachWay == '1'){ }}
面授
{{# } }}
</td>
</tr>
{{# } }}
</script>
</table>
</div>
</div>
</form>
</div>
</div>
</div>
<script src="assets/js/vendor/wangEditor/wangEditor.min.js"></script>
<script src="assets/js/vendor/ckplayer/ckplayer/ckplayer.js"></script>
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script>
layui.config({
base: 'assets/layuiadmin/' //静态资源所在路径
}).extend({
index: 'lib/index' //主入口模块
}).use(['index', 'table', 'form', 'laydate', 'laytpl'], function(){
var $ = layui.$;
var $win = $(window);
var table = layui.table;
var form = layui.form;
var admin = layui.admin;
var laytpl = layui.laytpl;
var laydate = layui.laydate;
var teacherList = [];
var classPlanLessons = [];
var classPlanId = top.restAjax.params(window.location.href).classPlanId;
var orgId = ''
// 初始化内容
function initData() {
$('.layui-card').height($win.height());
var loadLayerIndex;
top.restAjax.get(top.restAjax.path('api/classplan/get/{classPlanId}', [classPlanId]), {}, null, function(code, data) {
var dataFormData = {};
for(var i in data) {
dataFormData[i] = data[i] +'';
}
dataFormData['planStartTime'] = dataFormData['planStartTime'].substring(0,10);
dataFormData['planEndTime'] = dataFormData['planEndTime'].substring(0,10);
dataFormData['signUpStartTime'] = dataFormData['signUpStartTime'].substring(0,10);
dataFormData['signUpEndTime'] = dataFormData['signUpEndTime'].substring(0,10);
form.val('dataForm', dataFormData);
form.render(null, 'dataForm');
if(dataFormData['reportReason'] = ''){
$('#report-reason-block').show();
}
//初始化课程列表
initTeacherList(data.orgId);
classPlanLessons = data.classPlanLessons;
orgId = data.orgId;
}, function(code, data) {
top.dialog.msg(data.msg);
}, function() {
loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
}, function() {
top.dialog.close(loadLayerIndex);
});
}
initData();
//查询讲师列表
function initTeacherList(orgId){
top.restAjax.get(top.restAjax.path('api/teacher/list',[]), {orgId : orgId}, null, function(code,data){
teacherList = data;
initLessonsList();
},function(code,data){
top.dialog.msg(data.msg);
});
}
//查询课程列表
function initLessonsList(){
var dataObj = {};
var projectCatalogId = $('#projectCatalogId').val();
if(projectCatalogId == ''){
dataObj['lesson'] = [];
dataObj['teacher'] = [];
laytpl(document.getElementById('lessonTbodyTemplate').innerHTML).render(dataObj, function(html) {
document.getElementById('lessonTbodyBox').innerHTML = html;
});
form.render();
return;
}
top.restAjax.get(top.restAjax.path('api/lessons/list',[]), {projectCatalogId : projectCatalogId, orgId: orgId}, null, function(code,data){
dataObj['lesson'] = data;
dataObj['teacher'] = teacherList;
laytpl(document.getElementById('lessonTbodyTemplate').innerHTML).render(dataObj, function(html) {
document.getElementById('lessonTbodyBox').innerHTML = html;
});
form.render();
reloadLessonsList();
},function(code,data){
top.dialog.msg(data.msg);
});
}
function reloadLessonsList(){
if(typeof (classPlanLessons) != 'undefined' && classPlanLessons.length > 0)
$.each(classPlanLessons,function(i,e){
var checkBox = $('#lesson-' + e.lessonId).find('input[name="lessonCheckBox"]').get(0);
$(checkBox).attr('checked', 'checked');
$('#select-' + e.lessonId).val(e.teacherId);
$('#select-' + e.lessonId).attr("disabled","disabled");
$('#date-start-' + e.lessonId).val(e.lessonStart);
$('#date-end-' + e.lessonId).val(e.lessonEnd);
});
form.render();
}
function closeBox() {
parent.layer.close(parent.layer.getFrameIndex(window.name));
}
$('.close').on('click', function() {
closeBox();
});
// 校验
form.verify({
});
});
</script>
</body>
</html>