first commit
This commit is contained in:
284
src/main/webapp/jsp/safety/EducationInsiderView.jsp
Normal file
284
src/main/webapp/jsp/safety/EducationInsiderView.jsp
Normal file
@ -0,0 +1,284 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" pageEncoding="utf-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.foot {
|
||||
display: flex;
|
||||
padding-left: 50px;
|
||||
}
|
||||
|
||||
/*.layout{*/
|
||||
/ display: flex;*/
|
||||
/ padding-left: 15px;*/
|
||||
/*}*/
|
||||
.form-horizontal {
|
||||
padding-top: 20px;
|
||||
padding-left: 60px;
|
||||
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 50px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var select_Data = jQuery.parseJSON('${educationType}');
|
||||
var select_3 = $("#educationType").select2({
|
||||
desabled: true,
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
|
||||
select_3.val('${bean.educationType}').trigger("change");
|
||||
|
||||
|
||||
});
|
||||
var fileDownload = function () {
|
||||
/*window.location.href = ext.contextPath + '/safety/SafetyFiles/download.do?fileId=${bean.fileId}';*/
|
||||
|
||||
var url = ext.contextPath+'/safety/SafetyFiles/toFindImgById?fileId=${bean.fileId}';
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
area: ['60%', '80%'],
|
||||
skin: 'layui-layer-nobg', //没有背景色
|
||||
shadeClose: true,
|
||||
content: '<img style="width: 100%;height: 100%" src="'+url+'"/>'
|
||||
});
|
||||
}
|
||||
var fileSelected = function () {
|
||||
var filename = $('#file').val();
|
||||
$('#fileName').val(filename);
|
||||
};
|
||||
|
||||
function showUser4OneSelectFun() {
|
||||
|
||||
$.post(ext.contextPath + '/user/userForOneSelectByStructure.do', {
|
||||
formId: "viewForm",
|
||||
hiddenId: "userid",
|
||||
textId: "userName",
|
||||
bean: "bean"
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal('user4SelectModal');
|
||||
});
|
||||
}
|
||||
|
||||
function userInfoChage() {
|
||||
var userInfo = JSON.parse($('#bean').val());
|
||||
var userInfo2;
|
||||
$('#userCardId').val(userInfo.userCardId);
|
||||
$('#deptId').val(userInfo.pid);
|
||||
if (userInfo.sex == '1') {
|
||||
$('#gender').val('男');
|
||||
} else {
|
||||
$('#gender').val('女');
|
||||
}
|
||||
$.post(ext.contextPath + '/safety/staffArchives/detail.do?id=' + userInfo.id, function (res) {
|
||||
console.log(res.result)
|
||||
if (res.code == 1) {
|
||||
userInfo2 = res.result;
|
||||
$('#jobTitle').val(userInfo2.jobTitle);
|
||||
$('#duty').val(userInfo2.duty);
|
||||
$('#post').val(userInfo2.post);
|
||||
$('#deptName').val(userInfo2.deptName);
|
||||
$('#hiredate').val(userInfo2.hiredate);
|
||||
$('#workTime').val(userInfo2.workTime);
|
||||
$('#idcard').val(userInfo2.idcard);
|
||||
$('#birthday').val(userInfo2.birthday);
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
}, 'json')
|
||||
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$('#file').val();
|
||||
|
||||
});
|
||||
|
||||
function saveFun() {
|
||||
//console.log($("#viewForm").serialize());
|
||||
$("#viewForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#viewForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var formData = new FormData($("#viewForm")[0]);
|
||||
$.ajax({
|
||||
url: ext.contextPath + "/safety/SafetyEducationInsider/update.do",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
// console.log(data)
|
||||
if (data.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
} else {
|
||||
showAlert('d', '保存失败!' + data.msg);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog" style="width:55%;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">详情记录</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-xs-13">
|
||||
<!-- 新增界面formid强制为viewForm -->
|
||||
<form class="form-horizontal" id="viewForm" enctype="multipart/form-data">
|
||||
<div id="alertDiv"></div>
|
||||
<%-- <input type="hidden" name="id" value="${user.id }" />--%>
|
||||
<!-- 界面提醒div强制id为alertdiv -->
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">培训记录编号:</label>
|
||||
<div class="col-sm-3">
|
||||
<p class="form-control-static">${bean.educationCode}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label right">培训类型:</label>
|
||||
<div class="col-sm-3 ">
|
||||
<p class="form-control-static">${bean.educationType}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">姓名:</label>
|
||||
<div class="col-sm-3">
|
||||
|
||||
<p class="form-control-static">${bean.userName}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label right">工号:</label>
|
||||
<div class="col-sm-3 ">
|
||||
<p class="form-control-static">${bean.userCardId}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label ">性别:</label>
|
||||
<div class="col-sm-3 ">
|
||||
<p class="form-control-static">${bean.gender}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label right">出生日期:</label>
|
||||
<div class="col-sm-3 ">
|
||||
<p class="form-control-static">${bean.birthday}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label ">身份证号:</label>
|
||||
<div class="col-sm-3 ">
|
||||
<p class="form-control-static">${bean.idcard}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label right">参加工作时间:</label>
|
||||
<div class="col-sm-3 ">
|
||||
<p class="form-control-static">${bean.workTime}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label ">入职本司时间:</label>
|
||||
<div class="col-sm-3 ">
|
||||
<p class="form-control-static">${bean.hiredate}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label right">所属部门:</label>
|
||||
<div class="col-sm-3 ">
|
||||
<p class="form-control-static">${bean.deptName}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label ">从事岗位:</label>
|
||||
<div class="col-sm-3 ">
|
||||
<p class="form-control-static">${bean.post}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label right">职务:</label>
|
||||
<div class="col-sm-3 ">
|
||||
<p class="form-control-static">${bean.duty}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label ">职称:</label>
|
||||
<div class="col-sm-3 ">
|
||||
<p class="form-control-static">${bean.jobTitle}</p>
|
||||
</div>
|
||||
|
||||
<label class="col-sm-2 control-label right">综合考试成绩:</label>
|
||||
<div class="col-sm-3 ">
|
||||
<p class="form-control-static">${bean.point}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label ">附件资料:</label>
|
||||
<div class="col-sm-4">
|
||||
<a><p name="fileName" id="fileName" readonly onclick="fileDownload()"
|
||||
style="margin-top: 8px;cursor:pointer;">${fileName}</p></a>
|
||||
</div>
|
||||
<div class="col-sm-2" style="display: flex">
|
||||
<input type="file" id="file" name="file" onclick="fileSelected()"
|
||||
style="display: none"/>
|
||||
<input type="hidden" id="fileId" name="fileId" value="${bean.fileId}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
Reference in New Issue
Block a user