Examination_system/Examination_system-1/.svn/pristine/ba/bab17d265bc44a4ab82a95ff536...

300 lines
9.2 KiB
Plaintext

<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html >
<html lang="en">
<head>
<%@include file="../baseset.jsp" %>
<%@include file="../systemset.jsp" %>
<link rel="stylesheet" href="${bonuspath}/static/plugins/zTree/3.5/zTreeStyle.css" />
<style type="text/css">
.exp{
postion:absolute;
max-hight: 36px;
line-height: 25px;
background-color:#1761c1;
border-radius:5px;
text-align:center;
padding:0.3%;
color:white;
border:none;
margin-top:-5%;
font-size: smaller;
}
</style>
<script src="${bonuspath}/static/plugins/zTree/3.5/jquery.ztree.all.min.js"></script>
</head>
<body>
<div class="page-content">
<div class="row-fluid">
<div class="col-xs-12">
<div class="row">
<div class="col-sm-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="请输入关键词查询..." />
<button class="btn btn-success btn-sm" onclick="getbaseList(1)" id="search" title="查询" type="button">查询</button>
<input id="articleImageFile" type="file" class="form-control" style="width: 200px; display: inline;" />
<button type="button" class="exp" onclick="importData();">座位号导入</button>
<button type="button" class="exp" onclick="importTemplate();" style="width:90px;">座位号模板下载</button>
</div>
<div class="widget-toolbar customBtn">
<a title="新增" onclick="add()" class="lrspace3" ><i class='icon-plus-sign color bigger-180'></i></a>
<a title="刷新" id="searchBtn" onclick="getbaseList()" class="lrspace3" ><i class='icon-refresh bigger-180 orange'></i></a>
</div>
</div>
</form>
<table id="baseTable" class="table table-striped table-bordered table-hover">
<thead>
<tr>
<!-- <th style="width:4%" class="center">
<input type="checkbox" id="checkAll" onclick="checkAllId()"/>
</th> -->
<th style="width:4%" class='center'>序号</th>
<th style="width:10%" class="center">考试场地</th>
<th style="width:10%" class='center'>考生姓名</th>
<th style="width:14%" class="center">身份证号</th>
<th style="width:5%" class="center">考试场次</th>
<th style="width:15%" class="center">考试专业</th>
<th style="width:8%" class="center">考试认证身份</th>
<th style="width:8%" class="center">部门</th>
<th style="width:8%" class="center">经度</th>
<th style="width:8%" class="center">纬度</th>
<th style="width:5%" class="center">座位号</th>
<th style="width:18%" class="center">操作</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<!-- #dialog-confirm -->
<%@include file="../dialog.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 add() {
var index = layer.open({
type: 2,
title: "新增座位号人员",
btn:["保存","取消"],
shade: [0],
area: ['60%', '60%'],
anim: 2,
yes: function(index, layero) {
var obj = $(layero).find("iframe")[0].contentWindow;
var valid = obj.formValid();
if(!valid) {
return;
}
obj.addRegistration();
},
content: [bonuspath +'/backstage/seat/openinserd']
});
}
function view(registrationId) {
var index = layer.open({
type: 2,
title: "座位号查看",
btn:["取消"],
shade: [0],
area: ['60%', '60%'],
anim: 2,
content: [bonuspath +'/backstage/seat/findRegistrationForm?seatId='+registrationId]
});
}
function edit(registrationId) {
var index = layer.open({
type: 2,
title: "座位号信息修改",
btn:["修改","取消"],
shade: [0],
area: ['60%', '60%'],
anim: 2,
yes: function(index, layero) {
var obj = $(layero).find("iframe")[0].contentWindow;
var valid = obj.formValid();
if(!valid) {
return;
}
obj.updateRegistration();
},
content: [bonuspath +'/backstage/seat/findRegistrationForm?seatId='+registrationId]
});
}
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/seat/findByPage',
data: JSON.stringify(data),
dataType:"html",
contentType:"application/json",
success:function(data){
$("#baseTable tbody").html(data);
layer.close(idx);
}
})
}
//删除
function del(seatId) {
var indexMsg = layer.confirm("<h4 style='color:red'>您确定删除该人员吗?</h4>", {btn: ['确认','取消']},function(){
layer.close(indexMsg);
var idx = layer.msg('正在提交数据,请稍等...', {
icon: 16
,shade: 0.01
,time:'-1'
});
$.ajax({
type:"POST",
url:bonuspath +'/backstage/seat/delete',
data:{seatId: seatId},
success:function(data) {
layer.close(idx);
var datas = JSON.parse(data);
var indexMsg = layer.confirm("<h3 style='color:red'>"+datas.resMsg+"</h3>", {btn: ['关闭']},function(){
layer.close(indexMsg);
getbaseList();
});
},
error:function(data){
layer.close(idx);
var indexMsg = layer.confirm('请求发送失败', {btn: ['关闭']},function(){
layer.close(indexMsg);
});
}
})
});
}
//全选checkbox功能
function checkAllId() {
var checkAll = document.getElementById("checkAll");
var checked = $(checkAll).prop('checked');
var ids = document.getElementsByName("ids");
if(checked){
for(var i in ids){
ids[i].checked = true;
}
}else{
for(var i in ids){
ids[i].checked = false;
}
}
}
//获取多选ID
function checkIdList(){
var ids = '';
$("input[type='checkbox']:checked").each(function() {
var id = $(this).val();
ids += id + ',';
})
return ids;
}
function findurl(seatId){
var index = layer.open({
type: 2,
title: "违规图片查看",
btn:["取消"],
shade: [0],
area: ['50%', '95%'],
anim: 2,
content: [bonuspath +'/backstage/seat/findpictureByid?seatId='+seatId]
});
}
function importData() {
var formData = new FormData($('form')[0]);
var name = $("#articleImageFile").val();
if(name==null|| name == "") {
return;
}else{
if(!(name.endsWith(".xls") || name.endsWith(".xlsx") || name.endsWith(".xlsm"))) {
alert("请上传正确的Excel表格!");
$("#articleImageFile").val("");
return;
}else{
formData.append("file", $("#articleImageFile")[0].files[0]);
var idx = layer.msg('正在提交数据,请稍等...', {
icon: 16
,shade: 0.01
,time:'-1'
});
$.ajax({
url : bonuspath + "/backstage/seat/import",
type : 'POST',
async : true,
data : formData,
timeout:20000,
// 告诉jQuery不要去处理发送的数据
processData : false,
// 告诉jQuery不要去设置Content-Type请求头
contentType : false,
success : function(data) {
layer.close(idx);
var datas = JSON.parse(data);
var indexMsg = layer.confirm("<h3 style='color:red'>"+datas.resMsg+"</h3>", {btn: ['关闭']},function(){
layer.close(indexMsg);
getbaseList();
});
},
error:function(XMLHttpRequest, textStatus, errorThrown) {
console.log(JSON.stringify(errorThrown));
layer.close(idx);
var datas = JSON.parse(data);
var indexMsg = layer.confirm("<h3 style='color:red'>"+datas.resMsg+"</h3>", {btn: ['关闭']},function(){
layer.close(indexMsg);
});
}
});
$("#articleImageFile").val("");
}
}
}
function importTemplate() {
//document.location= bonuspath+"/static/js/model/报名人员导入.xls";
//$(location).attr("href",bonuspath +'/backstage/user/downloadExcel?type=2');
document.location= bonuspath+"/static/js/model/座位号模板 .xls";
}
</script>
</body>
</html>