bug修改。

考试成绩录入。
This commit is contained in:
Renpc-kilig 2021-05-15 18:13:29 +08:00
parent 680f648751
commit dd41e1c08e
3 changed files with 673 additions and 28 deletions

View File

@ -87,7 +87,7 @@
<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="1" title="审核通过" checked>
<input type="radio" lay-filter="checkStatus" name="checkStatus" value="2" title="退回">
</div>
</div>
@ -265,33 +265,7 @@
return false;
}
}
formData.field.examId = classPlanId;
formData.field.planName = $('#planName').val();
formData.field.planPersonNum = $('#planPersonNum').val();
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) {
var layerIndex = top.dialog.msg(top.dataMessage.updateSuccess, {
time: 0,
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
shade: 0.3,
yes: function(index) {
top.dialog.close(index);
window.location.reload();
},
btn2: function() {
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);
});
});
sentExamMsg(classPlanId);
}, function(){
return false;
});
@ -299,6 +273,22 @@
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() {
reloadTable();
}
});
}
$('.close').on('click', function() {
closeBox();
});

View File

@ -0,0 +1,336 @@
<!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">
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-body">
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
<div class="layui-inline">
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入关键字">
</div>
<div class="layui-inline">
<input type="text" id="startTime" class="layui-input search-item" placeholder="开始时间" readonly>
</div>
<div class="layui-inline">
<input type="text" id="endTime" class="layui-input search-item" placeholder="结束时间" readonly>
</div>
<button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索
</button>
</div>
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
</div>
</div>
</div>
</div>
</div>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
<script>
layui.config({
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laydate', 'common'], function() {
var $ = layui.$;
var $win = $(window);
var table = layui.table;
var admin = layui.admin;
var laydate = layui.laydate;
var common = layui.common;
var resizeTimeout = null;
var tableUrl = 'api/examapply/listpage';
// 初始化表格
function initTable() {
table.render({
elem: '#dataTable',
id: 'dataTable',
url: top.restAjax.path(tableUrl, []),
width: admin.screen() > 1 ? '100%' : '',
height: $win.height() - 90,
limit: 20,
limits: [20, 40, 60, 80, 100, 200],
request: {
pageName: 'page',
limitName: 'rows'
},
cols: [
[
{type:'checkbox', fixed: 'left'},
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
{field: 'planName', width: 180, title: '计划名称', align:'center',
templet: function(row) {
var rowData = row.classPlanDTO[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'planType', width: 180, title: '计划类型', align:'center',
templet: function(row) {
var rowData = row.classPlanDTO[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
if('1' == rowData) {
rowData = '初训';
}else if('2' == rowData) {
rowData = '复训';
}else if('3' == rowData) {
rowData = '换证 ';
}
return rowData;
}
},
{field: 'orgId', width: 180, title: '考试机构', align:'center',
templet: function(row) {
var rowData = row.classPlanDTO[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'planPersonNum', width: 180, title: '计划人数', align:'center',
templet: function(row) {
var rowData = row.classPlanDTO[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'planStartTime', width: 180, title: '计划开始时间', align:'center',
templet: function(row) {
var rowData = row.classPlanDTO[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'planEndTime', width: 180, title: '计划结束时间', align:'center',
templet: function(row) {
var rowData = row.classPlanDTO[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'chargePerson', width: 180, title: '负责人', align:'center',
templet: function(row) {
var rowData = row.classPlanDTO[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'chargePersonTel', width: 180, title: '联系方式', align:'center',
templet: function(row) {
var rowData = row.classPlanDTO[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'checkStatus', width: 150, title: '审批状态', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData === null || rowData === '') {
return '-';
}
if(rowData == '0') {
rowData = '<a class="layui-btn layui-btn-warm layui-btn-xs">待审批</a>';
}
if(rowData == '1') {
rowData = '<a class="layui-btn layui-btn-xs">审批通过</a>';
}
if(rowData == '2') {
rowData = '<a class="layui-btn layui-btn-danger layui-btn-xs">审批驳回</a>';
}
return rowData;
}
},
{field: 'reason', width: 150, title: '审核原因', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData === null || rowData === '') {
return '-';
}
return rowData;
}
},
{field: 'userList', fixed: 'right', width: 150, title: '参考人员列表', align:'center',
templet: function(row) {
var status = row['status'];
var rowData;
if('0' == status) {
rowData = '暂未分配考场信息';
return rowData;
}
rowData = '<a class="layui-btn layui-btn-xs" lay-event="userList">参考人员列表</a>';
return rowData;
}
},
]
],
page: true,
parseData: function(data) {
return {
'code': 0,
'msg': '',
'count': data.total,
'data': data.rows
};
}
});
}
// 重载表格
function reloadTable(currentPage) {
table.reload('dataTable', {
url: top.restAjax.path(tableUrl, []),
where: {
keywords: $('#keywords').val(),
startTime: $('#startTime').val(),
endTime: $('#endTime').val()
},
page: {
curr: currentPage
},
height: $win.height() - 90,
});
}
// 初始化日期
function initDate() {
// 日期选择
laydate.render({
elem: '#startTime',
format: 'yyyy-MM-dd'
});
laydate.render({
elem: '#endTime',
format: 'yyyy-MM-dd'
});
}
initTable();
initDate();
// 事件 - 页面变化
$win.on('resize', function() {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function() {
reloadTable();
}, 500);
});
// 事件 - 搜索
$(document).on('click', '#search', function() {
reloadTable(1);
});
// 事件 - 增删改
table.on('toolbar(dataTable)', function(obj) {
var layEvent = obj.event;
var checkStatus = table.checkStatus('dataTable');
var checkDatas = checkStatus.data;
if(layEvent === 'saveEvent') {
layer.open({
type: 2,
title: false,
closeBtn: 0,
area: ['100%', '100%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/examapply/save.html', []),
end: function() {
reloadTable();
}
});
} else if(layEvent === 'updateEvent') {
if(checkDatas.length === 0) {
top.dialog.msg(top.dataMessage.table.selectEdit);
} else if(checkDatas.length > 1) {
top.dialog.msg(top.dataMessage.table.selectOneEdit);
} else {
layer.open({
type: 2,
title: false,
closeBtn: 0,
area: ['100%', '100%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/examapply/update-check.html?examApplyId={examApplyId}&classPlanId={classPlanId}', [checkDatas[0].examApplyId, checkDatas[0].examId]),
end: function() {
reloadTable();
}
});
}
} else if(layEvent === 'checkMore') {
if(checkDatas.length === 0) {
top.dialog.msg('请选择要审核的数据');
} else {
var ids = '';
var planIds = '';
for(var i = 0, item; item = checkDatas[i++];) {
debugger
if(item.checkStatus === 0) {
if (i > 1) {
ids += '_';
planIds += ',';
}
ids += item['examApplyId'];
planIds += item['examId'];
}
}
if(ids.length <= 0) {
top.dialog.msg('当前选择数据已经审核完成,请重新选择');
reloadTable();
return false;
}
}
}
});
// 参考人员列表
function userList(data) {
top.dialog.open({
url: top.restAjax.path('route/insertscore/user-list.html?clssId={clssId}', [data.examId]),
title: "剩余考务人员",
width: '80%',
height: '80%',
onClose: function() {
reloadTable();
}
});
}
//监听行单击事件
table.on('tool(dataTable)', function(obj){
var data = obj.data;
if('userList' == obj.event) {
// 参考人员列表
userList(data);
}else if('selOther' == obj.event) {
// 查看剩余监考老师
selOther(data);
}
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,319 @@
<!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">
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-body">
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
<div class="layui-inline">
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入关键字">
</div>
<button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索
</button>
</div>
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
<noscript id="tpl-user" >
<!-- style 尽量不要影响到页面其他元素,使用#userinfo范围限定 -->
<style type="text/css">
#userinfo .layui-form-label.layui-required:after {
content: "*";
color: red;
position: absolute;
top: 10px;
right: 5px;
}
</style>
<div class="layui-card" id="userinfo">
<div class="layui-card-header">考试成绩录入</div>
<input type="hidden" id="applyStudentsId" name="applyStudentsId" value="{{d.applyStudentsId}}">
<input type="hidden" id="applyDataBirth" name="applyDataBirth" value="{{d.applyDataBirth}}">
<input type="hidden" id="applyAuditState" name="applyAuditState" value="{{d.applyAuditState}}">
<div class="layui-card-body">
<form class="layui-form" action="" lay-filter="info">
<div class="layui-form-item">
<label class="layui-form-label">考试成绩</label>
<div class="layui-input-block" style="margin-left: 165px;">
<input type="number" id="applyTestScores" name="applyTestScores" lay-verify="inputRule" class="layui-input" value="" placeholder="请输入考试成绩" maxlength="255">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button type="button" class="layui-btn" id="subBtn" lay-submit lay-filter="submitForm">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
<script>
layui.use(['index', 'form', 'laydate', 'laytpl'], function() {
var $ = layui.$;
var form = layui.form;
var laytpl = layui.laytpl;
var laydate = layui.laydate;
form.verify({
inputRule: function(value) {
if (null == value || '' == value || typeof (value) == "undefined") {
return '下次提交审核时间必填';
}
},
});
form.on('submit(submitForm)', function(formData) {
top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index);
var loadLayerIndex;
var applyStudentsId = $('#applyStudentsId').val();
top.restAjax.put(top.restAjax.path('api/applystudents/update/{applyStudentsId}', [applyStudentsId]), formData.field, null, function(code, data) {
if('200' == code) {
top.dialog.msg('考试录入成功');
window.location.reload();
}else {
top.dialog.msg('考试录入失败');
}
}, 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;
});
form.render();
});
</script>
</div>
</div>
</noscript>
</div>
</div>
</div>
</div>
</div>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
<script>
layui.config({
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laydate', 'upload'], function() {
var $ = layui.$;
var $win = $(window);
var table = layui.table;
var admin = layui.admin;
var layer = layui.layer;
var laytpl = layui.laytpl;
var resizeTimeout = null;
var tableUrl = 'api/applystudents/list-by-classid/{clssId}';
// var tableUrl = 'api/basic-staff-info/listpage';
var clssId = top.restAjax.params(window.location.href).clssId;
function initData(){
initTable();
}
initData();
// 事件 - 页面变化
$win.on('resize', function() {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function() {
reloadTable();
}, 500);
});
// 事件 - 搜索
$(document).on('click', '#search', function() {
reloadTable();
});
function initTable() {
table.render({
elem: '#dataTable',
id: 'dataTable',
url: top.restAjax.path(tableUrl, [clssId]),
// url: top.restAjax.path(tableUrl, []),
width: admin.screen() > 1 ? '100%' : '',
height: $win.height() - 90,
limit: 20,
limits: [20, 40, 60, 80, 100, 200],
request: {
pageName: 'page',
limitName: 'rows'
},
cols: [
[
{type:'checkbox', fixed: 'left'},
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
{field: 'fullName', width: 120, title: '姓名', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'gender', width: 120, title: '性别', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'idCardNumber', width: 180, title: '公民身份证号', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'telephone', width: 150, title: '联系方式', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'nation', width: 120, title: '民族', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'nativePlace', width: 150, title: '籍贯', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData === '') {
return row['nativePlaceAddr'];
}
return rowData + '-' + row['nativePlaceAddr'];
}
},
{field: 'politicalStatus', width: 120, title: '政治面貌', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'occupationCategory', width: 150, title: '职业', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(rowData === '' || typeof (rowData) === 'undefined'){
return row['occupation'];
}
return rowData + '-' + row['occupation'];
}
},
{field: 'registeredResidence', width: 180, title: '户籍地', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return row['registeredResidenceAddr'];
}
return rowData + '-' + row['registeredResidenceAddr'];
}
},
{field: 'currentResidence', width: 180, title: '现住地', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return row['currentResidenceAddr'];
}
return rowData + '-' + row['currentResidenceAddr'];
}
},
{field: 'insertScore', width: 180, title: '现住地', align:'center',
templet: function(row) {
var rowData;
rowData = '<a class="layui-btn layui-btn-xs" lay-event="insertScore">考试成绩录入</a>';
return rowData;
}
}
]
],
page: true,
parseData: function(data) {
return {
'code': 0,
'msg': '',
'count': data.total,
'data': data.rows
};
}
});
}
function reloadTable(currentPage) {
table.reload('dataTable', {
url: top.restAjax.path(tableUrl, []),
where: {
keywords: $('#keywords').val(),
},
page: {
curr: currentPage
},
height: $win.height() - 90,
});
}
function insertScore(data){
var tpldata = {
"applyStudentsId": data.applyStudentsId,
"applyDataBirth": data.applyDataBirth,
"applyAuditState": data.applyAuditState
};
laytpl(document.getElementById('tpl-user').innerText)
.render(tpldata,function(html){
//渲染完成后直接打开
layer.open({
type: 1,
shade: false,
area: ['80%', '50%'],
title: false, //不显示标题
content: html,
});
});
}
//监听行单击事件
table.on('tool(dataTable)', function(obj){
var data = obj.data;
if('insertScore' == obj.event) {
// 考试成绩录入
insertScore(data);
}
});
});
</script>
</body>
</html>