158 lines
6.6 KiB
Plaintext
158 lines
6.6 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8"%>
|
||
<% request.setAttribute("Maintain_Week", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Week); %>
|
||
<% request.setAttribute("Maintain_TenDays", com.sipai.entity.maintenance.MaintainCommStr.Maintain_TenDays); %>
|
||
<% request.setAttribute("Maintain_Month", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Month); %>
|
||
<% request.setAttribute("Maintain_Quarter", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Quarter); %>
|
||
<% request.setAttribute("Maintain_HalfYear", com.sipai.entity.maintenance.MaintainCommStr.Maintain_HalfYear); %>
|
||
<% request.setAttribute("Maintain_Year", com.sipai.entity.maintenance.MaintainCommStr.Maintain_Year); %>
|
||
<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 + "/maintenance/libraryMaintenanceCommon/dosave.do", $("#subForm").serialize(), function(data) {
|
||
if (data.code == 1) {
|
||
closeModal('subModal');
|
||
$("#projectTable").bootstrapTable('refresh');
|
||
|
||
}else if(data.code == 0){
|
||
showAlert('d',data.msg);
|
||
}else{
|
||
showAlert('d',data.msg);
|
||
}
|
||
},'json');
|
||
}
|
||
|
||
}
|
||
|
||
$("#subForm").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
cycle:{
|
||
validators: {
|
||
notEmpty: {
|
||
message: '请选择周期'
|
||
}
|
||
}
|
||
},
|
||
code: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '维保代码不能为空'
|
||
}
|
||
}
|
||
},
|
||
name: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '维保名称不能为空'
|
||
}
|
||
}
|
||
},
|
||
insideRepairTime:{
|
||
validators: {
|
||
notEmpty: {
|
||
message: '定额工时不能为空'
|
||
}
|
||
}
|
||
},
|
||
cost:{
|
||
validators: {
|
||
notEmpty: {
|
||
message: '维保费不能为空'
|
||
}
|
||
}
|
||
}
|
||
}
|
||
});
|
||
|
||
var showUser4SelectsFun = function() {
|
||
var userIds= '';
|
||
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"subForm",hiddenId:"lubricationuid",textId:"_lubricationuid",userIds:userIds} , function(data) {
|
||
$("#user4SelectDiv").html(data);
|
||
openModal("user4SelectModal");
|
||
});
|
||
};
|
||
|
||
$(function () {
|
||
|
||
});
|
||
</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" name="unitId" value="${param.unitId}">
|
||
<input type="hidden" name="type" value="${param.type}">
|
||
<!-- 界面提醒div强制id为alertDiv -->
|
||
<div id="alertDiv"></div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*周期</label>
|
||
<div class="col-sm-4">
|
||
<select class="form-control select2" id="cycle" name="cycle">
|
||
<option value="">请选择</option>
|
||
<!-- <option value="${Maintain_Week}">一周</option>
|
||
<option value="${Maintain_TenDays}">旬</option> -->
|
||
<option value="${Maintain_Month}">月度</option>
|
||
<option value="${Maintain_Quarter}">季度</option>
|
||
<option value="${Maintain_HalfYear}">半年度</option>
|
||
<option value="${Maintain_Year}">年度</option>
|
||
</select>
|
||
</div>
|
||
<label class="col-sm-2 control-label">*上级部位</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="pname" name="pname" placeholder="上级部位" value="${pname}" readonly="true">
|
||
<input type="hidden" id="pid" name="pid" value="${pid}">
|
||
</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="code" name="code" placeholder="维保代码" autocomplete="off">
|
||
</div>
|
||
<label class="col-sm-2 control-label">*维保名称</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="name" name="name" placeholder="维保名称" autocomplete="off">
|
||
</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="insideRepairTime" name="insideRepairTime" placeholder="工时定额" autocomplete="off" value="${libraryMaintenanceCommon.insideRepairTime}" step="0.01">
|
||
</div>
|
||
<label class="col-sm-2 control-label">*维保费(元)</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="cost" name="cost" placeholder="维保费" autocomplete="off" value="${libraryMaintenanceCommon.cost}" step="0.01">
|
||
</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>
|