130 lines
5.1 KiB
Plaintext
130 lines
5.1 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8"%>
|
||
<%@page import="com.sipai.entity.equipment.SpecialEquipment"%>
|
||
<%@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); %>
|
||
|
||
<%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 dosave() {
|
||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||
setTimeout(function(){
|
||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
$.post(ext.contextPath + "/sparepart/outStockRecord/save4EquDetail.do",
|
||
{equipmentCardId:$("#equipmentCardId").val(),receiveTime:$("#receiveTime").val()},
|
||
function(data) {
|
||
if (data.res == 1){
|
||
closeModal("subEditModal");
|
||
}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}";
|
||
//根据厂区id选择厂内设备
|
||
var selectEquipmentCard = function() {
|
||
$.post(ext.contextPath + '/equipment/specialEquipment/showEquipmentCardForSelect.do', {companyId:companyId, equipmentId:$("#equipmentCardId").val()} ,
|
||
function(data) {
|
||
$("#emSubDiv").html(data);
|
||
openModal('emSubModal');
|
||
});
|
||
};
|
||
</script>
|
||
<div class="modal fade" id="subEditModal">
|
||
<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>
|
||
<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" />
|
||
<input class="form-control" id="equipmentName" name ="equipmentName" autocomplete="off"
|
||
onclick="selectEquipmentCard()" placeholder="请点击选择" readonly>
|
||
</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="receiveTime" name="receiveTime" style="width: 230px;" value="${outStockRecord.outDate.substring(0,10)}" readonly/>
|
||
</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="dosave()" id="btn_save">保存</button>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|