bt-yjj-system-examination-s.../src/main/resources/static/route/classplan/save-report-exam.html
2021-05-12 17:20:00 +08:00

137 lines
5.9 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">
<input type="hidden" id="orgId" name="orgId">
<div class="layui-form-item">
<label class="layui-form-label" style="width: 160px;">选择考试类型</label>
<div class="layui-input-block" style="margin-left: 160px;">
<select id="examType" name="examType" lay-verify="required">
<option value="1">理论考试</option>
<option value="2">实操考试</option>
<option value="3">理论与实操</option>
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" style="width: 160px;"><span style="color: red">*</span>预计考试时间始</label>
<div class="layui-input-block" style="margin-left: 160px;">
<input type="text" id="estimateStart" name="estimateStart" class="layui-input" value="" placeholder="请选择预计考试开始时间" readonly style="cursor: pointer;" lay-verify="required">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" style="width: 160px;"><span style="color: red">*</span>预计考试时间止</label>
<div class="layui-input-block" style="margin-left: 160px;">
<input type="text" id="estimateEnd" name="estimateEnd" class="layui-input" value="" placeholder="请选择预计考试结束时间" readonly style="cursor: pointer;" lay-verify="required">
</div>
</div>
<div class="layui-form-item layui-layout-admin">
<div class="layui-input-block">
<div class="layui-footer" style="left: 0;">
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交申请</button>
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<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', 'form', 'laydate', 'laytpl'], function(){
var $ = layui.$;
var $win = $(window);
var form = layui.form;
var laytpl = layui.laytpl;
var laydate = layui.laydate;
var classPlanId = top.restAjax.params(window.location.href).classPlanId;
// 初始化内容
function initData() {
$('.layui-card').height($win.height());
laydate.render({
elem: '#estimateStart',
format: 'yyyy-MM-dd',
trigger : 'click'
});
laydate.render({
elem: '#estimateEnd',
format: 'yyyy-MM-dd',
trigger : 'click'
});
}
initData();
// 提交表单
form.on('submit(submitForm)', function(formData) {
// 校验时间
if(verifyDate(formData.field['estimateStart'],formData.field['estimateEnd']) == 1){
layer.msg('预计考试开始时间不能大于结束时间');
return;
}
top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index);
var loadLayerIndex;
top.restAjax.put(top.restAjax.path('api/classplan/update-exam/{classPlanId}', [classPlanId]), formData.field, null, function(code, data) {
top.dialog.msg("提交成功");
closeBox();
}, function(code, data) {
top.dialog.msg(data.msg);
}, function() {
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
}, function() {
top.dialog.close(loadLayerIndex);
});
});
return false;
});
function verifyDate(value1,value2){
var v1 = new Date(Date.parse(value1.replace(/-/g,"/"))).getTime();
var v2 = new Date(Date.parse(value2.replace(/-/g,"/"))).getTime();
if( v1 < v2){
return -1;
}
if( v1 == v2){
return 0;
}
if( v1 > v2){
return 1;
}
}
$('.close').on('click', function() {
closeBox();
});
function closeBox() {
parent.layer.close(parent.layer.getFrameIndex(window.name));
}
// 校验
form.verify({
});
});
</script>
</body>
</html>