170 lines
6.5 KiB
Plaintext
170 lines
6.5 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8" %>
|
||
<%@page import="com.sipai.tools.CommString" %>
|
||
<% request.setAttribute("Flag_Active", CommString.Flag_Active); %>
|
||
<% request.setAttribute("Flag_Unactive", CommString.Flag_Unactive); %>
|
||
<style type="text/css">
|
||
|
||
</style>
|
||
<script type="text/javascript">
|
||
|
||
|
||
function dosave() {
|
||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
||
//加载层
|
||
layer.load();
|
||
//获取验证结果,如果成功,执行下面代码
|
||
$.post(ext.contextPath + "/report/rptCreate/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);
|
||
}
|
||
//关闭加载层
|
||
layer.closeAll('loading');
|
||
}, 'json');
|
||
}
|
||
}
|
||
|
||
$("#subForm").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
rptdt: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '日期不能为空'
|
||
}
|
||
}
|
||
},
|
||
inputuserName: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '负责人不能为空'
|
||
}
|
||
}
|
||
}
|
||
|
||
}
|
||
});
|
||
|
||
$('#rptdtD').datepicker({
|
||
format: 'yyyy-mm-dd',
|
||
language: "zh-CN",
|
||
autoclose: true,
|
||
startView: 1,
|
||
minViewMode: 0,
|
||
maxViewMode: 0,
|
||
}).on('hide', function (e) {
|
||
$('#subForm').data('bootstrapValidator')
|
||
.updateStatus('rptdtD', 'NOT_VALIDATED', null)
|
||
.validateField('rptdtD');
|
||
});
|
||
$('#rptdtM').datepicker({
|
||
changeYear: true,
|
||
changeMonth: true,
|
||
format: 'yyyy-mm',
|
||
language: "zh-CN",
|
||
autoclose: true,
|
||
startView: 1,
|
||
minViewMode: 1,
|
||
maxViewMode: 2,
|
||
}).on('hide', function (e) {
|
||
$('#subForm').data('bootstrapValidator')
|
||
.updateStatus('rptdtM', 'NOT_VALIDATED', null)
|
||
.validateField('rptdtM');
|
||
});
|
||
|
||
$('#rptdtQ').datepicker({
|
||
changeYear: true,
|
||
changeMonth: true,
|
||
format: 'yyyy-mm',
|
||
language: "zh-CN",
|
||
autoclose: true,
|
||
startView: 1,
|
||
minViewMode: 1,
|
||
maxViewMode: 2,
|
||
}).on('hide', function (e) {
|
||
$('#subForm').data('bootstrapValidator')
|
||
.updateStatus('rptdtQ', 'NOT_VALIDATED', null)
|
||
.validateField('rptdtQ');
|
||
});
|
||
|
||
$('#rptdtY').datepicker({
|
||
format: 'yyyy',
|
||
language: "zh-CN",
|
||
autoclose: true,
|
||
startView: 1,
|
||
minViewMode: 2,
|
||
maxViewMode: 2,
|
||
}).on('hide', function (e) {
|
||
$('#subForm').data('bootstrapValidator')
|
||
.updateStatus('rptdtY', 'NOT_VALIDATED', null)
|
||
.validateField('rptdtY');
|
||
});
|
||
|
||
|
||
</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" autocomplete="off">
|
||
<!-- 界面提醒div强制id为alertDiv -->
|
||
<div id="alertDiv"></div>
|
||
<input type="hidden" name="id" id="id" value="${id}"/>
|
||
<input type="hidden" id="unitId" name="unitId" value="${param.unitId}"/>
|
||
<input type="hidden" id="rptsetId" name="rptsetId" value="${param.classId}"/>
|
||
|
||
<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="rptdtD" name="rptdt" style="width: 132px;"
|
||
value="${dateD}">
|
||
<input type="text" class="form-control" id="rptdtM" name="rptdt" style="width: 132px;"
|
||
value="${dateM}">
|
||
<input type="text" class="form-control" id="rptdtQ" name="rptdt" style="width: 132px;"
|
||
value="${dateQ}">
|
||
<input type="text" class="form-control" id="rptdtY" name="rptdt" style="width: 132px;"
|
||
value="${dateY}">
|
||
</div>
|
||
</div>
|
||
<label class="col-sm-2 control-label">负责人</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="inputuserName" name="inputuserName"
|
||
value="${userName}" readonly/>
|
||
<input type="hidden" id="inputuser" name="inputuser" value="${userId}"/>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">备注</label>
|
||
<div class="col-sm-10">
|
||
<textarea class="form-control" id="memo" name="memo"
|
||
placeholder="备注">${rptCreate.memo}</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="dosave()" id="btn_save">生成</button>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div> |