Examination_system/Examination_system-1/.svn/pristine/58/581d8728df7a53eb840ba0208b3...

214 lines
7.1 KiB
Plaintext

<%@page import="com.bonus.core.DateTimeHelper"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html >
<html lang="en">
<meta name="renderer" content="webkit">
<head>
<%@include file="../baseset.jsp" %>
<%@include file="../systemset.jsp" %>
<link rel="stylesheet"
href="${bonuspath}/static/plugins/jedate/skin/gray.css" />
<link rel="stylesheet"
href="$(bonuspath}/static/plugins/zTree/3.5/zTreeStyle.css" />
<link rel="stylesheet"
href="${bonuspath}/static/plugins/jedate/skin/gray.css" />
<script src="${bonuspath}/static/plugins/zTree/3.5/jquery.ztree.all.min.js"></script>
<script type="text/javascript" src="${bonuspath}/static/plugins/jedate/jedate.js"></script>
</head>
<style type="text/css">
.widget-toolbar a{
vertical-align:middle;
}
.ui-state-focus{
display: none !important;
}
</style>
<body>
<div class="page-content" >
<div class="row-fluid">
<div class="col-xs-12">
<form id="baseForm" class="form-inline" method="POST" onsubmit="return false;">
<div class="widget-header widget-header-large" style="padding:10px;">
<div class="widget-main customBtn" >
<input id="keyWord" type="text" name="keyWord" placeholder="试卷名称关键字查询" />
<input style="width: 10%;" placeholder="选择开始时间" readonly="readonly" class="t" id="startTime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'',maxDate:''})" name="startTime" type="text">-
-<input style="width: 10%;" placeholder="选择结束时间" readonly="readonly" class="t" id="endTime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'',maxDate:''})" name="endTime" type="text">
<button class="btn btn-success btn-sm" onclick="getTime()" id="searchBtn" title="查询" type="button">查询</button>
</div>
<div class="widget-toolbar customBtn">
<!-- <a href="#" title="新增" id="addBtn" class="lrspace3"><i class="icon-plus-sign color bigger-180"></i></a> -->
<a title="打印" onclick="print()" class="lrspace3" ><i class='icon-print color-green bigger-180'></i></a>
<a href="#" title="刷新" onclick="getbaseList(1)" class="lrspace3" ><i class='icon-refresh bigger-180 orange'></i></a>
</div>
</div>
</form>
<div style="overflow:hidden">
<div style="overflow:hidden;scroll="no"">
<table id="baseTable" class="table table-striped table-bordered table-hover" >
<thead>
<tr>
<th style="width:4%" class="center hidden-480">序号</th>
<th style="width:10%" class="center hidden-480">试卷名称</th>
<th style="width:7%" class="center">考试场次</th>
<th style="width:7%" class="center">考试人</th>
<th style="width:13%" class="center">考试专业</th>
<th style="width:12%" class="center">考试开始时间</th>
<th style="width:12%" class="center">考试结束时间</th>
<th style="width:5%" class="center">得分</th>
<th style="width:8%" class="center">是否通过考试</th>
<th style="width:8%" class="center">操作</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-sm-3"></div>
<div class="col-sm-9">
<!--设置分页位置-->
<div id="pageing" class="dataTables_paginate paging_bootstrap">
<ul class="pagination"></ul>
</div>
</div>
</div>
<!-- #dialog-confirm -->
<%@include file="../dialog.jsp" %>
<%@include file="editFromPage.jsp" %>
</div>
</div>
</div>
<script type="text/javascript">
var obj = {};
$(function(){
getbaseList(1);
$("#keyWord").keydown(function(e) {
keycode = e.which || e.keyCode;
if (keycode == 13) {
search();
}
});
});
//删除
function del(examId, userId){
JY.Model.confirm("确认删除吗?",function(){
JY.Ajax.doRequest(null,bonuspath +'/backstage/score/delScore',{examId: examId, userId: userId},function(data){
JY.Model.info(data.resMsg,function(){
getbaseList(1);});
});
});
}
function viewExamPage() {
}
function view(examId, id,examType) {
var index = layer.open({
type: 2,
title: "成绩单",
btn:["取消"],
shade: [0],
area: ['95%', '95%'],
anim: 2,
content: [bonuspath +'/backstage/score/gradeReport?examId='+examId+'&id='+id+'&examType='+examType]
});
}
//修改
function edit(id, userId) {
cleanForm();// 清楚之前的缓存
JY.Ajax.doRequest(null, bonuspath + '/backstage/score/find', {
examId: id,
userId: userId
}, function(data) {
setForm(data);
JY.Model.edit("auDiv", "修改", function() {
if (JY.Validate.form("auForm")) {
var that = $(this);
JY.Ajax.doRequest("auForm",
bonuspath + '/backstage/score/updateGrade', {
examId: id,
userId: userId
}, function(data) {
that.dialog("close");
JY.Model.info(data.resMsg, function() {
getbaseList(1);
});
});
}
});
});
}
// 修改之前,先将查到的值到框里
function setForm(data) {
console.log("data=", data.obj);
var l = data.obj;
$("#auForm input[name$='examId']").val(l.examId);
$("#auForm input[name$='userId']").val(l.userId);
$("#auForm input[name$='grade']").val(JY.Object.notEmpty(l.grade));
}
// 清除缓存
function cleanForm() {
$("#auForm input[name$='grade']").val('');
}
function search(){
$("#search").trigger("click")
}
function getTime(){
var startTime = $("#startTime").val();
var endTime = $("#endTime").val();
if(startTime.length>0 && endTime.length>0){
var startTmp=startTime.split("-");
var endTmp=endTime.split("-");
var sd=new Date(startTmp[0],startTmp[1],startTmp[2]);
var ed=new Date(endTmp[0],endTmp[1],endTmp[2]);
if(sd.getTime()>ed.getTime()){
alert("开始日期不能大于结束日期");
}else{
getbaseList();
}
}else{
getbaseList();
}
}
function getbaseList(init){
obj = {};
if(!JY.Object.notNull(init)){
init = $("#pageNum").val();
}
var size = $("#pageSize").val();
var data = {pageNum:init,pageSize:size};
data.obj = getObjParam("baseForm");
var idx = layer.msg('正在加载数据,请稍等...', {
icon: 16
,shade: 0.01
,time:'-1'
});
$.ajax({
type:"POST",
url:bonuspath +'/backstage/score/findByPage',
data: JSON.stringify(data),
dataType:"html",
contentType:"application/json",
success:function(data){
$("#baseTable tbody").html(data);
layer.close(idx);
},
error:function(data){
console.log("服务器出错,请查看!");
}
})
}
</script>
</body>
</html>