first commit
This commit is contained in:
147
WebRoot/jsp/timeefficiency/patrolContentsAdd.jsp
Normal file
147
WebRoot/jsp/timeefficiency/patrolContentsAdd.jsp
Normal file
@ -0,0 +1,147 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.timeefficiency.TimeEfficiencyCommStr"%>
|
||||
<%request.setAttribute("PatrolType_Product", TimeEfficiencyCommStr.PatrolType_Product);%>
|
||||
<%request.setAttribute("PatrolType_Equipment", TimeEfficiencyCommStr.PatrolType_Equipment);%>
|
||||
|
||||
<%request.setAttribute("Patrol_Rank1", TimeEfficiencyCommStr.Patrol_Rank1);%>
|
||||
<%request.setAttribute("Patrol_Rank2", TimeEfficiencyCommStr.Patrol_Rank2);%>
|
||||
<%request.setAttribute("Patrol_Rank3", TimeEfficiencyCommStr.Patrol_Rank3);%>
|
||||
<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() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/timeEfficiency/patrolContents/dosave.do", $("#subForm").serialize(), function(data) {
|
||||
console.info(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: {
|
||||
/* code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '巡检代号不能为空'
|
||||
}
|
||||
}
|
||||
}, */
|
||||
contents: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '巡检名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
contentsDetail:{
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '巡检内容详情不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$(function () {
|
||||
var type=$('#patrolType').val();
|
||||
$('#bizId').val(unitId);
|
||||
$('#unitId').val(unitId);
|
||||
$('#pid').val(pid);
|
||||
$('#patrolContentsType').val(type);
|
||||
|
||||
$("#patrolRank").select2({minimumResultsForSearch: 10}).val("1").trigger("change");
|
||||
});
|
||||
|
||||
</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 type="hidden" id="bizId" name="bizId">
|
||||
<input type="hidden" id="unitId" name="unitId">
|
||||
<input type="hidden" id="pid" name="pid">
|
||||
<input type="hidden" id="patrolContentsType" name="patrolContentsType">
|
||||
<!-- 界面提醒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="code" name ="code" placeholder="巡检代码" value="${patrolContents.code}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*巡检名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="contents" name ="contents" placeholder="巡检名称" value="${patrolContents.contents}">
|
||||
</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="patrolRank" name ="patrolRank" style="width: 170px;">
|
||||
<option value= "${Patrol_Rank1}" selected = "selected">一级巡检</option>
|
||||
<option value= "${Patrol_Rank2}">二级巡检</option>
|
||||
<option value= "${Patrol_Rank3}">三级巡检</option>
|
||||
</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 ="contentsDetail" name ="contentsDetail" placeholder="请输入" >${patrolContents.contentsDetail}</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 ="tool" name ="tool" placeholder="请输入" autocomplete="off">${patrolContents.tool}</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 ="safeNote" name ="safeNote" placeholder="请输入" autocomplete="off">${patrolContents.safeNote}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" 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>
|
||||
Reference in New Issue
Block a user