203 lines
8.2 KiB
Plaintext
203 lines
8.2 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8"%>
|
||
<%@page import="com.sipai.tools.CommString"%>
|
||
<%@page import="com.sipai.entity.sparepart.SparePartCommString"%>
|
||
<%request.setAttribute("AUDIT", SparePartCommString.STATUS_STOCK_AUDIT); %>
|
||
<%request.setAttribute("START", SparePartCommString.STATUS_STOCK_START); %>
|
||
<%request.setAttribute("FINSH", SparePartCommString.STATUS_STOCK_FINISH); %>
|
||
|
||
<%@page import="com.sipai.entity.equipment.SpecialEquipment"%>
|
||
<%request.setAttribute("CAR", SpecialEquipment.CAR); %>
|
||
<%request.setAttribute("SPECIAL_EQUIPMENT", SpecialEquipment.SPECIAL_EQUIPMENT); %>
|
||
<%request.setAttribute("INSTRUMENT", SpecialEquipment.INSTRUMENT); %>
|
||
<%request.setAttribute("TOOLS", SpecialEquipment.TOOLS); %>
|
||
<%request.setAttribute("OTHERS", SpecialEquipment.OTHERS); %>
|
||
<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() {
|
||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||
setTimeout(function(){
|
||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
$.post(ext.contextPath + "/equipment/specialEquipment/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');
|
||
}
|
||
}, 100);
|
||
}
|
||
|
||
$("#subForm").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
/* equipmentName: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '设备名称不能为空'
|
||
}
|
||
}
|
||
}, */
|
||
|
||
nextRecordTime: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '下次登记时间不能为空'
|
||
}
|
||
}
|
||
},
|
||
|
||
}
|
||
});
|
||
|
||
//厂区ID
|
||
var companyId = "${company.id}";
|
||
$(function() {
|
||
//下次登记时间
|
||
$("#nextRecordTime").datepicker({
|
||
language: 'zh-CN',
|
||
autoclose: true,
|
||
todayHighlight: true,
|
||
format:'yyyy-mm-dd',
|
||
}).on('hide',function(e) {
|
||
//当日期选择框关闭时,执行刷新校验
|
||
$('#subForm').data('bootstrapValidator')
|
||
.updateStatus('nextRecordTime', 'NOT_VALIDATED',null)
|
||
.validateField('nextRecordTime');
|
||
});
|
||
$("#nextRecordTime").datepicker('setDate',new Date());
|
||
|
||
|
||
//登记时间
|
||
$("#recentTime").datepicker({
|
||
language: 'zh-CN',
|
||
autoclose: true,
|
||
todayHighlight: true,
|
||
format:'yyyy-mm-dd',
|
||
}).on('hide',function(e) {
|
||
//当日期选择框关闭时,执行刷新校验
|
||
$('#subForm').data('bootstrapValidator')
|
||
.updateStatus('recentTime', 'NOT_VALIDATED',null)
|
||
.validateField('recentTime');
|
||
});
|
||
$("#recentTime").datepicker('setDate',new Date());
|
||
});
|
||
|
||
//根据厂区id选择厂内设备
|
||
var selectEquipmentCard = function() {
|
||
$.post(ext.contextPath + '/equipment/specialEquipment/showEquipmentCardForSelect.do', {companyId:companyId, equipmentId:$("#equipmentCardId").val()} ,
|
||
function(data) {
|
||
$("#emSubDiv").html(data);
|
||
openModal('emSubModal');
|
||
});
|
||
};
|
||
|
||
$(function(){
|
||
var equipmentClass='${specialEquipment.equipmentClass}';
|
||
$("#equipmentClass option[value='"+equipmentClass+"']").attr('selected','selected');
|
||
})
|
||
</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">
|
||
<!-- 界面提醒div强制id为alertDiv -->
|
||
<div id="alertDiv"></div>
|
||
<input name="bizId" id="bizId" type="hidden" value="${company.id}"/>
|
||
<input name="id" id="id" type="hidden" value="${specialEquipment.id}"/>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*公司</label>
|
||
<div class="col-sm-6">
|
||
<p class="form-control-static" >${company.name}</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*设备名称</label>
|
||
<div class="col-sm-6">
|
||
<input id="equipmentCardId" name="equipmentCardId" type="hidden" value="${specialEquipment.equipmentCardId}" />
|
||
<input class="form-control" id="equipmentName" name ="equipmentName" autocomplete="off"
|
||
onclick="selectEquipmentCard()" placeholder="请点击选择" value="${specialEquipment.equipmentCard.equipmentname}" readonly >
|
||
</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="equipmentClass" name ="equipmentClass" style="width: 270px;">
|
||
<option value= "${CAR}">车辆</option>
|
||
<option value= "${SPECIAL_EQUIPMENT}">特种设备</option>
|
||
<option value= "${INSTRUMENT}">仪器仪表</option>
|
||
<option value= "${TOOLS}">安全工具</option>
|
||
<option value= "${OTHERS}">其它</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
<%-- <div class="form-group">
|
||
<label class="control-label col-sm-2">状态</label>
|
||
<div class="col-sm-6">
|
||
<input type="text" class="form-control" id="status" name="status" style="width: 270px;" value="${specialEquipment.status}" placeholder="请输入状态"/>
|
||
</div>
|
||
</div> --%>
|
||
|
||
<div class="form-group">
|
||
<label class="control-label col-sm-2">登记时间</label>
|
||
<div class="col-sm-6">
|
||
<div class="input-group date">
|
||
<div class="input-group-addon">
|
||
<i class="fa fa-calendar"></i>
|
||
</div>
|
||
<input type="text" class="form-control" id="recentTime" name="recentTime" style="width: 230px;" value="${specialEquipment.recentTime}" placeholder="请选择"/>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="control-label col-sm-2">下次登记时间</label>
|
||
<div class="col-sm-6">
|
||
<div class="input-group date">
|
||
<div class="input-group-addon">
|
||
<i class="fa fa-calendar"></i>
|
||
</div>
|
||
<input type="text" class="form-control" id="nextRecordTime" name="nextRecordTime" style="width: 230px;" value="${specialEquipment.nextRecordTime}" placeholder="请选择"/>
|
||
</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="doupdate()" id="btn_save">保存</button>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|