288 lines
11 KiB
Plaintext
288 lines
11 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
|||
|
|
<%@page import="com.sipai.entity.equipment.EquipmentCommStr"%>
|
|||
|
|
<%request.setAttribute("EquipmentLife_Standard_Trade", EquipmentCommStr.EquipmentLife_Standard_Trade); %>
|
|||
|
|
<%request.setAttribute("EquipmentLife_Standard_Supplier", EquipmentCommStr.EquipmentLife_Standard_Supplier); %>
|
|||
|
|
<%request.setAttribute("EquipmentLife_Standard_Enterprise", EquipmentCommStr.EquipmentLife_Standard_Enterprise); %>
|
|||
|
|
<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 dodel() {
|
|||
|
|
|
|||
|
|
swal({
|
|||
|
|
text: "您确定要删除此记录?",
|
|||
|
|
dangerMode: true,
|
|||
|
|
buttons: {
|
|||
|
|
cancel: {
|
|||
|
|
text: "取消",
|
|||
|
|
value: null,
|
|||
|
|
visible: true,
|
|||
|
|
className: "btn btn-default btn-sm",
|
|||
|
|
closeModal: true,
|
|||
|
|
},
|
|||
|
|
confirm: {
|
|||
|
|
text: "确定",
|
|||
|
|
value: true,
|
|||
|
|
visible: true,
|
|||
|
|
className: "btn btn-danger btn-sm",
|
|||
|
|
closeModal: true
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
.then(function(willDelete) {
|
|||
|
|
if (willDelete) {
|
|||
|
|
$.post(ext.contextPath + '/equipment/equipmentClass/delEquipmentClassAndProp.do', $("#subForm").serialize(), function(data) {
|
|||
|
|
if(data.res==1){
|
|||
|
|
showAlert('s','删除成功');
|
|||
|
|
setTimeout(function(){
|
|||
|
|
initTreeView();
|
|||
|
|
},500);
|
|||
|
|
//initTreeView();
|
|||
|
|
}else{
|
|||
|
|
showAlert('d','删除失败');
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
var showEquipmentClass4SelectFun = function() {
|
|||
|
|
$.post(ext.contextPath + '/equipment/equipmentClass/showList4Select.do', {formId:"subForm",hiddenId:"pid",textId:"_pname"} , function(data) {
|
|||
|
|
$("#equipmentClass4SelectDiv").html(data);
|
|||
|
|
openModal('equipmentClass4SelectModal');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|
|||
|
|
function doUpdate() {
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
$("#propForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
|||
|
|
if ($("#propForm").data('bootstrapValidator').isValid()) {
|
|||
|
|
$.post(ext.contextPath + "/equipment/equipmentClass/modifyEquipmentClass.do", $("#subForm").serialize(), function(result) {
|
|||
|
|
if (result.res == 1) {
|
|||
|
|
//initTreeView();
|
|||
|
|
//showAlert('s','保存成功');
|
|||
|
|
//$("#equipmentClassId").val(result.id);
|
|||
|
|
$.post(ext.contextPath + "/equipment/equipmentClass/modifyEquipmentClassProp.do", $("#propForm").serialize(), function(result) {
|
|||
|
|
if (result.res == 1) {
|
|||
|
|
showAlert('s','更新成功');
|
|||
|
|
setTimeout(function(){
|
|||
|
|
initTreeView();
|
|||
|
|
},500);
|
|||
|
|
}else{
|
|||
|
|
showAlert('d','更新失败');
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
}else{
|
|||
|
|
showAlert('d','保存失败');
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* function dosave() {
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
|||
|
|
$.post(ext.contextPath + "/maintenance/faultLibrary/dosave.do", $("#subForm").serialize(), function(result) {
|
|||
|
|
if (result == 1) {
|
|||
|
|
initTreeView();
|
|||
|
|
//showAlert('s','保存成功');
|
|||
|
|
}else{
|
|||
|
|
showAlert('d','保存失败');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
} */
|
|||
|
|
|
|||
|
|
|
|||
|
|
/* $(function() {
|
|||
|
|
$("#active").select2({minimumResultsForSearch: 10});
|
|||
|
|
$("#subForm").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
name: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '名称不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
_pname: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '上级菜单不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}); */
|
|||
|
|
|
|||
|
|
$("#subForm").bootstrapValidator({
|
|||
|
|
//live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
name: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '名称不能为空'
|
|||
|
|
},
|
|||
|
|
/* remote: {//ajax验证。server result:{"valid",true or false} 向服务发送当前input name值,获得一个json数据。例表示正确:{"valid",true}
|
|||
|
|
url: ext.contextPath + '/equipment/equipmentClass/checkExist.do',//验证地址
|
|||
|
|
message: '名称已存在',//提示消息
|
|||
|
|
type: 'POST',//请求方式
|
|||
|
|
data: function (validator) {
|
|||
|
|
return {
|
|||
|
|
name: $('#name').val()
|
|||
|
|
};
|
|||
|
|
}
|
|||
|
|
}, */
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
|
|||
|
|
|
|||
|
|
equipmentClassCode: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '设备类型编码不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$("#propForm").bootstrapValidator({
|
|||
|
|
//live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
ecoLifeSet: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '经济寿命标准预设值不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
|
|||
|
|
|
|||
|
|
maintainceFeeSet: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '首年保养费用标准预设值不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$(function(){
|
|||
|
|
//console.log("${equipmentClass.active}======================"+("${equipmentClass.active}"));
|
|||
|
|
//console.log("${equipmentClassProp.ecoLifeSetRes}======================"+("${equipmentClassProp.ecoLifeSetRes}"));
|
|||
|
|
//console.log("${equipmentClassProp.maintainceFeeSetRes}======================"+("${equipmentClassProp.maintainceFeeSetRes}"));
|
|||
|
|
|
|||
|
|
$("#active").select2({minimumResultsForSearch: 10}).val("${equipmentClass.active}").trigger("change");
|
|||
|
|
$("#ecoLifeSetRes").select2({minimumResultsForSearch: 10}).val("${equipmentClassProp.ecoLifeSetRes}").trigger("change");
|
|||
|
|
$("#maintainceFeeSetRes").select2({minimumResultsForSearch: 10}).val("${equipmentClassProp.maintainceFeeSetRes}").trigger("change");
|
|||
|
|
|
|||
|
|
|
|||
|
|
})
|
|||
|
|
</script>
|
|||
|
|
<div class="box box-primary" >
|
|||
|
|
<div class="box-header with-border">
|
|||
|
|
<h3 class="box-title">编辑</h3>
|
|||
|
|
|
|||
|
|
<div class="box-tools pull-right">
|
|||
|
|
<a onclick="doUpdate()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i class="glyphicon glyphicon-floppy-disk"></i></a>
|
|||
|
|
<a onclick="dodel()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-trash"></i></a>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.box-header -->
|
|||
|
|
<div class="box-body ">
|
|||
|
|
<form class="form-horizontal " id="subForm">
|
|||
|
|
<input id="id" name="id" type="hidden" value="${equipmentClass.id}"/>
|
|||
|
|
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<div id="equipmentClass4SelectDiv"></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="name" name ="name" placeholder="名称" value="${equipmentClass.name}">
|
|||
|
|
</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="上级菜单" onclick="showEquipmentClass4SelectFun();" value="${equipmentClass.pname}"></input>
|
|||
|
|
<input id="pid" name="pid" type="hidden" value="${equipmentClass.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="equipmentClassCode" name ="equipmentClassCode" placeholder="设备类型编码" value="${equipmentClass.equipmentClassCode }" >
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<label class="col-sm-2 control-label">启用</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select id ="active" name="active" class="form-control select2">
|
|||
|
|
<option value="1" >启用</option>
|
|||
|
|
<option value="0" >禁用</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
|
|||
|
|
<form class="form-horizontal" id="propForm">
|
|||
|
|
<input type="hidden" id="id" name="id" value="${equipmentClassProp.id}" >
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-4 control-label">经济寿命标准预设值(年)</label>
|
|||
|
|
<div class="col-sm-2">
|
|||
|
|
<input type="number" class="form-control" id="ecoLifeSet" name="ecoLifeSet" placeholder="" min="1"
|
|||
|
|
value="${equipmentClassProp.ecoLifeSet}">
|
|||
|
|
</div>
|
|||
|
|
<!-- <label class="col-sm-1 control-label">(年)</label> -->
|
|||
|
|
<label class="col-sm-2 control-label">标准来源</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select class="form-control select2" id="ecoLifeSetRes" name="ecoLifeSetRes" style="width:100%;">
|
|||
|
|
<option value="${EquipmentLife_Standard_Trade}" >行业标准</option>
|
|||
|
|
<option value="${EquipmentLife_Standard_Supplier}">供应商标准</option>
|
|||
|
|
<option value="${EquipmentLife_Standard_Enterprise}">企业标准</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-4 control-label">首年保养费用标准预设值(元)</label>
|
|||
|
|
<div class="col-sm-2">
|
|||
|
|
<input type="text" class="form-control" id="maintainceFeeSet" name="maintainceFeeSet" placeholder=""
|
|||
|
|
min="1" value="${equipmentClassProp.maintainceFeeSet}">
|
|||
|
|
</div>
|
|||
|
|
<!-- <label class="col-sm-1 control-label">(元)</label> -->
|
|||
|
|
<label class="col-sm-2 control-label">标准来源</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select class="form-control select2" id="maintainceFeeSetRes" name="maintainceFeeSetRes"
|
|||
|
|
style="width:100%;">
|
|||
|
|
<option value="${EquipmentLife_Standard_Trade}" >行业标准</option>
|
|||
|
|
<option value="${EquipmentLife_Standard_Supplier}">供应商标准</option>
|
|||
|
|
<option value="${EquipmentLife_Standard_Enterprise}">企业标准</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|