first commit
This commit is contained in:
184
WebRoot/jsp/visit/executeViewInModal.jsp
Normal file
184
WebRoot/jsp/visit/executeViewInModal.jsp
Normal file
@ -0,0 +1,184 @@
|
||||
<%@page import="com.sipai.entity.business.BusinessUnit"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.maintenance.Maintenance"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<%String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath();%>
|
||||
<%String serverPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort();%>
|
||||
<%request.setAttribute("Status_Finish",Maintenance.Status_Finish);%>
|
||||
<!-- 补录状态 -->
|
||||
<%request.setAttribute("TYPE_SUPPLEMENT",Maintenance.TYPE_SUPPLEMENT);%>
|
||||
<!-- 运维主流程状态 -->
|
||||
<%request.setAttribute("TYPE_MAINTENANCE",Maintenance.TYPE_MAINTENANCE);%>
|
||||
<%request.setAttribute("UNIT_HANDLE",BusinessUnit.UNIT_HANDLE);%>
|
||||
<!-- bootstrap-star-rating -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-star-rating/css/star-rating.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-star-rating/js/star-rating.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
//var masterId=$('#maintenanceId').val();
|
||||
var tbName_problem='tb_maintenance_problem_fille'; //数据表
|
||||
var tbName_maintenance='tb_maintenance_file'; //数据表
|
||||
var nameSpace='MaintenanceProblem';//保存文件夹
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function showFileInput(ctrlName) {
|
||||
var control = $('#' + ctrlName);
|
||||
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove:false,
|
||||
showCaption: false,//是否显示标题
|
||||
showBrowse:false,//选择按钮
|
||||
showClose:false,//右上角关闭按钮
|
||||
dropZoneEnabled: false,//是否显示拖拽区域
|
||||
resizeImage:true,
|
||||
fileActionSettings:{
|
||||
showDrag:false
|
||||
},
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount:true,
|
||||
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig:previewConfigs,
|
||||
layoutTemplates:{
|
||||
actionUpload:'',
|
||||
actionDelete:''
|
||||
}
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function() {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow","auto");
|
||||
});
|
||||
}
|
||||
var viewHandleDetailFun = function(id) {
|
||||
$.post(ext.contextPath + '/maintenance/showHandleDetailView.do', {id:id} , function(data) {
|
||||
$("#handleDetailDiv").html(data);
|
||||
openModal('handleDetailModal');
|
||||
});
|
||||
};
|
||||
|
||||
//流程审核文件上传所需参数
|
||||
var masterId_process = '${param.id}';//业务Id
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
var nameSpace_process ='ProcessUploadFile';//保存文件夹
|
||||
var status = 'view';//有查看权限
|
||||
|
||||
$(function() {
|
||||
$("#judgemaintainerstaff").rating('refresh',{showClear:false,showCaption:false,readonly:true});
|
||||
$("#judgeresult").rating('refresh',{showClear:false,showCaption:false,readonly:true});
|
||||
var result='${businessUnitRecords}';
|
||||
result=result.replace(new RegExp("\r\n","gm"),"");
|
||||
var json =JSON.parse(result);
|
||||
$.each(json, function(index, item) {
|
||||
if(item.id!=null &&item.id!=""){
|
||||
previews=new Array();
|
||||
$('#'+item.id).show();
|
||||
var data =item.files;
|
||||
for(var i=0;i<data.length;i++){
|
||||
var previewConfig = new Object();
|
||||
var path = data[i].abspath;
|
||||
path=path.substring(path.indexOf('webapps')+7,path.length);
|
||||
path =ext.basePath.replace(ext.contextPath,'')+ path.replace(/\\/g,"\/");
|
||||
previews.push(path);
|
||||
previewConfig['width']= '30px';
|
||||
previewConfig['caption']= data[i].filename;
|
||||
previewConfig['key']= data[i].id;
|
||||
previewConfigs.push(previewConfig);
|
||||
}
|
||||
//showFileInput(item.id);
|
||||
}
|
||||
});
|
||||
//初始化文件显示
|
||||
//getFileList_process();
|
||||
})
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
var printpage = function (myDiv){
|
||||
$('.printContent').show();
|
||||
var printHtml = document.getElementById(myDiv).innerHTML;
|
||||
var wind = window.open("", "newwin", "width=1550,height=565,top=80,left=80,toolbar=no,scrollbars=yes,menubar=no");
|
||||
var link = document.createElement('link');
|
||||
link.type = 'text/css';
|
||||
link.rel = 'stylesheet';
|
||||
link.href = '<%=serverPath%><%=contextPath%>/plugins/bootstrap-ext/dist/bootstrap.min.css';
|
||||
wind.document.head.appendChild(link);
|
||||
wind.document.body.innerHTML = printHtml;
|
||||
wind.print();
|
||||
wind.close();
|
||||
$('.printContent').hide();
|
||||
};
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
</script>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- The time line -->
|
||||
<ul class="timeline">
|
||||
<c:forEach items="${businessUnitRecords}" var="item" varStatus="status">
|
||||
<li>
|
||||
<c:choose>
|
||||
<c:when test='${finishFlag && status.last}'>
|
||||
<i class="fa fa-check bg-blue"></i>
|
||||
</c:when>
|
||||
<c:otherwise >
|
||||
<i class="fa fa-clock-o bg-grey"></i>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<div class="timeline-item">
|
||||
<span class="time"><i class="fa fa-clock-o"></i> ${item.insdt.substring(0,16)}</span>
|
||||
<h3 class="timeline-header"><a href="#">${item.taskName}</a> ${item.user.caption}</h3>
|
||||
<div class="timeline-body" style="padding-left:5px;padding-right:5px;">
|
||||
<div>
|
||||
${item.record}
|
||||
</div>
|
||||
<c:if test ="${item.id!=''}">
|
||||
<%-- <div style="padding-top:5px;">
|
||||
<input type="file" id='${item.id}' multiple class="file-loading" />
|
||||
</div> --%>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</c:forEach>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
<!-- 流程打印布局 开始 -->
|
||||
<div id="contractExcuteDetail">
|
||||
<div class="printContent" style="display:none">
|
||||
<h4 style="text-align:center;">流程详情</h4>
|
||||
</div>
|
||||
<div class="printContent" style="display:none;">
|
||||
<table style="border-collapse:collapse;margin:0 auto">
|
||||
<tr >
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">时间</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">发起人</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">任务</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">流程内容详情</td>
|
||||
</tr>
|
||||
<c:forEach items="${businessUnitRecords}" var="item" varStatus="status">
|
||||
<tr>
|
||||
<td style="border:1px solid black;width:150px;text-align: center;">${item.insdt.substring(0,16)}</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">${item.user.caption}</td>
|
||||
<td style="border:1px solid black;width:120px;text-align: center;">${item.taskName}</td>
|
||||
<td style="border:1px solid black;width:300px;">${item.record}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</table>
|
||||
</div>
|
||||
<!-- <form class="form-horizontal" id="subForm">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">文件附件:</label>
|
||||
</div>
|
||||
<div class="file-border" id="fileArea">
|
||||
</div>
|
||||
</form> -->
|
||||
</div>
|
||||
|
||||
50
WebRoot/jsp/visit/openExcelTemplate.jsp
Normal file
50
WebRoot/jsp/visit/openExcelTemplate.jsp
Normal file
@ -0,0 +1,50 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.tools.CommUtil"%>
|
||||
<%request.setAttribute("nowDate", CommUtil.nowDate().replaceAll("[[\\s-:punct:]]","")); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
//模板下载
|
||||
function downExcelTemplate(){
|
||||
var excelCount = $("#excelCount").val();
|
||||
window.open(ext.contextPath + "/visit/visitApply/downloadExcelTemplate.do?excelCount="+excelCount);
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="templateModal">
|
||||
<div class="modal-dialog">
|
||||
<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">
|
||||
<form id="importFile" name="importFile" class="form-horizontal" method="post"
|
||||
enctype="multipart/form-data">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="box-body">
|
||||
<div>
|
||||
<label class="col-sm-4 control-label">请输入参观人员行数:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="excelCount" name ="excelCount" placeholder="请输入行数:" min="1" value=1 step="1">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="downExcelTemplate()" id="btn_save">模板下载</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
123
WebRoot/jsp/visit/safeAreaAdd.jsp
Normal file
123
WebRoot/jsp/visit/safeAreaAdd.jsp
Normal file
@ -0,0 +1,123 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@page import="com.sipai.entity.visit.VisitCommString"%>
|
||||
<%request.setAttribute("START", VisitCommString.STATUS_VISIT_START); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
$("#bizId").val(unitId);
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/visit/safeArea/dosave.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
editFun(data.id)
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '安全区域名称不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
securityLevel: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '安全区域级别不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
var showUser4SelectsFun = function(hiddenId,textId) {
|
||||
var userIds= $("#"+hiddenId).val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {formId:"subForm",hiddenId:hiddenId,textId:textId,userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
$(function(){
|
||||
$.post(ext.contextPath + '/user/getUnitFromID.do', {id : unitId}, function(data) {
|
||||
data = $.parseJSON(data);
|
||||
if (data!=null && data.length>0){
|
||||
var Lng = data[0].longitude;
|
||||
var Lat = data[0].latitude;
|
||||
$("#longitude").val(Lng);
|
||||
$("#latitude").val(Lat);
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">新增信息</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i
|
||||
class="glyphicon glyphicon-floppy-disk"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input id="bizId" name="bizId" type="hidden" value=""/>
|
||||
<input type="hidden" class="form-control" id="longitude" name="longitude" value="${safeArea.longitude}">
|
||||
<input type="hidden" class="form-control" id="latitude" name="latitude" value="${safeArea.latitude}">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*安全区域名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="name" name ="name" placeholder="安全区域名称"
|
||||
value="${safeArea.name}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*安全级别</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="securityLevel" name ="securityLevel" placeholder="安全级别"
|
||||
value="${safeArea.securityLevel}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*人群类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="type"
|
||||
name="type" style="width: 100%;">
|
||||
<option value="adult">成人</option>
|
||||
<option value="children">青少年</option>
|
||||
</select>
|
||||
</div>
|
||||
<%--<label class="col-sm-2 control-label">状态</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${safeArea.stateName}</p>
|
||||
<input id="state" name="state" type="hidden" value="${START}"/>
|
||||
</div>--%>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="remark" name ="remark" placeholder="备注...">${safeArea.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
318
WebRoot/jsp/visit/safeAreaEdit.jsp
Normal file
318
WebRoot/jsp/visit/safeAreaEdit.jsp
Normal file
@ -0,0 +1,318 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@page import="com.sipai.entity.visit.VisitCommString"%>
|
||||
<%request.setAttribute("START", VisitCommString.STATUS_VISIT_START); %>
|
||||
<%request.setAttribute("AUDIT", VisitCommString.STATUS_VISIT_AUDIT); %>
|
||||
<%request.setAttribute("REJECT", VisitCommString.STATUS_VISIT_REJECT); %>
|
||||
<%request.setAttribute("EXECUTE", VisitCommString.STATUS_VISIT_EXECUTE); %>
|
||||
<%request.setAttribute("FINISH", VisitCommString.STATUS_VISIT_FINISH); %>
|
||||
<%request.setAttribute("REVOKE", VisitCommString.STATUS_VISIT_REVOKE); %>
|
||||
<%request.setAttribute("VISIT", VisitCommString.STATUS_VISIT); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
.box {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.mapTool{
|
||||
position: absolute;
|
||||
z-index: 999;
|
||||
top: 5px;
|
||||
left: 20px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doupdate() {
|
||||
if($("#bizId").val()==null || $("#bizId").val()==''){
|
||||
$("#bizId").val(unitId);
|
||||
}
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/visit/safeArea/doupdate.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '安全区域名称不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
securityLevel: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '安全区域级别不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
var showUser4SelectsFun = function(hiddenId,textId) {
|
||||
var userIds= $("#"+hiddenId).val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {formId:"subForm",hiddenId:hiddenId,textId:textId,userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
//提交时先验证审核人不能为空,保存时审核人可以为空
|
||||
function submitFun(){
|
||||
//新增的输入框添加验证
|
||||
$("#subForm").data('bootstrapValidator').addField('auditMan',{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '审核人不能为空'
|
||||
},
|
||||
}
|
||||
});
|
||||
dosubmit();
|
||||
}
|
||||
|
||||
function dosubmit(){
|
||||
$("#state").val('${AUDIT}');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/visit/safeArea/startProcess.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 2){
|
||||
showAlert('d','未检测到审核流程,请先部署流程!');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
var dodel = function(id) {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(willDelete =>{
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/visit/safeArea/dodelete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
$("#contentBox").empty();
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var map;
|
||||
var zoom = 12;
|
||||
var polygon;
|
||||
var handler;
|
||||
//显示多边形
|
||||
function showPolygonTool() {
|
||||
var safeAreaId = $("#id").val();
|
||||
$.post(ext.contextPath + '/visit/safeArea/getLngLats.do', {safeAreaId : safeAreaId}, function(data) {
|
||||
data = $.parseJSON(data);
|
||||
var res = data.res;
|
||||
if(res>0){
|
||||
console.log(res);
|
||||
var points = [];
|
||||
var lngLats = data.lngLats;
|
||||
$.each(lngLats,function(n,value){
|
||||
points.push(new T.LngLat(value.longitude, value.latitude));
|
||||
}
|
||||
);
|
||||
//创建面对象
|
||||
polygon = new T.Polygon(points,{
|
||||
color: "blue", weight: 3, opacity: 0.5, fillColor: "#FFFFFF", fillOpacity: 0.5
|
||||
});
|
||||
//向地图上添加面
|
||||
map.addOverLay(polygon);
|
||||
//编辑面
|
||||
enableEdit();
|
||||
}else{
|
||||
openPolygonTool();
|
||||
}
|
||||
});
|
||||
}
|
||||
//注册多边形工具
|
||||
function openPolygonTool() {
|
||||
if (handler) handler.close();
|
||||
handler = new T.PolygonTool(map);
|
||||
handler.open();
|
||||
//用户双击完成一次折线绘制时触发事件。
|
||||
handler.addEventListener("draw", overlay_style);
|
||||
}
|
||||
//获取marker的属性
|
||||
function overlay_style(e) {
|
||||
polygon = e.currentPolygon;
|
||||
enableEdit();
|
||||
}
|
||||
//编辑多边形
|
||||
function enableEdit() {
|
||||
polygon.enableEdit();
|
||||
}
|
||||
//结束编辑多边形
|
||||
function endDraw() {
|
||||
//获取点数组
|
||||
var LngLats = polygon.getLngLats();
|
||||
//嵌套数组
|
||||
LngLats = LngLats[0];
|
||||
//禁用编辑
|
||||
polygon.disableEdit();
|
||||
if(LngLats.length>0){
|
||||
var safeAreaId = $("#id").val();
|
||||
var bizId = $("#bizId").val();
|
||||
var centerLng = map.getCenter().getLng();
|
||||
var centerLat = map.getCenter().getLat();
|
||||
$("#longitude").val(centerLng);
|
||||
$("#latitude").val(centerLat);
|
||||
$.post(ext.contextPath + '/visit/safeArea/setLngLats.do', {LngLats : JSON.stringify(LngLats),safeAreaId : safeAreaId,bizId : bizId,centerLng : centerLng, centerLat : centerLat}, function(data) {
|
||||
if(data.res>0){
|
||||
}else{
|
||||
showAlert('d','保存失败','mainAlertdiv');
|
||||
}
|
||||
enableEdit();
|
||||
});
|
||||
}
|
||||
}
|
||||
//清除绘制内容
|
||||
function clearOverLays() {
|
||||
map.clearOverLays();
|
||||
openPolygonTool();
|
||||
}
|
||||
$(function(){
|
||||
var height = $(window).height();
|
||||
if(height<100){
|
||||
height = window.screen.height-150;
|
||||
}
|
||||
$("#mapDiv").height((height-270)+"px");
|
||||
|
||||
//类型
|
||||
var selelct_type = $("#type").select2({
|
||||
minimumResultsForSearch: 10
|
||||
});
|
||||
selelct_type.val('${safeArea.type}').trigger("change");
|
||||
|
||||
var Lng = $("#longitude").val();
|
||||
var Lat = $("#latitude").val();
|
||||
if(Lng==null || Lng==''){
|
||||
Lng = 121.47081;
|
||||
}
|
||||
if(Lat==null || Lat==''){
|
||||
Lat = 31.23268;
|
||||
}
|
||||
map = new T.Map('mapDiv', {
|
||||
projection: 'EPSG:4326'
|
||||
});
|
||||
map.centerAndZoom(new T.LngLat(Lng,Lat), zoom);
|
||||
//
|
||||
showPolygonTool();
|
||||
|
||||
|
||||
})
|
||||
</script>
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">编辑信息</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<%--<button type="button" class="btn btn-info" onclick="submitFun()" id="btn_submit">提交审核</button>--%>
|
||||
<a onclick="doupdate()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i
|
||||
class="glyphicon glyphicon-floppy-disk"></i></a>
|
||||
<a onclick="dodel()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i
|
||||
class="glyphicon glyphicon-trash"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input id="id" name="id" type="hidden" value="${safeArea.id}"/>
|
||||
<input id="bizId" name="bizId" type="hidden" value="${safeArea.bizId}"/>
|
||||
<input type="hidden" class="form-control" id="longitude" name="longitude" value="${safeArea.longitude}">
|
||||
<input type="hidden" class="form-control" id="latitude" name="latitude" value="${safeArea.latitude}">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*安全区域名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="name" name ="name" placeholder="安全区域名称"
|
||||
value="${safeArea.name}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*安全级别</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="securityLevel" name ="securityLevel" placeholder="安全级别"
|
||||
value="${safeArea.securityLevel}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*人群类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="type"
|
||||
name="type" style="width: 100%;">
|
||||
<option value="adult">成人</option>
|
||||
<option value="children">青少年</option>
|
||||
</select>
|
||||
</div>
|
||||
<%--<label class="col-sm-2 control-label">状态</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${safeArea.stateName}</p>
|
||||
<input id="state" name="state" type="hidden" value="${START}"/>
|
||||
</div>--%>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="remark" name ="remark" placeholder="备注...">${safeArea.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="mapTool">
|
||||
<button type="button" class="btn btn-primary btn-sm" onclick="endDraw();">保存绘制</button>
|
||||
<button type="button" class="btn btn-warning btn-sm" onclick="clearOverLays();">重新绘制</button>
|
||||
</div>
|
||||
<div class="mapDiv" id="mapDiv"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
285
WebRoot/jsp/visit/safeAreaList.jsp
Normal file
285
WebRoot/jsp/visit/safeAreaList.jsp
Normal file
@ -0,0 +1,285 @@
|
||||
<%@ 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"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@page import="com.sipai.entity.visit.VisitCommString"%>
|
||||
<%request.setAttribute("START", VisitCommString.STATUS_VISIT_START); %>
|
||||
<%request.setAttribute("AUDIT", VisitCommString.STATUS_VISIT_AUDIT); %>
|
||||
<%request.setAttribute("REJECT", VisitCommString.STATUS_VISIT_REJECT); %>
|
||||
<%request.setAttribute("EXECUTE", VisitCommString.STATUS_VISIT_EXECUTE); %>
|
||||
<%request.setAttribute("FINISH", VisitCommString.STATUS_VISIT_FINISH); %>
|
||||
<%request.setAttribute("REVOKE", VisitCommString.STATUS_VISIT_REVOKE); %>
|
||||
<%request.setAttribute("VISIT", VisitCommString.STATUS_VISIT); %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
|
||||
<!--bootstrap-edittable 表格行内编辑 -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-editable/css/bootstrap-editable.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-editable.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-table-editable.js" charset="utf-8"></script>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
<!-- 天地图-->
|
||||
<script type="text/javascript" src="http://api.tianditu.gov.cn/api?v=4.0&tk=f423193014cde7bf44b224c6ab2b1210"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var addFun = function() {
|
||||
$.post(ext.contextPath + '/visit/safeArea/doadd.do', {companyId : companyId} , function(data) {
|
||||
$("#contentBox").html(data);
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/visit/safeArea/doedit.do', {id:id} , function(data) {
|
||||
$("#contentBox").html(data);
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
var viewFun = function(id){
|
||||
$.post(ext.contextPath + '/visit/safeArea/doview.do', {id:id} , function(data) {
|
||||
$("#contentBox").html(data);
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(willDelete =>{
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/visit/safeArea/dodelete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
$("#contentBox").empty();
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
if(item.state == '${START}'){
|
||||
datas+=item.id+",";
|
||||
}
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}else{
|
||||
swal({
|
||||
text: "您确定要删除选中记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/visit/safeArea/dodeletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
$("#contentBox").empty();
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function() {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var companyId = "";
|
||||
$(function() {
|
||||
companyId = unitId;
|
||||
initFun();
|
||||
});
|
||||
|
||||
var initFun = function(){
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/visit/safeArea/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val(),
|
||||
search_code: unitId
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
formatter: function (value, row, index) {
|
||||
if (row.state == '${START}') {
|
||||
return {disabled: false,}
|
||||
} else {
|
||||
return {disabled: true,}
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'securityLevel', // 返回json数据中的name
|
||||
title: '安全级别', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',// 上下居中
|
||||
},{
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts= '';
|
||||
if(row.state=='${START}'){
|
||||
buts+= '<security:authorize buttonUrl="visit/safeArea/edit.do">';
|
||||
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts+= '</security:authorize>';
|
||||
buts+= '<security:authorize buttonUrl="visit/safeArea/delete.do">';
|
||||
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\''+row.id+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts+= '</security:authorize>';
|
||||
}else{
|
||||
buts+= '<security:authorize buttonUrl="visit/safeArea/view.do">';
|
||||
buts+='<button class="btn btn-default btn-sm" title="查看" onclick="viewFun(\''+row.id+'\')"><i class="fa fa fa-eye"></i><span class="hidden-md hidden-lg">查看</span></button';
|
||||
buts+= '</security:authorize>';
|
||||
|
||||
}
|
||||
|
||||
buts='<div class="btn-group" >'+buts+'</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div id="importDiv"></div>
|
||||
<div id="templateDiv"></div>
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="visit/safeArea/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
</security:authorize>
|
||||
<security:authorize buttonUrl="visit/safeArea/delete.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button>
|
||||
</security:authorize>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline" >
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
<div class="col-sm-8" id="contentBox">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
228
WebRoot/jsp/visit/visitApplyAdd.jsp
Normal file
228
WebRoot/jsp/visit/visitApplyAdd.jsp
Normal file
@ -0,0 +1,228 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@page import="com.sipai.entity.visit.VisitCommString"%>
|
||||
<%request.setAttribute("START", VisitCommString.STATUS_VISIT_START); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doupdate() {
|
||||
$("#unitId").val(unitId);
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/visit/visitApply/save.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
editFun(data.id)
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
number: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '编号不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
visitUnits: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '来访参观单位不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
leadUnits: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '来访参观牵头单位不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
leaderName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '领队名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
contactInformation: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '联系方式不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
visitTime: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '来访时间不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
visitorsNumber: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '来访人数不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
var showUser4SelectsFun = function(hiddenId,textId) {
|
||||
var userIds= $("#"+hiddenId).val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {formId:"subForm",hiddenId:hiddenId,textId:textId,userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
$(function(){
|
||||
$("#visitTime").datetimepicker({
|
||||
language: 'zh-CN',
|
||||
format: 'yyyy-mm-dd',
|
||||
startView: "month", //初始化视图
|
||||
minView: 2,
|
||||
maxView: "year",
|
||||
todayBtn: true,
|
||||
clearBtn: true,
|
||||
autoclose: true,
|
||||
todayHighlight: 1,//今天高亮
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<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">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input id="unitId" name="unitId" type="hidden" value=""/>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*编号</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="number" name ="number" placeholder="编号"
|
||||
value="${visitApply.number}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">顺序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="morder" name ="morder" placeholder="顺序"
|
||||
value="${visitApply.morder}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*来访参观单位</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="visitUnits" name ="visitUnits" placeholder="来访参观单位"
|
||||
value="${visitApply.visitUnits}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*来访参观牵头单位</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="leadUnits" name ="leadUnits" placeholder="来访参观牵头单位"
|
||||
value="${visitApply.leadUnits}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">陪同来访参观单位</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="organizationalUnit" name ="organizationalUnit"
|
||||
placeholder="陪同来访参观单位" value="${visitApply.organizationalUnit}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*领队名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="leaderName" name ="leaderName" placeholder="领队名称"
|
||||
value="${visitApply.leaderName}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">领队职务</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="leaderPosition" name ="leaderPosition" placeholder="领队职务"
|
||||
value="${visitApply.leaderPosition}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*联系方式</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="contactInformation" name ="contactInformation" placeholder="联系方式"
|
||||
value="${visitApply.contactInformation}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">状态</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${visitApply.stateName}</p>
|
||||
<input id="state" name="state" type="hidden" value="${START}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*来访时间</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="visitTime" name ="visitTime" placeholder="来访时间"
|
||||
value="${visitApply.visitTime}"/>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*来访人数</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="visitorsNumber" name ="visitorsNumber" placeholder="来访人数"
|
||||
value="${visitApply.visitorsNumber}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">审核人</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="auditMan" name ="auditMan" placeholder="请选择审核人"
|
||||
onclick="showUser4SelectsFun('auditManId','auditMan');" value="${visitApply.auditMan}">
|
||||
<input id="auditManId" name="auditManId" type="hidden" value="${visitApply.auditManId}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">来访参观目的及主要内容</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="3" id ="purposeContent" name ="purposeContent"
|
||||
placeholder="来访参观目的及主要内容">${visitApply.purposeContent}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="remark" name ="remark" placeholder="备注...">${visitApply.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_update">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
295
WebRoot/jsp/visit/visitApplyAudit.jsp
Normal file
295
WebRoot/jsp/visit/visitApplyAudit.jsp
Normal file
@ -0,0 +1,295 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@page import="com.sipai.entity.visit.VisitCommString"%>
|
||||
<%request.setAttribute("START", VisitCommString.STATUS_VISIT_START); %>
|
||||
<%request.setAttribute("AUDIT", VisitCommString.STATUS_VISIT_AUDIT); %>
|
||||
<%request.setAttribute("REJECT", VisitCommString.STATUS_VISIT_REJECT); %>
|
||||
<%request.setAttribute("EXECUTE", VisitCommString.STATUS_VISIT_EXECUTE); %>
|
||||
<%request.setAttribute("FINISH", VisitCommString.STATUS_VISIT_FINISH); %>
|
||||
<%request.setAttribute("REVOKE", VisitCommString.STATUS_VISIT_REVOKE); %>
|
||||
<%request.setAttribute("VISIT", VisitCommString.STATUS_VISIT); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
//流程审核文件上传所需参数
|
||||
var masterId_process = '${visitApply.id}';//业务Id
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
var nameSpace_process ='ProcessUploadFile';//保存文件夹
|
||||
var status = 'delete';//有删除权限
|
||||
|
||||
function doSubmit() {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('targetUsersName', 'NOT_VALIDATED',null)
|
||||
.validateField('targetUsersName');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码 */
|
||||
$.post(ext.contextPath + "/visit/visitApply/doAudit.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','操作执行失败,请重试');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= $("#targetusers").val();
|
||||
var jobIds= $("#targetjobs").val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {formId:"subForm",hiddenId:"targetusers",textId:"targetUsersName",userIds:userIds,jobIds:jobIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
$(function(){
|
||||
//初始化选择框,方法在workflow.js里
|
||||
processSelectNode("${businessUnitAudit.taskid}");
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
targetUsersName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '人员不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
$('#table_Detail').bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/visit/visitVisitors/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
showFooter: false,//添加页脚
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
applyID:'${visitApply.id}',
|
||||
}
|
||||
},
|
||||
sortName: 'morder', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'morder', // 返回json数据中的name
|
||||
title: '序号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'fullName', // 返回json数据中的name
|
||||
title: '姓名', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'gender', // 返回json数据中的name
|
||||
title: '性别', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'age', // 返回json数据中的name
|
||||
title: '年龄', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'state',
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 50, // 定义列的宽度,单位为像素px
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_Detail");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
//显示流程详情
|
||||
var id = '${visitApply.id}';
|
||||
$.post(ext.contextPath + '/visit/visitApply/showExecuteView.do', {id:id,inModal:'inModal'} , function(data) {
|
||||
$("#showView").html(data);
|
||||
});
|
||||
})
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-xlg">
|
||||
<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">入库登记(${taskName})</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-7 col-xs-12">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" enctype="multipart/form-data" >
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">编号</label>
|
||||
<div class="col-sm-3">
|
||||
<p class="form-control-static">${visitApply.number}</p>
|
||||
</div>
|
||||
<label class="col-sm-3 control-label">顺序</label>
|
||||
<div class="col-sm-3">
|
||||
<p class="form-control-static">${visitApply.morder}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">来访参观单位</label>
|
||||
<div class="col-sm-9">
|
||||
<p class="form-control-static">${visitApply.visitUnits}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">来访参观牵头单位</label>
|
||||
<div class="col-sm-9">
|
||||
<p class="form-control-static">${visitApply.leadUnits}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">陪同来访参观单位</label>
|
||||
<div class="col-sm-9">
|
||||
<p class="form-control-static">${visitApply.organizationalUnit}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">领队名称</label>
|
||||
<div class="col-sm-3">
|
||||
<p class="form-control-static">${visitApply.leaderName}</p>
|
||||
</div>
|
||||
<label class="col-sm-3 control-label">领队职务</label>
|
||||
<div class="col-sm-3">
|
||||
<p class="form-control-static">${visitApply.leaderPosition}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">联系方式</label>
|
||||
<div class="col-sm-3">
|
||||
<p class="form-control-static">${visitApply.contactInformation}</p>
|
||||
</div>
|
||||
<label class="col-sm-3 control-label">状态</label>
|
||||
<div class="col-sm-3">
|
||||
<p class="form-control-static">${visitApply.stateName}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">来访时间</label>
|
||||
<div class="col-sm-3">
|
||||
<p class="form-control-static">${visitApply.visitTime.substring(0,10)}</p>
|
||||
</div>
|
||||
<label class="col-sm-3 control-label">来访人数</label>
|
||||
<div class="col-sm-3">
|
||||
<p class="form-control-static">${visitApply.visitorsNumber}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">审核人</label>
|
||||
<div class="col-sm-3">
|
||||
<p class="form-control-static">${visitApply.auditMan}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">来访参观目的及主要内容</label>
|
||||
<div class="col-sm-9">
|
||||
<p class="form-control-static">${visitApply.purposeContent}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注</label>
|
||||
<div class="col-sm-9">
|
||||
<p class="form-control-static">${visitApply.remark}</p>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" class="form-control" name ="id" value="${businessUnitAudit.id}">
|
||||
<input type="hidden" class="form-control" name ="processid" value="${businessUnitAudit.processid}">
|
||||
<input type="hidden" class="form-control" name ="taskid" value="${businessUnitAudit.taskid}">
|
||||
<input type="hidden" class="form-control" name ="businessid" value="${businessUnitAudit.businessid}">
|
||||
<input type="hidden" class="form-control" name =unitid value="${param.unitId}">
|
||||
<input type="hidden" class="form-control" name ="taskdefinitionkey" value="${businessUnitAudit.taskdefinitionkey}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*审核结果</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="passstatus" name ="passstatus" style="width: 270px;">
|
||||
<option value= true>通过</option>
|
||||
<option value= false>驳回</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*下一节点</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="routeNum" name ="routeNum" style="width: 270px;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">审核意见</label>
|
||||
<div class="col-sm-6">
|
||||
<textarea class="form-control" rows="2" id ="auditopinion" name ="auditopinion" placeholder="审核意见">通过</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div id = "selectUsers" class="form-group">
|
||||
<label class="col-sm-3 control-label">转至:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="targetUsersName" name ="targetUsersName" placeholder="下一级人员" onclick="showUser4SelectsFun();" >
|
||||
<input id="targetusers" name="targetusers" type="hidden" value=""/>
|
||||
<input class="form-control" id="targetjobs" name="targetjobs" type="hidden" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="box box-primary" style="margin-top:20px">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">参观人员信息</h3>
|
||||
<div class="box-tools pull-right">
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_Detail"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5 col-xs-12" id="showView">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doSubmit()" id="btn_update">审核</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
464
WebRoot/jsp/visit/visitApplyEdit.jsp
Normal file
464
WebRoot/jsp/visit/visitApplyEdit.jsp
Normal file
@ -0,0 +1,464 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@page import="com.sipai.entity.visit.VisitCommString"%>
|
||||
<%request.setAttribute("START", VisitCommString.STATUS_VISIT_START); %>
|
||||
<%request.setAttribute("AUDIT", VisitCommString.STATUS_VISIT_AUDIT); %>
|
||||
<%request.setAttribute("REJECT", VisitCommString.STATUS_VISIT_REJECT); %>
|
||||
<%request.setAttribute("EXECUTE", VisitCommString.STATUS_VISIT_EXECUTE); %>
|
||||
<%request.setAttribute("FINISH", VisitCommString.STATUS_VISIT_FINISH); %>
|
||||
<%request.setAttribute("REVOKE", VisitCommString.STATUS_VISIT_REVOKE); %>
|
||||
<%request.setAttribute("VISIT", VisitCommString.STATUS_VISIT); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doupdate() {
|
||||
if($("#unitId").val()==null || $("#unitId").val()==''){
|
||||
$("#unitId").val(unitId);
|
||||
}
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/visit/visitApply/update.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
number: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '编号不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
visitUnits: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '来访参观单位不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
leadUnits: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '来访参观牵头单位不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
leaderName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '领队名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
contactInformation: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '联系方式不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
visitTime: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '来访时间不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
visitorsNumber: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '来访人数不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
var showUser4SelectsFun = function(hiddenId,textId) {
|
||||
var userIds= $("#"+hiddenId).val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {formId:"subForm",hiddenId:hiddenId,textId:textId,userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
//提交时先验证审核人不能为空,保存时审核人可以为空
|
||||
function submitFun(){
|
||||
//新增的输入框添加验证
|
||||
$("#subForm").data('bootstrapValidator').addField('auditMan',{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '审核人不能为空'
|
||||
},
|
||||
}
|
||||
});
|
||||
dosubmit();
|
||||
}
|
||||
|
||||
function dosubmit(){
|
||||
$("#state").val('${AUDIT}');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/visit/visitApply/startProcess.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 2){
|
||||
showAlert('d','未检测到审核流程,请先部署流程!');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
var addDetailFun = function() {
|
||||
var applyId = $("#id").val();
|
||||
$.post(ext.contextPath + '/visit/visitVisitors/doadd.do',{applyId:applyId},
|
||||
function(data) {
|
||||
$("#subDetailDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
}
|
||||
|
||||
var deletesDetailFun = function(id) {
|
||||
var datas="";
|
||||
if(id!=null && id!=undefined && id!=''){
|
||||
datas = id;
|
||||
}else{
|
||||
var checkedItems = $("#table_Detail").bootstrapTable('getSelections');
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
}
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','alertDiv');
|
||||
}else{
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/visit/visitVisitors/dodeletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','alertDiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
$(function(){
|
||||
$("#visitTime").datetimepicker({
|
||||
language: 'zh-CN',
|
||||
format: 'yyyy-mm-dd',
|
||||
startView: "month", //初始化视图
|
||||
minView: 2,
|
||||
maxView: "year",
|
||||
todayBtn: true,
|
||||
clearBtn: true,
|
||||
autoclose: true,
|
||||
todayHighlight: 1,//今天高亮
|
||||
})
|
||||
$('#table_Detail').bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/visit/visitVisitors/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
showFooter: false,//添加页脚
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
applyID:'${visitApply.id}',
|
||||
}
|
||||
},
|
||||
sortName: 'morder', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'morder', // 返回json数据中的name
|
||||
title: '序号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
editable: { //编辑列元素
|
||||
type: 'text',
|
||||
title: '序号',
|
||||
validate: function (v) {
|
||||
if (!v) return '不能为空';
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'fullName', // 返回json数据中的name
|
||||
title: '姓名', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
editable: { //编辑列元素
|
||||
type: 'text',
|
||||
title: '姓名',
|
||||
validate: function (v) {
|
||||
if (!v) return '不能为空';
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'gender', // 返回json数据中的name
|
||||
title: '性别', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
editable: { //编辑列元素
|
||||
type: 'text',
|
||||
title: '性别',
|
||||
validate: function (v) {
|
||||
if (!v) return '不能为空';
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'age', // 返回json数据中的name
|
||||
title: '年龄', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
editable: { //编辑列元素
|
||||
type: 'number',
|
||||
title: '年龄',
|
||||
validate: function (v) {
|
||||
if (!v) return '不能为空';
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
editable: { //编辑列元素
|
||||
type: 'text',
|
||||
title: '备注',
|
||||
validate: function (v) {
|
||||
if (!v) return '不能为空';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'state',
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 50, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
if(value!=1){
|
||||
return '<div class="btn-group">'+
|
||||
'<button class="btn btn-default btn-sm" onclick="deletesDetailFun(\''+row.id+'\')" title="删除"><i class="fa fa-trash-o"></i></button>'+
|
||||
'</div>';
|
||||
}else{
|
||||
return '不可删除';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
],
|
||||
//保存列修改后的数据
|
||||
onEditableSave: function (field, row, oldValue, $el) {
|
||||
var url = ext.contextPath + "/visit/visitVisitors/doupdate.do";
|
||||
$.post(url, {id:row.id,remark:row.remark,age:row.age,gender:row.gender,fullName:row.fullName,morder : row.morder
|
||||
}, function(data) {
|
||||
if (data.res == 1){
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','编辑失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
},
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_Detail");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<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">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input id="id" name="id" type="hidden" value="${visitApply.id}"/>
|
||||
<input id="unitId" name="unitId" type="hidden" value="${visitApply.unitId}"/>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*编号</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" class="form-control" id="number" name ="number" placeholder="编号"
|
||||
value="${visitApply.number}"/>
|
||||
</div>
|
||||
<label class="col-sm-3 control-label">顺序</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="number" class="form-control" id="morder" name ="morder" placeholder="顺序"
|
||||
value="${visitApply.morder}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*来访参观单位</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="visitUnits" name ="visitUnits" placeholder="来访参观单位"
|
||||
value="${visitApply.visitUnits}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*来访参观牵头单位</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="leadUnits" name ="leadUnits" placeholder="来访参观牵头单位"
|
||||
value="${visitApply.leadUnits}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">陪同来访参观单位</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="organizationalUnit" name ="organizationalUnit"
|
||||
placeholder="陪同来访参观单位" value="${visitApply.organizationalUnit}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*领队名称</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" class="form-control" id="leaderName" name ="leaderName" placeholder="领队名称"
|
||||
value="${visitApply.leaderName}"/>
|
||||
</div>
|
||||
<label class="col-sm-3 control-label">领队职务</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" class="form-control" id="leaderPosition" name ="leaderPosition" placeholder="领队职务"
|
||||
value="${visitApply.leaderPosition}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*联系方式</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" class="form-control" id="contactInformation" name ="contactInformation" placeholder="联系方式"
|
||||
value="${visitApply.contactInformation}"/>
|
||||
</div>
|
||||
<label class="col-sm-3 control-label">状态</label>
|
||||
<div class="col-sm-3">
|
||||
<p class="form-control-static">${visitApply.stateName}</p>
|
||||
<input id="state" name="state" type="hidden" value="${visitApply.state}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*来访时间</label>
|
||||
<div class="col-sm-3">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="visitTime" name ="visitTime" placeholder="来访时间"
|
||||
value="${visitApply.visitTime.substring(0,10)}"/>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-sm-3 control-label">*来访人数</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="number" class="form-control" id="visitorsNumber" name ="visitorsNumber" placeholder="来访人数"
|
||||
value="${visitApply.visitorsNumber}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*审核人</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" class="form-control" id="auditMan" name ="auditMan" placeholder="请选择审核人"
|
||||
onclick="showUser4SelectsFun('auditManId','auditMan');" value="${visitApply.auditMan}">
|
||||
<input id="auditManId" name="auditManId" type="hidden" value="${visitApply.auditManId}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">来访参观目的及主要内容</label>
|
||||
<div class="col-sm-9">
|
||||
<textarea class="form-control" rows="3" id ="purposeContent" name ="purposeContent"
|
||||
placeholder="来访参观目的及主要内容">${visitApply.purposeContent}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注</label>
|
||||
<div class="col-sm-9">
|
||||
<textarea class="form-control" rows="2" id ="remark" name ="remark" placeholder="备注...">${visitApply.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="box box-primary" style="margin-top:20px">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">参观人员信息</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a class="btn btn-box-tool" onclick="addDetailFun()" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a class="btn btn-box-tool" onclick="deletesDetailFun()" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
||||
<a class="btn btn-default btn-sm" onclick="importDetailFun();" ><i class="fa fa-cloud-upload"></i>导入人员信息</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_Detail"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-info" onclick="submitFun()" id="btn_submit">提交审核</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_update">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
525
WebRoot/jsp/visit/visitApplyEditForApply.jsp
Normal file
525
WebRoot/jsp/visit/visitApplyEditForApply.jsp
Normal file
@ -0,0 +1,525 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.visit.VisitCommString"%>
|
||||
<%request.setAttribute("START", VisitCommString.STATUS_VISIT_START); %>
|
||||
<%request.setAttribute("AUDIT", VisitCommString.STATUS_VISIT_AUDIT); %>
|
||||
<%request.setAttribute("REJECT", VisitCommString.STATUS_VISIT_REJECT); %>
|
||||
<%request.setAttribute("EXECUTE", VisitCommString.STATUS_VISIT_EXECUTE); %>
|
||||
<%request.setAttribute("FINISH", VisitCommString.STATUS_VISIT_FINISH); %>
|
||||
<%request.setAttribute("REVOKE", VisitCommString.STATUS_VISIT_REVOKE); %>
|
||||
<%request.setAttribute("VISIT", VisitCommString.STATUS_VISIT); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
//流程审核文件上传所需参数
|
||||
var masterId_process = '${visitApply.id}';//业务Id
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
var nameSpace_process ='ProcessUploadFile';//保存文件夹
|
||||
var status = 'delete';//有删除权限
|
||||
function doupdate() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/visit/visitApply/update.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
number: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '编号不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
visitUnits: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '来访参观单位'
|
||||
}
|
||||
}
|
||||
},
|
||||
leadUnits: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '来访参观牵头单位'
|
||||
}
|
||||
}
|
||||
},
|
||||
leaderName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '领队名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
contactInformation: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '联系方式'
|
||||
}
|
||||
}
|
||||
},
|
||||
visitTime: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '来访时间'
|
||||
}
|
||||
}
|
||||
},
|
||||
visitorsNumber: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '来访人数'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= $("#targetusers").val();
|
||||
var jobIds= $("#targetjobs").val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {formId:"subUnitForm",hiddenId:"targetusers",textId:"targetUsersName",userIds:userIds,jobIds:jobIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
//提交时先验证审核人不能为空,保存时审核人可以为空
|
||||
function submitFun(){
|
||||
//新增的输入框添加验证
|
||||
$("#subForm").data('bootstrapValidator').addField('auditMan',{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '审核人不能为空'
|
||||
},
|
||||
}
|
||||
});
|
||||
dosubmit();
|
||||
}
|
||||
|
||||
function dosubmit(){
|
||||
$('#auditManId').val($('#targetusers').val());
|
||||
$('#subUnitForm').data('bootstrapValidator')
|
||||
.updateStatus('targetUsersName', 'NOT_VALIDATED',null)
|
||||
.validateField('targetUsersName');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
$("#subUnitForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid() && $("#subUnitForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/visit/visitApply/update.do", $("#subForm").serialize(), function(data) {
|
||||
var routeNum = $("#routeNum").val();
|
||||
if (data.res == 1){
|
||||
$.post(ext.contextPath + "/visit/visitApply/doHandleApply.do", $("#subUnitForm").serialize()+"&routeNum="+routeNum, function(unitdata) {
|
||||
if (unitdata.res == 1) {
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(unitdata.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
var addDetailFun = function() {
|
||||
var applyId = $("#id").val();
|
||||
$.post(ext.contextPath + '/visit/visitVisitors/doadd.do',{applyId:applyId},
|
||||
function(data) {
|
||||
$("#subDetailDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
}
|
||||
|
||||
var deletesDetailFun = function(id) {
|
||||
var datas="";
|
||||
if(id!=null && id!=undefined && id!=''){
|
||||
datas = id;
|
||||
}else{
|
||||
var checkedItems = $("#table_Detail").bootstrapTable('getSelections');
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
}
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','alertDiv');
|
||||
}else{
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/visit/visitVisitors/dodeletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','alertDiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
$(function(){
|
||||
$("#visitTime").datetimepicker({
|
||||
language: 'zh-CN',
|
||||
format: 'yyyy-mm-dd',
|
||||
startView: "month", //初始化视图
|
||||
minView: 2,
|
||||
maxView: "year",
|
||||
todayBtn: true,
|
||||
clearBtn: true,
|
||||
autoclose: true,
|
||||
todayHighlight: 1,//今天高亮
|
||||
})
|
||||
//初始化选择框,方法在workflow.js里
|
||||
processSelectNodeForHandle("${businessUnitHandle.taskid}");
|
||||
//输入框验证
|
||||
$("#subUnitForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
targetUsersName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '人员不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
$('#table_Detail').bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/visit/visitVisitors/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
showFooter: false,//添加页脚
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
applyID:'${visitApply.id}',
|
||||
}
|
||||
},
|
||||
sortName: 'morder', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'morder', // 返回json数据中的name
|
||||
title: '序号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
editable: { //编辑列元素
|
||||
type: 'text',
|
||||
title: '序号',
|
||||
validate: function (v) {
|
||||
if (!v) return '不能为空';
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'fullName', // 返回json数据中的name
|
||||
title: '姓名', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
editable: { //编辑列元素
|
||||
type: 'text',
|
||||
title: '姓名',
|
||||
validate: function (v) {
|
||||
if (!v) return '不能为空';
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'gender', // 返回json数据中的name
|
||||
title: '性别', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
editable: { //编辑列元素
|
||||
type: 'text',
|
||||
title: '性别',
|
||||
validate: function (v) {
|
||||
if (!v) return '不能为空';
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'age', // 返回json数据中的name
|
||||
title: '年龄', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
editable: { //编辑列元素
|
||||
type: 'number',
|
||||
title: '年龄',
|
||||
validate: function (v) {
|
||||
if (!v) return '不能为空';
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
editable: { //编辑列元素
|
||||
type: 'text',
|
||||
title: '备注',
|
||||
validate: function (v) {
|
||||
if (!v) return '不能为空';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'state',
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 50, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
if(value!=1){
|
||||
return '<div class="btn-group">'+
|
||||
'<button class="btn btn-default btn-sm" onclick="deletesDetailFun(\''+row.id+'\')" title="删除"><i class="fa fa-trash-o"></i></button>'+
|
||||
'</div>';
|
||||
}else{
|
||||
return '不可删除';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
],
|
||||
//保存列修改后的数据
|
||||
onEditableSave: function (field, row, oldValue, $el) {
|
||||
var url = ext.contextPath + "/visit/visitVisitors/doupdate.do";
|
||||
$.post(url, {id:row.id,remark:row.remark,age:row.age,gender:row.gender,fullName:row.fullName,morder : row.morder
|
||||
}, function(data) {
|
||||
if (data.res == 1){
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','编辑失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
},
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_Detail");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
//显示流程详情
|
||||
var id = '${visitApply.id}';
|
||||
$.post(ext.contextPath + '/visit/visitApply/showExecuteView.do', {id:id,inModal:'inModal'} , function(data) {
|
||||
$("#showView").html(data);
|
||||
});
|
||||
})
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-xlg">
|
||||
<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-7 col-xs-12">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input id="id" name="id" type="hidden" value="${visitApply.id}"/>
|
||||
<input id="unitId" name="unitId" type="hidden" value="${visitApply.unitId}"/>
|
||||
<input id="auditManId" name="auditManId" type="hidden" value="${visitApply.auditManId}" />
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*编号</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" class="form-control" id="number" name ="number" placeholder="编号"
|
||||
value="${visitApply.number}"/>
|
||||
</div>
|
||||
<label class="col-sm-3 control-label">顺序</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="number" class="form-control" id="morder" name ="morder" placeholder="顺序"
|
||||
value="${visitApply.morder}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*来访参观单位</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="visitUnits" name ="visitUnits" placeholder="来访参观单位"
|
||||
value="${visitApply.visitUnits}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*来访参观牵头单位</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="leadUnits" name ="leadUnits" placeholder="来访参观牵头单位"
|
||||
value="${visitApply.leadUnits}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">陪同来访参观单位</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="organizationalUnit" name ="organizationalUnit"
|
||||
placeholder="陪同来访参观单位" value="${visitApply.organizationalUnit}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*领队名称</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" class="form-control" id="leaderName" name ="leaderName" placeholder="领队名称"
|
||||
value="${visitApply.leaderName}"/>
|
||||
</div>
|
||||
<label class="col-sm-3 control-label">领队职务</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" class="form-control" id="leaderPosition" name ="leaderPosition" placeholder="领队职务"
|
||||
value="${visitApply.leaderPosition}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*联系方式</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" class="form-control" id="contactInformation" name ="contactInformation" placeholder="联系方式"
|
||||
value="${visitApply.contactInformation}"/>
|
||||
</div>
|
||||
<label class="col-sm-3 control-label">状态</label>
|
||||
<div class="col-sm-3">
|
||||
<p class="form-control-static">${visitApply.stateName}</p>
|
||||
<input id="state" name="state" type="hidden" value="${visitApply.state}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*来访时间</label>
|
||||
<div class="col-sm-3">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="visitTime" name ="visitTime" placeholder="来访时间"
|
||||
value="${visitApply.visitTime.substring(0,10)}"/>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-sm-3 control-label">*来访人数</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="number" class="form-control" id="visitorsNumber" name ="visitorsNumber" placeholder="来访人数"
|
||||
value="${visitApply.visitorsNumber}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">来访参观目的及主要内容</label>
|
||||
<div class="col-sm-9">
|
||||
<textarea class="form-control" rows="3" id ="purposeContent" name ="purposeContent"
|
||||
placeholder="来访参观目的及主要内容">${visitApply.purposeContent}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注</label>
|
||||
<div class="col-sm-9">
|
||||
<textarea class="form-control" rows="2" id ="remark" name ="remark" placeholder="备注...">${visitApply.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form class="form-horizontal" id="subUnitForm" enctype="multipart/form-data" >
|
||||
<input type="hidden" class="form-control" name ="id" value="${businessUnitHandle.id}">
|
||||
<input type="hidden" class="form-control" name ="processid" value="${businessUnitHandle.processid}">
|
||||
<input type="hidden" class="form-control" name ="taskid" value="${businessUnitHandle.taskid}">
|
||||
<input type="hidden" class="form-control" name ="businessid" value="${businessUnitHandle.businessid}">
|
||||
<input type="hidden" class="form-control" name ="taskdefinitionkey" value="${businessUnitHandle.taskdefinitionkey}">
|
||||
<c:if test='${not empty rejectReson }'>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">调整说明:</label>
|
||||
<div class="col-sm-9">
|
||||
<textarea class="form-control " id="auditopinion" name="auditopinion" rows="2" placeholder="调整说明" >${rejectReson}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*下一节点</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="routeNum" name ="routeNum" style="width: 270px;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div id = "selectUsers" class="form-group">
|
||||
<label class="col-sm-3 control-label">提交至:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="targetUsersName" name ="targetUsersName" placeholder="下一级人员" onclick="showUser4SelectsFun();" >
|
||||
<input id="targetusers" name="targetusers" type="hidden" value="${businessUnitHandle.targetusers}"/>
|
||||
<input class="form-control" id="targetjobs" name="targetjobs" type="hidden" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="box box-primary" style="margin-top:20px">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">参观人员信息</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="deletesDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_Detail"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5 col-xs-12" id="showView">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosubmit()" id="btn_submit">提交审核</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
228
WebRoot/jsp/visit/visitApplyForSelect.jsp
Normal file
228
WebRoot/jsp/visit/visitApplyForSelect.jsp
Normal file
@ -0,0 +1,228 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.visit.VisitCommString"%>
|
||||
<%request.setAttribute("START", VisitCommString.STATUS_VISIT_START); %>
|
||||
<%request.setAttribute("AUDIT", VisitCommString.STATUS_VISIT_AUDIT); %>
|
||||
<%request.setAttribute("REJECT", VisitCommString.STATUS_VISIT_REJECT); %>
|
||||
<%request.setAttribute("EXECUTE", VisitCommString.STATUS_VISIT_EXECUTE); %>
|
||||
<%request.setAttribute("FINISH", VisitCommString.STATUS_VISIT_FINISH); %>
|
||||
<%request.setAttribute("REVOKE", VisitCommString.STATUS_VISIT_REVOKE); %>
|
||||
<%request.setAttribute("VISIT", VisitCommString.STATUS_VISIT); %>
|
||||
<!DOCTYPE html>
|
||||
<style type="text/css">
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
var doSearchApply = function() {
|
||||
$("#table_visitApply").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
//单选
|
||||
if(row.id==hiddenId){
|
||||
flag=true;
|
||||
}
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
var $table;
|
||||
var switchStatus=false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
function initialSelectionIds(){
|
||||
//单选
|
||||
selectionIds =new Array(1);
|
||||
selectionIds[0]=hiddenId;
|
||||
}
|
||||
function getCheckedIds(){
|
||||
var ids=hiddenId;
|
||||
return ids;
|
||||
}
|
||||
var hiddenId ;
|
||||
var companyId = "";
|
||||
$(function() {
|
||||
companyId = unitId;
|
||||
hiddenId = $('#${param.formId} #${param.hiddenId}').val();
|
||||
$("#search_name_visitApply").keyup(function () {
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
//回车执行查询
|
||||
doSearchApply();
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
initialSelectionIds();
|
||||
$table=$("#table_visitApply").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/visit/visitApply/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name_visitApply').val(),
|
||||
search_code: companyId,
|
||||
state:'${EXECUTE}'
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
radio:true, // 显示一个单选框
|
||||
formatter: function (i,row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
|
||||
if($.inArray(row.id,Array.from(selectionIds))!=-1){ // 因为 Set是集合,需要先转换成数组
|
||||
return {
|
||||
checked : true // 存在则选中
|
||||
}
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'number', // 返回json数据中的name
|
||||
title: '编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'visitUnits', // 返回json数据中的name
|
||||
title: '来访参观单位', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'leaderName', // 返回json数据中的name
|
||||
title: '领队名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'visitTime', // 返回json数据中的name
|
||||
title: '来访时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter:function (value, row, index){
|
||||
return value.substring(0,10);
|
||||
}
|
||||
},{
|
||||
field: 'visitorsNumber', // 返回json数据中的name
|
||||
title: '来访人数', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'contactInformation', // 返回json数据中的name
|
||||
title: '联系方式', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_visitApply");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
},
|
||||
onCheck:function(row, $element){
|
||||
|
||||
$('#${param.formId} #${param.hiddenId}').val(row.id);
|
||||
$('#${param.formId} #visitUnits').val(row.visitUnits);
|
||||
$('#${param.formId} #leaderName').val(row.leaderName);
|
||||
$('#${param.formId} #contactInformation').val(row.contactInformation);
|
||||
$('#${param.formId} #visitorsNumber').val(row.visitorsNumber);
|
||||
$('#${param.formId} #visitTime').val(row.visitTime.substring(0,10));
|
||||
|
||||
closeModal("apply4SelectModal");
|
||||
dosearchDetail();
|
||||
}
|
||||
})
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e,rows, obj) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
if('check'==e.type){
|
||||
obj.parent().addClass("checked");
|
||||
}else{
|
||||
obj.parent().removeClass("checked");
|
||||
}
|
||||
//adjustBootstrapTableView("table_visitApply");
|
||||
});
|
||||
});
|
||||
//选中事件操作数组
|
||||
var union = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
if($.inArray(id,array)==-1){
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
//取消选中事件操作数组
|
||||
var difference = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id,array);
|
||||
if(index!=-1){
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = {"union":union,"difference":difference};
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="apply4SelectModal">
|
||||
<div class="modal-dialog modal-lg ">
|
||||
<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 " style="width:100%;">
|
||||
<div id="visitApplyAlertDiv"></div>
|
||||
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="form-group pull-right form-inline" >
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name_visitApply" name="search_name_visitApply" class="form-control pull-right" placeholder="公司、领队名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="doSearchApply();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<table id="table_visitApply" ></table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doSelect()">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
112
WebRoot/jsp/visit/visitApplyImport.jsp
Normal file
112
WebRoot/jsp/visit/visitApplyImport.jsp
Normal file
@ -0,0 +1,112 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.tools.CommUtil"%>
|
||||
<%request.setAttribute("nowDate", CommUtil.nowDate().replaceAll("[[\\s-:punct:]]","")); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var control;
|
||||
function initUpload(ctrlName, uploadUrl) {
|
||||
control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync: true, //默认异步上传
|
||||
showCaption: true,//是否显示标题
|
||||
showUpload: false, //是否显示上传按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
allowedFileExtensions: ["xls", "xlsx"], //接收的文件后缀
|
||||
maxFileCount: 1,//最大上传文件数限制
|
||||
previewFileIcon: '<i class="glyphicon glyphicon-file"></i>',
|
||||
showPreview: false, //是否显示预览
|
||||
previewFileIconSettings: {
|
||||
'docx': '<i ass="fa fa-file-word-o text-primary"></i>',
|
||||
'xlsx': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'xls': '<i class="fa fa-file-excel-o text-success"></i>',
|
||||
'pptx': '<i class="fa fa-file-powerpoint-o text-danger"></i>',
|
||||
'jpg': '<i class="fa fa-file-photo-o text-warning"></i>',
|
||||
'pdf': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
'zip': '<i class="fa fa-file-archive-o text-muted"></i>',
|
||||
},
|
||||
//参数
|
||||
uploadExtraData: function () {
|
||||
var data = {
|
||||
"id": '${param.id}', //此处自定义传参
|
||||
};
|
||||
return data;
|
||||
}
|
||||
});
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
if(data.response.status == true){
|
||||
closeModal('importModal');
|
||||
$("#table_VisitApply").bootstrapTable('refresh');
|
||||
showAlert('s',data.response.msg,'mainAlertdiv');
|
||||
}else{
|
||||
showAlert('d',data.response.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function(){
|
||||
initUpload("filelist", ext.contextPath+ "/visit/visitApply/saveExcelData.do");
|
||||
})
|
||||
//导入上传文件的数据
|
||||
function importExcelFun(){
|
||||
if($("#filelist").val() == null || $("#filelist").val()==""){
|
||||
showAlert('d','上传的文件不能为空!');
|
||||
}else{
|
||||
control.fileinput("upload");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//打开模板下载页面
|
||||
function openExcelTemplate(){
|
||||
var companyId = unitId;
|
||||
$.post(ext.contextPath + '/visit/visitApply/openExcelTemplate.do', {companyId : companyId} , function(data) {
|
||||
$("#templateDiv").html(data);
|
||||
openModal('templateModal');
|
||||
});
|
||||
}
|
||||
|
||||
//模板下载
|
||||
function downExcelTemplate(){
|
||||
window.open(ext.contextPath + "/visit/visitApply/downloadExcelTemplate.do");
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="importModal">
|
||||
<div class="modal-dialog">
|
||||
<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">
|
||||
<form id="importFile" name="importFile" class="form-horizontal" method="post"
|
||||
enctype="multipart/form-data">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="box-body">
|
||||
<div>
|
||||
<input id="filelist" name="filelist" class="file-loading" type="file" multiple accept=".xls,.xlsx">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="openExcelTemplate()" id="btn_save">模板下载</button>
|
||||
<button type="button" class="btn btn-primary" onclick="importExcelFun()" id="btn_save">导入</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
323
WebRoot/jsp/visit/visitApplyList.jsp
Normal file
323
WebRoot/jsp/visit/visitApplyList.jsp
Normal file
@ -0,0 +1,323 @@
|
||||
<%@ 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"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@page import="com.sipai.entity.visit.VisitCommString"%>
|
||||
<%request.setAttribute("START", VisitCommString.STATUS_VISIT_START); %>
|
||||
<%request.setAttribute("AUDIT", VisitCommString.STATUS_VISIT_AUDIT); %>
|
||||
<%request.setAttribute("REJECT", VisitCommString.STATUS_VISIT_REJECT); %>
|
||||
<%request.setAttribute("EXECUTE", VisitCommString.STATUS_VISIT_EXECUTE); %>
|
||||
<%request.setAttribute("FINISH", VisitCommString.STATUS_VISIT_FINISH); %>
|
||||
<%request.setAttribute("REVOKE", VisitCommString.STATUS_VISIT_REVOKE); %>
|
||||
<%request.setAttribute("VISIT", VisitCommString.STATUS_VISIT); %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
|
||||
<!--bootstrap-edittable 表格行内编辑 -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-editable/css/bootstrap-editable.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-editable.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-table-editable.js" charset="utf-8"></script>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var addFun = function() {
|
||||
$.post(ext.contextPath + '/visit/visitApply/add.do', {companyId : companyId} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/visit/visitApply/edit.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var viewFun = function(id){
|
||||
$.post(ext.contextPath + '/visit/visitApply/view.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(willDelete =>{
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/visit/visitApply/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
if(item.state == '${START}'){
|
||||
datas+=item.id+",";
|
||||
}
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}else{
|
||||
swal({
|
||||
text: "您确定要删除选中记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/visit/visitApply/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function() {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var companyId = "";
|
||||
$(function() {
|
||||
companyId = unitId;
|
||||
initFun();
|
||||
});
|
||||
|
||||
var initFun = function(){
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/visit/visitApply/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val(),
|
||||
search_code: unitId
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
formatter: function (value, row, index) {
|
||||
if (row.state == '${START}') {
|
||||
return {disabled: false,}
|
||||
} else {
|
||||
return {disabled: true,}
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'number', // 返回json数据中的name
|
||||
title: '编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'visitUnits', // 返回json数据中的name
|
||||
title: '来访参观单位', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'leadUnits', // 返回json数据中的name
|
||||
title: '来访参观牵头单位', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'organizationalUnit', // 返回json数据中的name
|
||||
title: '陪同来访参观单位', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'leaderName', // 返回json数据中的name
|
||||
title: '领队名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'visitTime', // 返回json数据中的name
|
||||
title: '来访时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter:function (value, row, index){
|
||||
return value.substring(0,10);
|
||||
}
|
||||
},{
|
||||
field: 'visitorsNumber', // 返回json数据中的name
|
||||
title: '来访人数', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'contactInformation', // 返回json数据中的name
|
||||
title: '联系方式', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'stateName', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',// 上下居中
|
||||
},{
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts= '';
|
||||
if(row.state=='${START}'){
|
||||
buts+= '<security:authorize buttonUrl="visit/visitApply/edit.do">';
|
||||
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts+= '</security:authorize>';
|
||||
buts+= '<security:authorize buttonUrl="visit/visitApply/delete.do">';
|
||||
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\''+row.id+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts+= '</security:authorize>';
|
||||
}else{
|
||||
buts+= '<security:authorize buttonUrl="visit/visitApply/view.do">';
|
||||
buts+='<button class="btn btn-default btn-sm" title="查看" onclick="viewFun(\''+row.id+'\')"><i class="fa fa fa-eye"></i><span class="hidden-md hidden-lg">查看</span></button';
|
||||
buts+= '</security:authorize>';
|
||||
|
||||
}
|
||||
|
||||
buts='<div class="btn-group" >'+buts+'</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//导入
|
||||
function importFun(){
|
||||
$.post(ext.contextPath + '/visit/visitApply/importVisitApply.do' , function(data) {
|
||||
$("#importDiv").html(data);
|
||||
openModal('importModal');
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div id="importDiv"></div>
|
||||
<div id="templateDiv"></div>
|
||||
<div >
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="visit/visitApply/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
</security:authorize>
|
||||
<security:authorize buttonUrl="visit/visitApply/delete.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button>
|
||||
</security:authorize>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline" >
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="公司、领队名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
213
WebRoot/jsp/visit/visitApplyView.jsp
Normal file
213
WebRoot/jsp/visit/visitApplyView.jsp
Normal file
@ -0,0 +1,213 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@page import="com.sipai.entity.visit.VisitCommString"%>
|
||||
<%request.setAttribute("START", VisitCommString.STATUS_VISIT_START); %>
|
||||
<%request.setAttribute("AUDIT", VisitCommString.STATUS_VISIT_AUDIT); %>
|
||||
<%request.setAttribute("REJECT", VisitCommString.STATUS_VISIT_REJECT); %>
|
||||
<%request.setAttribute("EXECUTE", VisitCommString.STATUS_VISIT_EXECUTE); %>
|
||||
<%request.setAttribute("FINISH", VisitCommString.STATUS_VISIT_FINISH); %>
|
||||
<%request.setAttribute("REVOKE", VisitCommString.STATUS_VISIT_REVOKE); %>
|
||||
<%request.setAttribute("VISIT", VisitCommString.STATUS_VISIT); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function(){
|
||||
|
||||
$('#table_Detail').bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/visit/visitVisitors/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
showFooter: false,//添加页脚
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
applyID:'${visitApply.id}',
|
||||
}
|
||||
},
|
||||
sortName: 'morder', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'morder', // 返回json数据中的name
|
||||
title: '序号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'fullName', // 返回json数据中的name
|
||||
title: '姓名', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'gender', // 返回json数据中的name
|
||||
title: '性别', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'age', // 返回json数据中的name
|
||||
title: '年龄', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'state',
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 50, // 定义列的宽度,单位为像素px
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_Detail");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
//显示流程详情
|
||||
var id = $("#id").val();
|
||||
$.post(ext.contextPath + '/visit/visitApply/showExecuteView.do', {id:id,inModal:'inModal'} , function(data) {
|
||||
$("#showView").html(data);
|
||||
});
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-xlg">
|
||||
<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-7 col-xs-12">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input id="id" name="id" type="hidden" value="${visitApply.id}"/>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">编号</label>
|
||||
<div class="col-sm-3">
|
||||
<p class="form-control-static">${visitApply.number}</p>
|
||||
</div>
|
||||
<label class="col-sm-3 control-label">顺序</label>
|
||||
<div class="col-sm-3">
|
||||
<p class="form-control-static">${visitApply.morder}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">来访参观单位</label>
|
||||
<div class="col-sm-9">
|
||||
<p class="form-control-static">${visitApply.visitUnits}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">来访参观牵头单位</label>
|
||||
<div class="col-sm-9">
|
||||
<p class="form-control-static">${visitApply.leadUnits}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">陪同来访参观单位</label>
|
||||
<div class="col-sm-9">
|
||||
<p class="form-control-static">${visitApply.organizationalUnit}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">领队名称</label>
|
||||
<div class="col-sm-3">
|
||||
<p class="form-control-static">${visitApply.leaderName}</p>
|
||||
</div>
|
||||
<label class="col-sm-3 control-label">领队职务</label>
|
||||
<div class="col-sm-3">
|
||||
<p class="form-control-static">${visitApply.leaderPosition}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">联系方式</label>
|
||||
<div class="col-sm-3">
|
||||
<p class="form-control-static">${visitApply.contactInformation}</p>
|
||||
</div>
|
||||
<label class="col-sm-3 control-label">状态</label>
|
||||
<div class="col-sm-3">
|
||||
<p class="form-control-static">${visitApply.stateName}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">来访时间</label>
|
||||
<div class="col-sm-3">
|
||||
<p class="form-control-static">${visitApply.visitTime.substring(0,10)}</p>
|
||||
</div>
|
||||
<label class="col-sm-3 control-label">来访人数</label>
|
||||
<div class="col-sm-3">
|
||||
<p class="form-control-static">${visitApply.visitorsNumber}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">审核人</label>
|
||||
<div class="col-sm-3">
|
||||
<p class="form-control-static">${visitApply.auditMan}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">来访参观目的及主要内容</label>
|
||||
<div class="col-sm-9">
|
||||
<p class="form-control-static">${visitApply.purposeContent}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注</label>
|
||||
<div class="col-sm-9">
|
||||
<p class="form-control-static">${visitApply.remark}</p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="box box-primary" style="margin-top:20px">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">参观人员信息</h3>
|
||||
<div class="box-tools pull-right">
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_Detail"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5 col-xs-12" id="showView">
|
||||
</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>
|
||||
263
WebRoot/jsp/visit/visitRegisterAdd.jsp
Normal file
263
WebRoot/jsp/visit/visitRegisterAdd.jsp
Normal file
@ -0,0 +1,263 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@page import="com.sipai.entity.visit.VisitCommString"%>
|
||||
<%request.setAttribute("START", VisitCommString.STATUS_VISIT_START); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doupdate() {
|
||||
$("#unitId").val(unitId);
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/visit/visitRegister/save.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
editFun(data.id)
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
number: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '编号不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
visitUnits: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '参观单位不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
leaderName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '领队名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
contactInformation: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '联系方式不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
visitTime: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '参观时间不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
insdt: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '填表时间不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
visitorsNumber: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '参观人数不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
receptionist: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '接待人不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
var showUser4SelectsFun = function(hiddenId,textId) {
|
||||
var userIds= $("#"+hiddenId).val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {formId:"subForm",hiddenId:hiddenId,textId:textId,userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
var showApply4Select = function(hiddenId) {
|
||||
var userIds= $("#"+hiddenId).val();
|
||||
$.post(ext.contextPath + '/visit/visitApply/visitApply4Select.do', {formId:"subForm",hiddenId:hiddenId} , function(data) {
|
||||
$("#apply4SelectDiv").html(data);
|
||||
openModal("apply4SelectModal");
|
||||
});
|
||||
};
|
||||
$(function(){
|
||||
$("#visitTime").datetimepicker({
|
||||
language: 'zh-CN',
|
||||
format: 'yyyy-mm-dd',
|
||||
startView: "month", //初始化视图
|
||||
minView: 2,
|
||||
maxView: "year",
|
||||
todayBtn: true,
|
||||
clearBtn: true,
|
||||
autoclose: true,
|
||||
todayHighlight: 1,//今天高亮
|
||||
endDate: new Date(),
|
||||
})
|
||||
|
||||
$("#insdt").datetimepicker({
|
||||
language: 'zh-CN',
|
||||
format: 'yyyy-mm-dd',
|
||||
startView: "month", //初始化视图
|
||||
minView: 2,
|
||||
maxView: "year",
|
||||
todayBtn: true,
|
||||
clearBtn: true,
|
||||
autoclose: true,
|
||||
todayHighlight: 1,//今天高亮
|
||||
endDate: new Date(),
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<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">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input id="unitId" name="unitId" type="hidden" value=""/>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*编号</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="number" name ="number" placeholder="编号"
|
||||
value="${visitRegister.number}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*填表日期</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="insdt" name ="insdt" placeholder="填表日期" readonly
|
||||
value="${visitRegister.insdt.substring(0,10)}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*参观单位</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="visitUnits" name ="visitUnits" placeholder="参观单位" readonly
|
||||
onclick="showApply4Select('applyId');" value="${visitRegister.visitUnits}"/>
|
||||
<input type="hidden" id="applyId" name ="applyId" value="${visitRegister.applyId}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">联系地址</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="contactAddress" name ="contactAddress" placeholder="联系地址"
|
||||
value="${visitRegister.contactAddress}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*领队名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="leaderName" name ="leaderName" placeholder="领队名称"
|
||||
value="${visitRegister.leaderName}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*联系方式</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="contactInformation" name ="contactInformation" placeholder="联系方式"
|
||||
value="${visitRegister.contactInformation}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*参观时间</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="visitTime" name ="visitTime" placeholder="参观时间" readonly
|
||||
value="${visitRegister.visitTime.substring(0,10)}"/>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*参观人数</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="visitorsNumber" name ="visitorsNumber" placeholder="参观人数"
|
||||
value="${visitRegister.visitorsNumber}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">参观用时</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="visitDuration" name ="visitDuration" placeholder="参观用时"
|
||||
value="${visitRegister.visitDuration}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">状态</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">新建</p>
|
||||
<input id="state" name="state" type="hidden" value="${START}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*接待人</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="receptionistMan" name ="receptionistMan" placeholder="请选择接待人" readonly
|
||||
onclick="showUser4SelectsFun('receptionist','receptionistMan');" value="${cu.caption}">
|
||||
<input id="receptionist" name="receptionist" type="hidden" value="${cu.id}" />
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">审核人</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="auditMan" name ="auditMan" placeholder="请选择审核人" readonly
|
||||
onclick="showUser4SelectsFun('auditManId','auditMan');" value="${visitRegister.auditMan}">
|
||||
<input id="auditManId" name="auditManId" type="hidden" value="${visitRegister.auditManId}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">参观内容</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="5" id ="purposeContent" name ="purposeContent"
|
||||
placeholder="参观内容">${visitRegister.purposeContent}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="remark" name ="remark" placeholder="备注...">${visitRegister.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_update">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
331
WebRoot/jsp/visit/visitRegisterAudit.jsp
Normal file
331
WebRoot/jsp/visit/visitRegisterAudit.jsp
Normal file
@ -0,0 +1,331 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@page import="com.sipai.entity.visit.VisitCommString"%>
|
||||
<%request.setAttribute("START", VisitCommString.STATUS_VISIT_START); %>
|
||||
<%request.setAttribute("AUDIT", VisitCommString.STATUS_VISIT_AUDIT); %>
|
||||
<%request.setAttribute("REJECT", VisitCommString.STATUS_VISIT_REJECT); %>
|
||||
<%request.setAttribute("EXECUTE", VisitCommString.STATUS_VISIT_EXECUTE); %>
|
||||
<%request.setAttribute("FINISH", VisitCommString.STATUS_VISIT_FINISH); %>
|
||||
<%request.setAttribute("REVOKE", VisitCommString.STATUS_VISIT_REVOKE); %>
|
||||
<%request.setAttribute("VISIT", VisitCommString.STATUS_VISIT); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
//流程审核文件上传所需参数
|
||||
var masterId_process = '${visitRegister.id}';//业务Id
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
var nameSpace_process ='ProcessUploadFile';//保存文件夹
|
||||
var status = 'delete';//有删除权限
|
||||
|
||||
function doSubmit() {
|
||||
$('#subForm').data('bootstrapValidator')
|
||||
.updateStatus('targetUsersName', 'NOT_VALIDATED',null)
|
||||
.validateField('targetUsersName');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码 */
|
||||
var passstatus = $("#passstatus").val();
|
||||
if(passstatus!=0){
|
||||
var commentator = $("#commentator").val();
|
||||
if(commentator!='' && commentator!=null){
|
||||
|
||||
}
|
||||
else{
|
||||
showAlert('d','请配置讲解人。');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$.post(ext.contextPath + "/visit/visitRegister/doAudit.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','操作执行失败,请重试');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
var showUser4SelectsFun1 = function(hiddenId,textId) {
|
||||
var userIds= $("#"+hiddenId).val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {formId:"subForm",hiddenId:hiddenId,textId:textId,userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= $("#targetusers").val();
|
||||
var jobIds= $("#targetjobs").val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {formId:"subForm",hiddenId:"targetusers",textId:"targetUsersName",userIds:userIds,jobIds:jobIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
$(function(){
|
||||
//初始化选择框,方法在workflow.js里
|
||||
processSelectNode("${businessUnitAudit.taskid}");
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
targetUsersName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '人员不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
$('#table_Detail').bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/visit/visitVisitors/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
showFooter: false,//添加页脚
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
applyID: $('#applyId').val(),
|
||||
}
|
||||
},
|
||||
sortName: 'morder', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'morder', // 返回json数据中的name
|
||||
title: '序号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'fullName', // 返回json数据中的name
|
||||
title: '姓名', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'gender', // 返回json数据中的name
|
||||
title: '性别', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'age', // 返回json数据中的name
|
||||
title: '年龄', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'contactInformation', // 返回json数据中的name
|
||||
title: '联系电话', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'state', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter:function (value, row, index){
|
||||
var res = value;
|
||||
switch(res)
|
||||
{
|
||||
case 0:
|
||||
res = '未登记';
|
||||
break;
|
||||
case 1:
|
||||
res = '已登记';
|
||||
break;
|
||||
default:
|
||||
res = '异常';
|
||||
}
|
||||
return res;
|
||||
}
|
||||
},{
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_Detail");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
//显示流程详情
|
||||
var id = '${visitRegister.id}';
|
||||
$.post(ext.contextPath + '/visit/visitRegister/showExecuteView.do', {id:id,inModal:'inModal'} , function(data) {
|
||||
$("#showView").html(data);
|
||||
});
|
||||
})
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-xlg">
|
||||
<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">入库登记(${taskName})</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-7 col-xs-12">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" enctype="multipart/form-data" >
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input id="visitRegisterid" name="visitRegisterid" type="hidden" value="${visitRegister.id}"/>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">编号</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${visitRegister.number}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">填表日期</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${visitRegister.insdt.substring(0,10)}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">参观单位</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${visitRegister.visitUnits}</p>
|
||||
<input type="hidden" id="applyId" name ="applyId" value="${visitRegister.applyId}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">联系地址</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${visitRegister.contactAddress}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">领队名称</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${visitRegister.leaderName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">联系方式</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${visitRegister.contactInformation}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">参观时间</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${visitRegister.visitTime.substring(0,10)}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">参观人数</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${visitRegister.visitorsNumber}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">参观用时</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${visitRegister.visitDuration}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">状态</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${visitRegister.stateName}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">接待人</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${visitRegister.receptionistName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*讲解人</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="commentatorName" name ="commentatorName" placeholder="请选择讲解人" readonly
|
||||
onclick="showUser4SelectsFun1('commentator','commentatorName');" value="${visitRegister.commentatorName}">
|
||||
<input id="commentator" name="commentator" type="hidden" value="${visitRegister.commentator}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">参观内容</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${visitRegister.purposeContent}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${visitRegister.remark}</p>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" class="form-control" name ="id" value="${businessUnitAudit.id}">
|
||||
<input type="hidden" class="form-control" name ="processid" value="${businessUnitAudit.processid}">
|
||||
<input type="hidden" class="form-control" name ="taskid" value="${businessUnitAudit.taskid}">
|
||||
<input type="hidden" class="form-control" name ="businessid" value="${businessUnitAudit.businessid}">
|
||||
<input type="hidden" class="form-control" name =unitid value="${param.unitId}">
|
||||
<input type="hidden" class="form-control" name ="taskdefinitionkey" value="${businessUnitAudit.taskdefinitionkey}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*审核结果</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="passstatus" name ="passstatus" style="width: 100%;">
|
||||
<option value= true>通过</option>
|
||||
<option value= false>驳回</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*下一节点</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="routeNum" name ="routeNum" style="width: 100%;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">审核意见</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="auditopinion" name ="auditopinion" placeholder="审核意见">通过</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div id = "selectUsers" class="form-group">
|
||||
<label class="col-sm-2 control-label">转至:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="targetUsersName" name ="targetUsersName" placeholder="下一级人员" onclick="showUser4SelectsFun();" >
|
||||
<input id="targetusers" name="targetusers" type="hidden" value=""/>
|
||||
<input class="form-control" id="targetjobs" name="targetjobs" type="hidden" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="box box-primary" style="margin-top:20px">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">参观人员信息</h3>
|
||||
<div class="box-tools pull-right">
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_Detail"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5 col-xs-12" id="showView">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doSubmit()" id="btn_update">审核</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
456
WebRoot/jsp/visit/visitRegisterEdit.jsp
Normal file
456
WebRoot/jsp/visit/visitRegisterEdit.jsp
Normal file
@ -0,0 +1,456 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@page import="com.sipai.entity.visit.VisitCommString"%>
|
||||
<%request.setAttribute("START", VisitCommString.STATUS_VISIT_START); %>
|
||||
<%request.setAttribute("AUDIT", VisitCommString.STATUS_VISIT_AUDIT); %>
|
||||
<%request.setAttribute("REJECT", VisitCommString.STATUS_VISIT_REJECT); %>
|
||||
<%request.setAttribute("EXECUTE", VisitCommString.STATUS_VISIT_EXECUTE); %>
|
||||
<%request.setAttribute("FINISH", VisitCommString.STATUS_VISIT_FINISH); %>
|
||||
<%request.setAttribute("REVOKE", VisitCommString.STATUS_VISIT_REVOKE); %>
|
||||
<%request.setAttribute("VISIT", VisitCommString.STATUS_VISIT); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doupdate() {
|
||||
if($("#unitId").val()==null || $("#unitId").val()==''){
|
||||
$("#unitId").val(unitId);
|
||||
}
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/visit/visitRegister/update.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
number: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '编号不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
visitUnits: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '参观单位不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
leaderName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '领队名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
contactInformation: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '联系方式不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
visitTime: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '参观时间不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
insdt: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '填表时间不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
visitorsNumber: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '参观人数不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
receptionist: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '接待人不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
var showUser4SelectsFun = function(hiddenId,textId) {
|
||||
var userIds= $("#"+hiddenId).val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {formId:"subForm",hiddenId:hiddenId,textId:textId,userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
//提交时先验证审核人不能为空,保存时审核人可以为空
|
||||
function submitFun(){
|
||||
//新增的输入框添加验证
|
||||
$("#subForm").data('bootstrapValidator').addField('auditMan',{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '审核人不能为空'
|
||||
},
|
||||
}
|
||||
});
|
||||
dosubmit();
|
||||
}
|
||||
|
||||
function dosubmit(){
|
||||
$("#state").val('${AUDIT}');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/visit/visitRegister/startProcess.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 2){
|
||||
showAlert('d','未检测到审核流程,请先部署流程!');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
var addDetailFun = function() {
|
||||
var applyId = $("#id").val();
|
||||
$.post(ext.contextPath + '/visit/visitVisitors/doadd.do',{applyId:applyId},
|
||||
function(data) {
|
||||
$("#subDetailDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
}
|
||||
|
||||
var deletesDetailFun = function(id) {
|
||||
var datas="";
|
||||
if(id!=null && id!=undefined && id!=''){
|
||||
datas = id;
|
||||
}else{
|
||||
var checkedItems = $("#table_Detail").bootstrapTable('getSelections');
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
}
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','alertDiv');
|
||||
}else{
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/visit/visitVisitors/dodeletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','alertDiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var showApply4Select = function(hiddenId) {
|
||||
var userIds= $("#"+hiddenId).val();
|
||||
$.post(ext.contextPath + '/visit/visitApply/visitApply4Select.do', {formId:"subForm",hiddenId:hiddenId} , function(data) {
|
||||
$("#apply4SelectDiv").html(data);
|
||||
openModal("apply4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
var dosearchDetail = function() {
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
};
|
||||
$(function(){
|
||||
$("#visitTime").datetimepicker({
|
||||
language: 'zh-CN',
|
||||
format: 'yyyy-mm-dd',
|
||||
startView: "month", //初始化视图
|
||||
minView: 2,
|
||||
maxView: "year",
|
||||
todayBtn: true,
|
||||
clearBtn: true,
|
||||
autoclose: true,
|
||||
todayHighlight: 1,//今天高亮
|
||||
endDate: new Date(),
|
||||
})
|
||||
|
||||
$("#insdt").datetimepicker({
|
||||
language: 'zh-CN',
|
||||
format: 'yyyy-mm-dd',
|
||||
startView: "month", //初始化视图
|
||||
minView: 2,
|
||||
maxView: "year",
|
||||
todayBtn: true,
|
||||
clearBtn: true,
|
||||
autoclose: true,
|
||||
todayHighlight: 1,//今天高亮
|
||||
endDate: new Date(),
|
||||
})
|
||||
$('#table_Detail').bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/visit/visitVisitors/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
showFooter: false,//添加页脚
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
applyID: $('#applyId').val(),
|
||||
}
|
||||
},
|
||||
sortName: 'morder', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'morder', // 返回json数据中的name
|
||||
title: '序号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'fullName', // 返回json数据中的name
|
||||
title: '姓名', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'gender', // 返回json数据中的name
|
||||
title: '性别', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'age', // 返回json数据中的name
|
||||
title: '年龄', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'contactInformation', // 返回json数据中的name
|
||||
title: '联系电话', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'state', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter:function (value, row, index){
|
||||
var res = value;
|
||||
switch(res)
|
||||
{
|
||||
case 0:
|
||||
res = '未登记';
|
||||
break;
|
||||
case 1:
|
||||
res = '已登记';
|
||||
break;
|
||||
default:
|
||||
res = '异常';
|
||||
}
|
||||
return res;
|
||||
}
|
||||
},{
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_Detail");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<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">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input id="id" name="id" type="hidden" value="${visitRegister.id}"/>
|
||||
<input id="unitId" name="unitId" type="hidden" value="${visitRegister.unitId}"/>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*编号</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="number" name ="number" placeholder="编号"
|
||||
value="${visitRegister.number}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*填表日期</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="insdt" name ="insdt" placeholder="填表日期" readonly
|
||||
value="${visitRegister.insdt.substring(0,10)}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*参观单位</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="visitUnits" name ="visitUnits" placeholder="参观单位" readonly
|
||||
onclick="showApply4Select('applyId');" value="${visitRegister.visitUnits}"/>
|
||||
<input type="hidden" id="applyId" name ="applyId" value="${visitRegister.applyId}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">联系地址</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="contactAddress" name ="contactAddress" placeholder="联系地址"
|
||||
value="${visitRegister.contactAddress}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*领队名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="leaderName" name ="leaderName" placeholder="领队名称"
|
||||
value="${visitRegister.leaderName}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*联系方式</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="contactInformation" name ="contactInformation" placeholder="联系方式"
|
||||
value="${visitRegister.contactInformation}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*参观时间</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="visitTime" name ="visitTime" placeholder="参观时间" readonly
|
||||
value="${visitRegister.visitTime.substring(0,10)}"/>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*参观人数</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="visitorsNumber" name ="visitorsNumber" placeholder="参观人数"
|
||||
value="${visitRegister.visitorsNumber}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">参观用时</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="visitDuration" name ="visitDuration" placeholder="参观用时"
|
||||
value="${visitRegister.visitDuration}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">状态</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${visitRegister.stateName}</p>
|
||||
<input id="state" name="state" type="hidden" value="${visitRegister.state}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*接待人</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="receptionistName" name ="receptionistName" placeholder="请选择接待人" readonly
|
||||
onclick="showUser4SelectsFun('receptionist','receptionistName');" value="${visitRegister.receptionistName}">
|
||||
<input id="receptionist" name="receptionist" type="hidden" value="${visitRegister.receptionist}" />
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">审核人</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="auditMan" name ="auditMan" placeholder="请选择审核人" readonly
|
||||
onclick="showUser4SelectsFun('auditManId','auditMan');" value="${visitRegister.auditMan}">
|
||||
<input id="auditManId" name="auditManId" type="hidden" value="${visitRegister.auditManId}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">参观内容</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="5" id ="purposeContent" name ="purposeContent"
|
||||
placeholder="参观内容">${visitRegister.purposeContent}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="remark" name ="remark" placeholder="备注...">${visitRegister.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="box box-primary" style="margin-top:20px">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">参观人员信息</h3>
|
||||
<div class="box-tools pull-right">
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_Detail"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-info" onclick="submitFun()" id="btn_submit">提交审核</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_update">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
505
WebRoot/jsp/visit/visitRegisterEditForApply.jsp
Normal file
505
WebRoot/jsp/visit/visitRegisterEditForApply.jsp
Normal file
@ -0,0 +1,505 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.visit.VisitCommString"%>
|
||||
<%request.setAttribute("START", VisitCommString.STATUS_VISIT_START); %>
|
||||
<%request.setAttribute("AUDIT", VisitCommString.STATUS_VISIT_AUDIT); %>
|
||||
<%request.setAttribute("REJECT", VisitCommString.STATUS_VISIT_REJECT); %>
|
||||
<%request.setAttribute("EXECUTE", VisitCommString.STATUS_VISIT_EXECUTE); %>
|
||||
<%request.setAttribute("FINISH", VisitCommString.STATUS_VISIT_FINISH); %>
|
||||
<%request.setAttribute("REVOKE", VisitCommString.STATUS_VISIT_REVOKE); %>
|
||||
<%request.setAttribute("VISIT", VisitCommString.STATUS_VISIT); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
//流程审核文件上传所需参数
|
||||
var masterId_process = '${visitRegister.id}';//业务Id
|
||||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||||
var nameSpace_process ='ProcessUploadFile';//保存文件夹
|
||||
var status = 'delete';//有删除权限
|
||||
function doupdate() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/visit/visitRegister/update.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
number: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '编号不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
visitUnits: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '参观单位不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
leaderName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '领队名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
contactInformation: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '联系方式不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
visitTime: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '参观时间不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
insdt: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '填表时间不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
visitorsNumber: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '参观人数不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
receptionist: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '接待人不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
var showUser4SelectsFun1 = function(hiddenId,textId) {
|
||||
var userIds= $("#"+hiddenId).val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {formId:"subForm",hiddenId:hiddenId,textId:textId,userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= $("#targetusers").val();
|
||||
var jobIds= $("#targetjobs").val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {formId:"subUnitForm",hiddenId:"targetusers",textId:"targetUsersName",userIds:userIds,jobIds:jobIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
//提交时先验证审核人不能为空,保存时审核人可以为空
|
||||
function submitFun(){
|
||||
//新增的输入框添加验证
|
||||
$("#subForm").data('bootstrapValidator').addField('auditMan',{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '审核人不能为空'
|
||||
},
|
||||
}
|
||||
});
|
||||
dosubmit();
|
||||
}
|
||||
|
||||
function dosubmit(){
|
||||
$('#auditManId').val($('#targetusers').val());
|
||||
$('#subUnitForm').data('bootstrapValidator')
|
||||
.updateStatus('targetUsersName', 'NOT_VALIDATED',null)
|
||||
.validateField('targetUsersName');
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
$("#subUnitForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid() && $("#subUnitForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/visit/visitRegister/update.do", $("#subForm").serialize(), function(data) {
|
||||
var routeNum = $("#routeNum").val();
|
||||
if (data.res == 1){
|
||||
$.post(ext.contextPath + "/visit/visitRegister/doHandleApply.do", $("#subUnitForm").serialize()+"&routeNum="+routeNum, function(unitdata) {
|
||||
if (unitdata.res == 1) {
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else if(unitdata.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
var addDetailFun = function() {
|
||||
var applyId = $("#id").val();
|
||||
$.post(ext.contextPath + '/visit/visitVisitors/doadd.do',{applyId:applyId},
|
||||
function(data) {
|
||||
$("#subDetailDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
}
|
||||
|
||||
var deletesDetailFun = function(id) {
|
||||
var datas="";
|
||||
if(id!=null && id!=undefined && id!=''){
|
||||
datas = id;
|
||||
}else{
|
||||
var checkedItems = $("#table_Detail").bootstrapTable('getSelections');
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
}
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','alertDiv');
|
||||
}else{
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/visit/visitVisitors/dodeletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','alertDiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosearchDetail = function() {
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
};
|
||||
$(function(){
|
||||
//初始化选择框,方法在workflow.js里
|
||||
processSelectNodeForHandle("${businessUnitHandle.taskid}");
|
||||
$("#visitTime").datetimepicker({
|
||||
language: 'zh-CN',
|
||||
format: 'yyyy-mm-dd',
|
||||
startView: "month", //初始化视图
|
||||
minView: 2,
|
||||
maxView: "year",
|
||||
todayBtn: true,
|
||||
clearBtn: true,
|
||||
autoclose: true,
|
||||
todayHighlight: 1,//今天高亮
|
||||
endDate: new Date(),
|
||||
})
|
||||
|
||||
$("#insdt").datetimepicker({
|
||||
language: 'zh-CN',
|
||||
format: 'yyyy-mm-dd',
|
||||
startView: "month", //初始化视图
|
||||
minView: 2,
|
||||
maxView: "year",
|
||||
todayBtn: true,
|
||||
clearBtn: true,
|
||||
autoclose: true,
|
||||
todayHighlight: 1,//今天高亮
|
||||
endDate: new Date(),
|
||||
})
|
||||
$('#table_Detail').bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/visit/visitVisitors/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
showFooter: false,//添加页脚
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
applyID: $('#applyId').val(),
|
||||
}
|
||||
},
|
||||
sortName: 'morder', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'morder', // 返回json数据中的name
|
||||
title: '序号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'fullName', // 返回json数据中的name
|
||||
title: '姓名', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'gender', // 返回json数据中的name
|
||||
title: '性别', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'age', // 返回json数据中的name
|
||||
title: '年龄', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'contactInformation', // 返回json数据中的name
|
||||
title: '联系电话', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'state', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter:function (value, row, index){
|
||||
var res = value;
|
||||
switch(res)
|
||||
{
|
||||
case 0:
|
||||
res = '未登记';
|
||||
break;
|
||||
case 1:
|
||||
res = '已登记';
|
||||
break;
|
||||
default:
|
||||
res = '异常';
|
||||
}
|
||||
return res;
|
||||
}
|
||||
},{
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_Detail");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
//显示流程详情
|
||||
var id = '${visitRegister.id}';
|
||||
$.post(ext.contextPath + '/visit/visitRegister/showExecuteView.do', {id:id,inModal:'inModal'} , function(data) {
|
||||
$("#showView").html(data);
|
||||
});
|
||||
})
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-xlg">
|
||||
<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-7 col-xs-12">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input id="id" name="id" type="hidden" value="${visitRegister.id}"/>
|
||||
<input id="unitId" name="unitId" type="hidden" value="${visitRegister.unitId}"/>
|
||||
<input id="auditManId" name="auditManId" type="hidden" value="${visitRegister.auditManId}" />
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*编号</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="number" name ="number" placeholder="编号"
|
||||
value="${visitRegister.number}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*填表日期</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="insdt" name ="insdt" placeholder="填表日期" readonly
|
||||
value="${visitRegister.insdt.substring(0,10)}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*参观单位</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="visitUnits" name ="visitUnits" placeholder="参观单位" readonly
|
||||
onclick="showApply4Select('applyId');" value="${visitRegister.visitUnits}"/>
|
||||
<input type="hidden" id="applyId" name ="applyId" value="${visitRegister.applyId}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">联系地址</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="contactAddress" name ="contactAddress" placeholder="联系地址"
|
||||
value="${visitRegister.contactAddress}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*领队名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="leaderName" name ="leaderName" placeholder="领队名称"
|
||||
value="${visitRegister.leaderName}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*联系方式</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="contactInformation" name ="contactInformation" placeholder="联系方式"
|
||||
value="${visitRegister.contactInformation}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*参观时间</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group date">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="visitTime" name ="visitTime" placeholder="参观时间" readonly
|
||||
value="${visitRegister.visitTime.substring(0,10)}"/>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*参观人数</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="visitorsNumber" name ="visitorsNumber" placeholder="参观人数"
|
||||
value="${visitRegister.visitorsNumber}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">参观用时</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="visitDuration" name ="visitDuration" placeholder="参观用时"
|
||||
value="${visitRegister.visitDuration}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">状态</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${visitRegister.stateName}</p>
|
||||
<input id="state" name="state" type="hidden" value="${visitRegister.state}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*接待人</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="receptionistName" name ="receptionistName" placeholder="请选择接待人" readonly
|
||||
onclick="showUser4SelectsFun1('receptionist','receptionistName');" value="${visitRegister.receptionistName}">
|
||||
<input id="receptionist" name="receptionist" type="hidden" value="${visitRegister.receptionist}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">参观内容</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="5" id ="purposeContent" name ="purposeContent"
|
||||
placeholder="参观内容">${visitRegister.purposeContent}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="remark" name ="remark" placeholder="备注...">${visitRegister.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form class="form-horizontal" id="subUnitForm" enctype="multipart/form-data" >
|
||||
<input type="hidden" class="form-control" name ="id" value="${businessUnitHandle.id}">
|
||||
<input type="hidden" class="form-control" name ="processid" value="${businessUnitHandle.processid}">
|
||||
<input type="hidden" class="form-control" name ="taskid" value="${businessUnitHandle.taskid}">
|
||||
<input type="hidden" class="form-control" name ="businessid" value="${businessUnitHandle.businessid}">
|
||||
<input type="hidden" class="form-control" name ="taskdefinitionkey" value="${businessUnitHandle.taskdefinitionkey}">
|
||||
<c:if test='${not empty rejectReson }'>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">调整说明:</label>
|
||||
<div class="col-sm-9">
|
||||
<textarea class="form-control " id="auditopinion" name="auditopinion" rows="2" placeholder="调整说明" >${rejectReson}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*下一节点</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control select2" id="routeNum" name ="routeNum" style="width: 270px;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div id = "selectUsers" class="form-group">
|
||||
<label class="col-sm-3 control-label">提交至:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="targetUsersName" name ="targetUsersName" placeholder="下一级人员" onclick="showUser4SelectsFun();" >
|
||||
<input id="targetusers" name="targetusers" type="hidden" value="${businessUnitHandle.targetusers}"/>
|
||||
<input class="form-control" id="targetjobs" name="targetjobs" type="hidden" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="box box-primary" style="margin-top:20px">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">参观人员信息</h3>
|
||||
<div class="box-tools pull-right">
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_Detail"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5 col-xs-12" id="showView">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosubmit()" id="btn_submit">提交审核</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
339
WebRoot/jsp/visit/visitRegisterList.jsp
Normal file
339
WebRoot/jsp/visit/visitRegisterList.jsp
Normal file
@ -0,0 +1,339 @@
|
||||
<%@ 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"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@page import="com.sipai.entity.visit.VisitCommString"%>
|
||||
<%request.setAttribute("START", VisitCommString.STATUS_VISIT_START); %>
|
||||
<%request.setAttribute("AUDIT", VisitCommString.STATUS_VISIT_AUDIT); %>
|
||||
<%request.setAttribute("REJECT", VisitCommString.STATUS_VISIT_REJECT); %>
|
||||
<%request.setAttribute("EXECUTE", VisitCommString.STATUS_VISIT_EXECUTE); %>
|
||||
<%request.setAttribute("FINISH", VisitCommString.STATUS_VISIT_FINISH); %>
|
||||
<%request.setAttribute("REVOKE", VisitCommString.STATUS_VISIT_REVOKE); %>
|
||||
<%request.setAttribute("VISIT", VisitCommString.STATUS_VISIT); %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
|
||||
<!--bootstrap-edittable 表格行内编辑 -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-editable/css/bootstrap-editable.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-editable.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-table-editable.js" charset="utf-8"></script>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var addFun = function() {
|
||||
$.post(ext.contextPath + '/visit/visitRegister/add.do', {companyId : companyId} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/visit/visitRegister/edit.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var visitEnd = function(id){
|
||||
$.post(ext.contextPath + '/visit/visitRegister/visitEnd.do', {id:id} , function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','结束失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
};
|
||||
var viewFun = function(id){
|
||||
$.post(ext.contextPath + '/visit/visitRegister/view.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(willDelete =>{
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/visit/visitRegister/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
if(item.state == '${START}'){
|
||||
datas+=item.id+",";
|
||||
}
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}else{
|
||||
swal({
|
||||
text: "您确定要删除选中记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/visit/visitRegister/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function() {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var companyId = "";
|
||||
$(function() {
|
||||
companyId = unitId;
|
||||
initFun();
|
||||
});
|
||||
|
||||
var initFun = function(){
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/visit/visitRegister/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val(),
|
||||
search_code: companyId
|
||||
}
|
||||
},
|
||||
sortName: 'visit_time', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
formatter: function (value, row, index) {
|
||||
if (row.state == '${START}') {
|
||||
return {disabled: false,}
|
||||
} else {
|
||||
return {disabled: true,}
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'number', // 返回json数据中的name
|
||||
title: '编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
|
||||
},{
|
||||
field: 'insdt', // 返回json数据中的name
|
||||
title: '建表时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter:function (value, row, index){
|
||||
return value.substring(0,10);
|
||||
}
|
||||
},{
|
||||
field: 'visitUnits', // 返回json数据中的name
|
||||
title: '参观单位', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'leaderName', // 返回json数据中的name
|
||||
title: '领队名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'visitTime', // 返回json数据中的name
|
||||
title: '参观时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter:function (value, row, index){
|
||||
return value.substring(0,10);
|
||||
}
|
||||
},{
|
||||
field: 'receptionistName', // 返回json数据中的name
|
||||
title: '接待人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'auditMan', // 返回json数据中的name
|
||||
title: '审核人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'commentatorName', // 返回json数据中的name
|
||||
title: '讲解人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'stateName', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',// 上下居中
|
||||
},{
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts= '';
|
||||
if(row.state=='${START}'){
|
||||
buts+= '<security:authorize buttonUrl="visit/visitRegister/edit.do">';
|
||||
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>>';
|
||||
buts+= '</security:authorize>';
|
||||
buts+= '<security:authorize buttonUrl="visit/visitRegister/delete.do">';
|
||||
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\''+row.id+'\')"><i class="fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button>';
|
||||
buts+= '</security:authorize>';
|
||||
}else{
|
||||
buts+= '<security:authorize buttonUrl="visit/visitRegister/visitEnd.do">';
|
||||
buts+='<button class="btn btn-default btn-sm" title="参观结束" onclick="visitEnd(\''+row.id+'\')"><i class="fa fa-star"></i><span class="hidden-md hidden-lg">参观结束</span></button>';
|
||||
buts+= '</security:authorize>';
|
||||
buts+= '<security:authorize buttonUrl="visit/visitRegister/view.do">';
|
||||
buts+='<button class="btn btn-default btn-sm" title="查看" onclick="viewFun(\''+row.id+'\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg">查看</span></button>';
|
||||
buts+= '</security:authorize>';
|
||||
}
|
||||
|
||||
buts='<div class="btn-group" >'+buts+'</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//导入
|
||||
function importFun(){
|
||||
$.post(ext.contextPath + '/visit/visitRegister/importVisitApply.do' , function(data) {
|
||||
$("#importDiv").html(data);
|
||||
openModal('importModal');
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div id="importDiv"></div>
|
||||
<div id="templateDiv"></div>
|
||||
<div id="apply4SelectDiv"></div>
|
||||
<div >
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="visit/visitRegister/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
</security:authorize>
|
||||
<security:authorize buttonUrl="visit/visitRegister/delete.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button>
|
||||
</security:authorize>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline" >
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="公司、领队名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
231
WebRoot/jsp/visit/visitRegisterView.jsp
Normal file
231
WebRoot/jsp/visit/visitRegisterView.jsp
Normal file
@ -0,0 +1,231 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@page import="com.sipai.entity.visit.VisitCommString"%>
|
||||
<%request.setAttribute("START", VisitCommString.STATUS_VISIT_START); %>
|
||||
<%request.setAttribute("AUDIT", VisitCommString.STATUS_VISIT_AUDIT); %>
|
||||
<%request.setAttribute("REJECT", VisitCommString.STATUS_VISIT_REJECT); %>
|
||||
<%request.setAttribute("EXECUTE", VisitCommString.STATUS_VISIT_EXECUTE); %>
|
||||
<%request.setAttribute("FINISH", VisitCommString.STATUS_VISIT_FINISH); %>
|
||||
<%request.setAttribute("REVOKE", VisitCommString.STATUS_VISIT_REVOKE); %>
|
||||
<%request.setAttribute("VISIT", VisitCommString.STATUS_VISIT); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function(){
|
||||
|
||||
$('#table_Detail').bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/visit/visitVisitors/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
showFooter: false,//添加页脚
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
applyID: $('#applyId').val(),
|
||||
}
|
||||
},
|
||||
sortName: 'morder', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'morder', // 返回json数据中的name
|
||||
title: '序号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'fullName', // 返回json数据中的name
|
||||
title: '姓名', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'gender', // 返回json数据中的name
|
||||
title: '性别', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'age', // 返回json数据中的name
|
||||
title: '年龄', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'contactInformation', // 返回json数据中的name
|
||||
title: '联系电话', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},{
|
||||
field: 'state', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter:function (value, row, index){
|
||||
var res = value;
|
||||
switch(res)
|
||||
{
|
||||
case 0:
|
||||
res = '未登记';
|
||||
break;
|
||||
case 1:
|
||||
res = '已登记';
|
||||
break;
|
||||
default:
|
||||
res = '异常';
|
||||
}
|
||||
return res;
|
||||
}
|
||||
},{
|
||||
field: 'remark', // 返回json数据中的name
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_Detail");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
//显示流程详情
|
||||
var id = $("#id").val();
|
||||
$.post(ext.contextPath + '/visit/visitRegister/showExecuteView.do', {id:id,inModal:'inModal'} , function(data) {
|
||||
$("#showView").html(data);
|
||||
});
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-xlg">
|
||||
<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-7 col-xs-12">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input id="id" name="id" type="hidden" value="${visitRegister.id}"/>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input id="visitRegisterid" name="visitRegisterid" type="hidden" value="${visitRegister.id}"/>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">编号</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${visitRegister.number}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">填表日期</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${visitRegister.insdt.substring(0,10)}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">参观单位</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${visitRegister.visitUnits}</p>
|
||||
<input type="hidden" id="applyId" name ="applyId" value="${visitRegister.applyId}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">联系地址</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${visitRegister.contactAddress}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">领队名称</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${visitRegister.leaderName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">联系方式</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${visitRegister.contactInformation}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">参观时间</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${visitRegister.visitTime.substring(0,10)}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">参观人数</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${visitRegister.visitorsNumber}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">参观用时</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${visitRegister.visitDuration}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">状态</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${visitRegister.stateName}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">接待人</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${visitRegister.receptionistName}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">讲解人</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${visitRegister.commentatorName}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">参观内容</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${visitRegister.purposeContent}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${visitRegister.remark}</p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="box box-primary" style="margin-top:20px">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">参观人员信息</h3>
|
||||
<div class="box-tools pull-right">
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_Detail"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5 col-xs-12" id="showView">
|
||||
</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>
|
||||
144
WebRoot/jsp/visit/visitSafetyCommitmentAdd.jsp
Normal file
144
WebRoot/jsp/visit/visitSafetyCommitmentAdd.jsp
Normal file
@ -0,0 +1,144 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
const E = window.wangEditor;
|
||||
const editor = new E('#editor');
|
||||
$(function () {
|
||||
/*
|
||||
* wangEditor富文本初始化
|
||||
*/
|
||||
//设置高度
|
||||
var div3 = document.getElementById('editor');
|
||||
editor.config.height = div3.clientHeight - 120;
|
||||
//取消自动 focus
|
||||
editor.config.focus = false
|
||||
// 配置全屏功能按钮是否展示
|
||||
editor.config.showFullScreen = true
|
||||
// 隐藏菜单栏提示
|
||||
editor.config.showMenuTooltips = false
|
||||
// 配置 onchange 回调函数
|
||||
editor.config.onchange = function (newHtml) {
|
||||
//console.log('change 之后最新的 html', newHtml)
|
||||
}
|
||||
// 配置触发 onchange 的时间频率,默认为 200ms
|
||||
editor.config.onchangeTimeout = 500 // 修改为 500ms
|
||||
|
||||
//图片上传
|
||||
editor.config.uploadFileName = 'myFile'; //设置文件上传的参数名称
|
||||
editor.config.uploadImgServer = ext.contextPath + "/command/emergencyConfigure/upload4WangEditor.do";
|
||||
editor.config.uploadImgAccept = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp']// 图片格式限制
|
||||
editor.config.uploadImgMaxSize = 10 * 1024 * 1024 // 图片大小限制10M
|
||||
editor.config.uploadImgMaxLength = 1; // 一次最多上传 1 个图片
|
||||
|
||||
editor.create();
|
||||
|
||||
editor.config.pasteTextHandle = function (content) {
|
||||
// content 即粘贴过来的内容(html 或 纯文本),可进行自定义处理然后返回
|
||||
if (content == '' && !content) return ''
|
||||
var str = content
|
||||
str = str.replace(/<xml>[\s\S]*?<\/xml>/ig, '')
|
||||
str = str.replace(/<style>[\s\S]*?<\/style>/ig, '')
|
||||
str = str.replace(/<\/?[^>]*>/g, '')
|
||||
str = str.replace(/[ | ]*\n/g, '\n')
|
||||
str = str.replace(/' '/g, '')
|
||||
str = str.replace(/':'/g, ':')
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
editor.txt.html('${visitSafetyCommitment.content}') // 重新设置编辑器内容
|
||||
|
||||
editor.config.uploadImgHooks = {
|
||||
customInsert: function (insertImgFn, result) {
|
||||
// result 即服务端返回的接口
|
||||
//console.log('customInsert', result)
|
||||
// insertImgFn 可把图片插入到编辑器,传入图片 src ,执行函数即可
|
||||
insertImgFn(result.data[0])
|
||||
}
|
||||
}
|
||||
});
|
||||
function dosave() {
|
||||
var editorText = editor.txt.html();
|
||||
$("#content").val(editorText);
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
||||
//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/visit/visitSafetyCommitment/dosave.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal("subModal");
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<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">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" autocomplete="off">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" name="id" id="id" value="${visitSafetyCommitment.id}" />
|
||||
<textarea class="form-control hidden" id ="content" name ="content">${visitSafetyCommitment.content}</textarea>
|
||||
<input type="hidden" name="unitId" id="unitId" value="${param.unitId}" />
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*人群类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="edition"
|
||||
name="edition" style="width: 100%;">
|
||||
<option value="adult">成人</option>
|
||||
<option value="children">青少年</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*启用状态</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="state"
|
||||
name="state" style="width: 100%;">
|
||||
<option value="1">是</option>
|
||||
<option value="0">否</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">顺序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="morder" name="morder" placeholder="顺序"
|
||||
value="${visitSafetyCommitment.morder}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">说明</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="remark" name="remark" placeholder="说明"
|
||||
value="${visitSafetyCommitment.remark}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12" id="editor" >
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
155
WebRoot/jsp/visit/visitSafetyCommitmentEdit.jsp
Normal file
155
WebRoot/jsp/visit/visitSafetyCommitmentEdit.jsp
Normal file
@ -0,0 +1,155 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
const E = window.wangEditor;
|
||||
const editor = new E('#editor');
|
||||
$(function () {
|
||||
/*
|
||||
* wangEditor富文本初始化
|
||||
*/
|
||||
//设置高度
|
||||
var div3 = document.getElementById('editor');
|
||||
editor.config.height = div3.clientHeight - 120;
|
||||
//取消自动 focus
|
||||
editor.config.focus = false
|
||||
// 配置全屏功能按钮是否展示
|
||||
editor.config.showFullScreen = true
|
||||
// 隐藏菜单栏提示
|
||||
editor.config.showMenuTooltips = false
|
||||
// 配置 onchange 回调函数
|
||||
editor.config.onchange = function (newHtml) {
|
||||
//console.log('change 之后最新的 html', newHtml)
|
||||
}
|
||||
// 配置触发 onchange 的时间频率,默认为 200ms
|
||||
editor.config.onchangeTimeout = 500 // 修改为 500ms
|
||||
|
||||
//图片上传
|
||||
editor.config.uploadFileName = 'myFile'; //设置文件上传的参数名称
|
||||
editor.config.uploadImgServer = ext.contextPath + "/command/emergencyConfigure/upload4WangEditor.do";
|
||||
editor.config.uploadImgAccept = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp']// 图片格式限制
|
||||
editor.config.uploadImgMaxSize = 10 * 1024 * 1024 // 图片大小限制10M
|
||||
editor.config.uploadImgMaxLength = 1; // 一次最多上传 1 个图片
|
||||
|
||||
editor.create();
|
||||
|
||||
editor.config.pasteTextHandle = function (content) {
|
||||
// content 即粘贴过来的内容(html 或 纯文本),可进行自定义处理然后返回
|
||||
if (content == '' && !content) return ''
|
||||
var str = content
|
||||
str = str.replace(/<xml>[\s\S]*?<\/xml>/ig, '')
|
||||
str = str.replace(/<style>[\s\S]*?<\/style>/ig, '')
|
||||
str = str.replace(/<\/?[^>]*>/g, '')
|
||||
str = str.replace(/[ | ]*\n/g, '\n')
|
||||
str = str.replace(/' '/g, '')
|
||||
str = str.replace(/':'/g, ':')
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
editor.txt.html('${visitSafetyCommitment.content}') // 重新设置编辑器内容
|
||||
|
||||
editor.config.uploadImgHooks = {
|
||||
customInsert: function (insertImgFn, result) {
|
||||
// result 即服务端返回的接口
|
||||
//console.log('customInsert', result)
|
||||
// insertImgFn 可把图片插入到编辑器,传入图片 src ,执行函数即可
|
||||
insertImgFn(result.data[0])
|
||||
}
|
||||
}
|
||||
//状态
|
||||
var selelct = $("#state").select2({
|
||||
minimumResultsForSearch: 10
|
||||
});
|
||||
selelct.val('${visitSafetyCommitment.state}').trigger("change");
|
||||
//类型
|
||||
var selelct_edition = $("#edition").select2({
|
||||
minimumResultsForSearch: 10
|
||||
});
|
||||
selelct_edition.val('${visitSafetyCommitment.edition}').trigger("change");
|
||||
});
|
||||
function dosave() {
|
||||
var editorText = editor.txt.html();
|
||||
$("#content").val(editorText);
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
||||
//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/visit/visitSafetyCommitment/doupdate.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal("subModal");
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<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">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm" autocomplete="off">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" name="id" id="id" value="${visitSafetyCommitment.id}" />
|
||||
<textarea class="form-control hidden" id ="content" name ="content">${visitSafetyCommitment.content}</textarea>
|
||||
<input type="hidden" name="unitId" id="unitId" value="${visitSafetyCommitment.unitId}" />
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*人群类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="edition"
|
||||
name="edition" style="width: 100%;">
|
||||
<option value="adult">成人</option>
|
||||
<option value="children">青少年</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*启用状态</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="state"
|
||||
name="state" style="width: 100%;">
|
||||
<option value="1">是</option>
|
||||
<option value="0">否</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">顺序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="morder" name="morder" placeholder="顺序"
|
||||
value="${visitSafetyCommitment.morder}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">说明</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="remark" name="remark" placeholder="说明"
|
||||
value="${visitSafetyCommitment.remark}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12" id="editor" >
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
282
WebRoot/jsp/visit/visitSafetyCommitmentList.jsp
Normal file
282
WebRoot/jsp/visit/visitSafetyCommitmentList.jsp
Normal file
@ -0,0 +1,282 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@ 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"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@page import="com.sipai.entity.visit.VisitSafetyCommitment" %>
|
||||
<%request.setAttribute("ADULT", VisitSafetyCommitment.ADULT); %>
|
||||
<%request.setAttribute("CHILDREN", VisitSafetyCommitment.CHILDREN); %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/wangeditor/wangEditor.min.js"></script>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.table-hover>tbody>tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
var companyId = unitId;
|
||||
$(function () {
|
||||
initFun();
|
||||
});
|
||||
|
||||
function dosearch() {
|
||||
initFun();
|
||||
}
|
||||
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/visit/visitSafetyCommitment/doadd.do', { unitId : companyId }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var editFun = function (id) {
|
||||
$.post(ext.contextPath + '/visit/visitSafetyCommitment/doedit.do', { id: id }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/visit/visitSafetyCommitment/dodelete.do', { id: id }, function (data) {
|
||||
var datajson = JSON.parse(data);
|
||||
if (datajson.code == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/visit/visitSafetyCommitment/dodeletes.do', { ids: datas }, function (data) {
|
||||
if (data.code > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//表格查询参数
|
||||
function queryParamsFun(params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
unitId: companyId,
|
||||
processSectionId: $('#processSectionId').val(),
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//厂区选择后,初始化工艺段,加载表格
|
||||
var initFun = function () {
|
||||
companyId = unitId;
|
||||
// initoverhaulType();
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/visit/visitSafetyCommitment/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
singleSelect: false,//单选多选
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: queryParamsFun,
|
||||
sortName: 'morder', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
//viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'morder', // 返回json数据中的name
|
||||
title: '序号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
},
|
||||
{
|
||||
field: 'edition', // 返回json数据中的name
|
||||
title: '人群类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
if(value=='${ADULT}'){
|
||||
return "成人";
|
||||
}
|
||||
if(value=='${CHILDREN}'){
|
||||
return "青少年";
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'insdt', // 返回json数据中的name
|
||||
title: '创建时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
},
|
||||
{
|
||||
field: 'state', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '80',
|
||||
formatter: function (value, row, index) {
|
||||
if(value==0){
|
||||
return "禁用";
|
||||
}
|
||||
if(value==1){
|
||||
return "启用";
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '120', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<security:authorize buttonUrl="visit/visitSafetyCommitment/edit.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
buts += '<security:authorize buttonUrl="visit/visitSafetyCommitment/delete.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg"> 删除</span></button';
|
||||
buts += '</security:authorize>';
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<!-- <div id="subDiv" style="width: 220px;height:10px;"></div> -->
|
||||
<div id="subDiv"></div>
|
||||
<div id="subDivDetail"></div>
|
||||
<!-- mpSubDiv -->
|
||||
<div id="mpSubDiv"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="visit/visitSafetyCommitment/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i class="fa fa-plus"></i>新增</button>
|
||||
</security:authorize>
|
||||
<security:authorize buttonUrl="visit/visitSafetyCommitment/delete.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i class="fa fa-trash-o"></i>删除</button>
|
||||
</security:authorize>
|
||||
</div>
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
111
WebRoot/jsp/visit/visitVisitorsAdd.jsp
Normal file
111
WebRoot/jsp/visit/visitVisitorsAdd.jsp
Normal file
@ -0,0 +1,111 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@page import="com.sipai.entity.visit.VisitCommString"%>
|
||||
<%request.setAttribute("START", VisitCommString.STATUS_VISIT_START); %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doupdate4visitVisitors() {
|
||||
$("#unitId").val(unitId);
|
||||
$("#subDetailForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subDetailForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/visit/visitVisitors/dosave.do", $("#subDetailForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subDetailModal');
|
||||
$("#table_Detail").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
//输入框验证
|
||||
$("#subDetailForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
morder: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '序号不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
fullName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '姓名不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
$(function(){
|
||||
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subDetailModal">
|
||||
<div class="modal-dialog">
|
||||
<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">
|
||||
<!-- 新增界面formid强制为subDetailForm -->
|
||||
<form class="form-horizontal" id="subDetailForm">
|
||||
<input id="applyId" name="applyId" type="hidden" value="${applyId}"/>
|
||||
<input id="state" name="state" type="hidden" value="0"/>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*序号</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="morder" name ="morder" placeholder="序号"
|
||||
value="${morder}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*姓名</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="fullName" name ="fullName" placeholder="姓名"
|
||||
value="${visitVisitors.fullName}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">性别</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="gender" name ="gender" placeholder="性别"
|
||||
value="${visitVisitors.gender}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">年龄</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="age" name ="age" placeholder="年龄"
|
||||
value="${visitVisitors.leadUnits}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="remark" name ="remark" placeholder="备注...">${visitVisitors.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate4visitVisitors()" id="btn_update">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
Reference in New Issue
Block a user