bt-yjj-system-examination-s.../src/main/resources/static/route/examapply/update-check.html
2021-05-15 18:45:57 +08:00

333 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-fluid layui-anim layui-anim-fadein">
<div class="layui-card">
<div class="layui-card-header">
<span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
<a class="close" href="javascript:void(0);">上级列表</a><span lay-separator="">/</span>
<a href="javascript:void(0);"><cite>编辑内容</cite></a>
</span>
</div>
<div class="layui-card-body" style="padding: 15px;">
<blockquote class="site-text layui-elem-quote">
考试申请基本信息
</blockquote>
<form class="layui-form layui-form-pane" lay-filter="initDataForm">
<div class="layui-form-item">
<label class="layui-form-label">培训计划</label>
<div class="layui-input-block">
<input type="text" id="plan" name="plan" class="layui-input" value="培训计划" placeholder="请输入培训计划" maxlength="255" readonly>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">计划名称</label>
<div class="layui-input-block">
<input type="text" id="planName" name="planName" class="layui-input" value="" placeholder="请输入计划名称" maxlength="255" readonly>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">计划类型</label>
<div class="layui-input-block">
<input type="text" id="planType" name="planType" class="layui-input" value="" placeholder="请输入计划名称" maxlength="255" readonly>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">考试机构</label>
<div class="layui-input-block">
<input type="text" id="orgName" name="orgName" class="layui-input" value="" placeholder="请输入考试机构" maxlength="255" readonly>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" style="width: 120px;">计划开始时间</label>
<div class="layui-input-block" style="margin-left: 120px;">
<input type="text" id="planStartTime" name="planStartTime" class="layui-input" value="" placeholder="请输入计划人数" maxlength="255" readonly>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" style="width: 120px;">计划结束时间</label>
<div class="layui-input-block" style="margin-left: 120px;">
<input type="text" id="planEndTime" name="planEndTime" class="layui-input" value="" placeholder="请输入计划人数" maxlength="255" readonly>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">培训地点</label>
<div class="layui-input-block">
<input type="text" id="planAddress" name="planAddress" class="layui-input" value="" placeholder="请输入计划人数" maxlength="255" readonly>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">负责人</label>
<div class="layui-input-block">
<input type="text" id="chargePerson" name="chargePerson" class="layui-input" value="" placeholder="请输入计划人数" maxlength="255" readonly>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">联系方式</label>
<div class="layui-input-block">
<input type="text" id="chargePersonTel" name="chargePersonTel" class="layui-input" value="" placeholder="请输入计划人数" maxlength="255" readonly>
</div>
</div>
</form>
<blockquote class="site-text layui-elem-quote">
审核信息
</blockquote>
<form class="layui-form layui-form-pane" lay-filter="dataForm">
<div class="layui-form-item" pane>
<label class="layui-form-label">审核状态</label>
<div class="layui-input-block layui-form">
<input type="radio" lay-filter="checkStatus" name="checkStatus" value="1" title="审核通过" checked>
<input type="radio" lay-filter="checkStatus" name="checkStatus" value="2" title="退回">
</div>
</div>
<div class="layui-form-item" style="display: none;" id="nextTimeDiv">
<label class="layui-form-label" style="width: 135px;">下次提交审核时间</label>
<div class="layui-input-block" style="margin-left: 165px;">
<input type="number" id="nextNum" name="nextNum" lay-verify="inputRule" class="layui-input" value="" placeholder="请输入下次提交审核时间(单位:天)" maxlength="255">
</div>
</div>
<div class="layui-form-item layui-form-text" style="display: none;" id="reasonDiv">
<label class="layui-form-label">审核失败原因</label>
<div class="layui-input-block">
<textarea type="text" id="reason" name="reason" class="layui-textarea" value="" placeholder="请输入审核结果,审核失败原因"></textarea>
</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" id="subBtn" 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/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', 'form', 'laydate', 'laytpl'], function() {
var $ = layui.$;
var form = layui.form;
var laytpl = layui.laytpl;
var laydate = layui.laydate;
var examApplyId = top.restAjax.params(window.location.href).examApplyId;
var classPlanId = top.restAjax.params(window.location.href).classPlanId;
var wangEditor = window.wangEditor;
var wangEditorObj = {};
var viewerObj = {};
form.on('radio(checkStatus)', function (data) {
var val = data.value;
if (2 == val) {
$('#reasonDiv').show();
$('#nextTimeDiv').show();
} else {
$('#reasonDiv').hide();
$('#nextTimeDiv').hide();
}
});
function closeBox() {
parent.layer.close(parent.layer.getFrameIndex(window.name));
}
function refreshDownloadTemplet(fileName, file) {
var dataRander = {};
dataRander[fileName] = file;
laytpl(document.getElementById(fileName + 'FileDownload').innerHTML).render(dataRander, function (html) {
document.getElementById(fileName + 'FileBox').innerHTML = html;
});
}
// 初始化内容
function initData() {
initExamBaseInfo();
var loadLayerIndex;
top.restAjax.get(top.restAjax.path('api/examapply/get/{examApplyId}', [examApplyId]), {}, null, function (code, data) {
var dataFormData = {};
for (var i in data) {
dataFormData[i] = data[i] + '';
}
if ('2' == data.checkStatus) {
$('#reasonDiv').show();
$('#nextTimeDiv').show();
}
if (null == data.checkStatus || '' == data.checkStatus || typeof (data.checkStatus) == 'undefined') {
$('#subBtn').show();
} else {
$('#subBtn').hide();
}
form.val('dataForm', dataFormData);
form.render(null, 'dataForm');
}, 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 initExamBaseInfo() {
var loadLayerIndex;
top.restAjax.get(top.restAjax.path('api/classplan/get/{classPlanId}', [classPlanId]), {}, null, function (code, data) {
orgNameFun.getOrgName(data.orgId, function(nameData) {
data['orgName'] = nameData.institutionName;
if ('1' == data.planType) {
data.planType = '初训';
} else if ('2' == data.planType) {
data.planType = '复训';
} else if ('3' == data.planType) {
data.planType = '换证 ';
}
var dataFormData = {};
for (var i in data) {
dataFormData[i] = data[i] + '';
}
form.val('initDataForm', dataFormData);
form.render(null, 'initDataForm');
})
}, 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);
});
}
var orgNameFun = {
getOrgName: function (orgId, callback){
var loadLayerIndex;
top.restAjax.get(top.restAjax.path('api/institution/get/{orgId}', [orgId]), {}, null, function (code, data) {
if (null != data) {
callback(data);
}
}, 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);
});
}
}
Date.prototype.format = function(fmt) {
var o = {
"M+" : this.getMonth()+1,
"d+" : this.getDate(),
"h+" : this.getHours(),
"m+" : this.getMinutes(),
"s+" : this.getSeconds(),
"q+" : Math.floor((this.getMonth()+3)/3),
"S" : this.getMilliseconds()
};
if(/(y+)/.test(fmt)) {
fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
};
for(var k in o) {
if(new RegExp("("+ k +")").test(fmt)){
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
}
}
return fmt;
};
// 提交表单
form.on('submit(submitForm)', function(formData) {
layer.confirm('审核一旦通过,将无法进行修改', {
btn: ['确定','取消'] //按钮
}, function(){
if(2 == formData.field.checkStatus) {
if(null == formData.field.reason || '' == formData.field.reason || typeof(formData.field.reason) == "undefined") {
top.dialog.msg('退回原因必填');
return false;
}
if(null == formData.field.nextNum || '' == formData.field.nextNum || typeof(formData.field.nextNum) == "undefined") {
top.dialog.msg('下次提交审核时间必填');
return false;
}
var nextTime = new Date();
nextTime.setDate(nextTime.getDate() + $('#nextNum').val());
formData.field.nextCommitTime = nextTime.format("yyyy-MM-dd hh:mm:ss");
top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index);
var loadLayerIndex;
top.restAjax.put(top.restAjax.path('api/examapply/update/{examApplyId}', [examApplyId]), formData.field, null, function(code, data) {
if('200' == code) {
top.dialog.msg('退回成功');
closeBox();
}else {
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;
}else {
sentExamMsg(classPlanId);
}
}, function(){
return false;
});
return false;
});
// 考场信息分配
function sentExamMsg(planIds) {
layer.open({
type: 2,
title: false,
closeBtn: 0,
area: ['100%', '100%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/examination/distribution/update.html?planId={planId}', [planIds]),
end: function() {
}
});
}
$('.close').on('click', function() {
closeBox();
});
// 校验
form.verify({
});
});
</script>
</body>
</html>