120 lines
5.4 KiB
Plaintext
120 lines
5.4 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
|||
|
|
<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').data('bootstrapValidator')
|
|||
|
|
.updateStatus('equipname', 'NOT_VALIDATED',null)
|
|||
|
|
.validateField('equipname');
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/valueEngineering/equipmentDepreciation/update.do", $("#subForm").serialize(), function(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: {
|
|||
|
|
equipname: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '折旧设备不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
/* yearDepreciationRate: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '年折旧率不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
monthDepreciationRate: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '月折旧率不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}, */
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
//选择保养的设备,根据厂区id选择厂内设备
|
|||
|
|
var selectEquipmentCard = function() {
|
|||
|
|
$.post(ext.contextPath + '/equipment/showEquipmentCardForSelect.do', {companyId:'${equipmentCard.bizid}', equipmentId:$("#equipid").val()} ,
|
|||
|
|
function(data) {
|
|||
|
|
$("#emSubDiv").html(data);
|
|||
|
|
openModal('emSubModal');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
</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 id="id" name="id" type="hidden" value="${equipmentCardProp.id}" />
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*所属厂区</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<p class="form-control-static" >${equipmentCardProp.company.name}</p>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*折旧设备</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input id="equipid" name="equipmentId" type="hidden" value="${equipmentCardProp.equipmentId}" />
|
|||
|
|
<input class="form-control" id="equipname" name ="equipname" autocomplete="off" value="${equipmentCardProp.equipmentCard.equipmentname}"
|
|||
|
|
onclick="selectEquipmentCard()" placeholder="请点击选择" readonly>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">工艺段</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input id="processSectionId" name="processSectionId" type="hidden" value="${equipmentCardProp.processSectionId}" />
|
|||
|
|
<input type="text" class="form-control" id="processectionname" placeholder="工艺段" value="${equipmentCardProp.processSection.name}" readonly>
|
|||
|
|
</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="yearDepreciationRate" name ="yearDepreciationRate" placeholder="年折旧率" min="0" value="${equipmentDep.yearDepreciationRate}" step="0.01" >
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">*月折旧率</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="number" class="form-control" id="monthDepreciationRate" name ="monthDepreciationRate" placeholder="月折旧率" min="0" value="${equipmentDep.monthDepreciationRate}" step="0.0001" >
|
|||
|
|
</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>
|