282 lines
11 KiB
Plaintext
282 lines
11 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8" %>
|
||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||
|
||
<%@page import="com.sipai.entity.achievement.ModelLibrary" %>
|
||
<% request.setAttribute("Type_Large", ModelLibrary.Type_Large); %>
|
||
<% request.setAttribute("Type_Little", ModelLibrary.Type_Little); %>
|
||
<% request.setAttribute("Type_In", ModelLibrary.Type_In); %>
|
||
<% request.setAttribute("Type_Out", ModelLibrary.Type_Out); %>
|
||
<% request.setAttribute("Type_NotNull", ModelLibrary.Type_NotNull); %>
|
||
|
||
<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">
|
||
/*var showMenu4SelectFun = function () {
|
||
$.post(ext.contextPath + '/user/showMenu4Select.do', {
|
||
formId: "subForm",
|
||
hiddenId: "pid",
|
||
textId: "_pname"
|
||
}, function (data) {
|
||
$("#menu4SelectDiv").html(data);
|
||
openModal('menu4SelectModal');
|
||
});
|
||
};*/
|
||
|
||
function dosave() {
|
||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
$.post(ext.contextPath + "/achievement/modelLibrary/update.do", $("#subForm").serialize(), function (data) {
|
||
var dataStr = eval("(" + data + ")");
|
||
if (dataStr.result == 1) {
|
||
initTreeView();
|
||
editFun('${entity.id}');
|
||
} else {
|
||
showAlert('d', '保存失败');
|
||
}
|
||
});
|
||
}
|
||
}
|
||
|
||
$("#subForm").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
name: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '名称不能为空'
|
||
}
|
||
}
|
||
},
|
||
_pname: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '上级菜单不能为空'
|
||
}
|
||
}
|
||
},
|
||
equipmentLevelId: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '关联等级不能为空'
|
||
}
|
||
}
|
||
},
|
||
morder: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '顺序不能为空'
|
||
},
|
||
regexp: {
|
||
regexp: /^[0-9]*$/,
|
||
message: '顺序必须为数字'
|
||
}
|
||
}
|
||
},
|
||
active: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '请选择启用状态'
|
||
}
|
||
}
|
||
}
|
||
}
|
||
});
|
||
|
||
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 + '/achievement/modelLibrary/delete.do', $("#subForm").serialize(), function (data) {
|
||
if (data.result > 0) {
|
||
initTreeView();
|
||
} else {
|
||
showAlert('d', '删除失败');
|
||
}
|
||
}, 'json');
|
||
|
||
}
|
||
});
|
||
}
|
||
|
||
/*var showSubscribe4SelectsFun = function () {
|
||
var assetClassId = $("#assetClassId").val();
|
||
var _assetClassname = $("#_assetClassname").val();
|
||
|
||
$.post(ext.contextPath + '/equipment/assetClass/subscribeList4select.do', {
|
||
formId: "subForm",
|
||
hiddenId: "assetClassId",
|
||
textId: "_assetClassname",
|
||
assetClassId: assetClassId,
|
||
_assetClassname: _assetClassname
|
||
}, function (data) {
|
||
$("#fault4SelectDiv111").html(data);
|
||
openModal("subDetailModal2");
|
||
});
|
||
};*/
|
||
|
||
//是否审核 不审核则不显示 “可审核报表用户” 框
|
||
$('#referenceType').on('change', function () {
|
||
var val = $(this).val();
|
||
if (val == '${Type_In}') {
|
||
$('#checkDiv1').hide();
|
||
$('#checkDiv2').show();
|
||
}
|
||
if (val == '${Type_Out}') {
|
||
$('#checkDiv1').hide();
|
||
$('#checkDiv2').show();
|
||
}
|
||
if (val == '${Type_Large}') {
|
||
$('#checkDiv1').show();
|
||
$('#checkDiv2').hide();
|
||
}
|
||
if (val == '${Type_Little}') {
|
||
$('#checkDiv1').show();
|
||
$('#checkDiv2').hide();
|
||
}
|
||
if (val == '${Type_NotNull}') {
|
||
$('#checkDiv1').hide();
|
||
$('#checkDiv2').hide();
|
||
}
|
||
});
|
||
|
||
$(function () {
|
||
$('#checkDiv1').hide();
|
||
$('#referenceType').select2({minimumResultsForSearch: 10}).val('${entity.referenceType}').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="dosave()" 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" autocomplete="off">
|
||
<input id="id" name="id" type="hidden" value="${entity.id}"/>
|
||
<input id="type" name="type" type="hidden" value="${entity.type}"/>
|
||
<!-- 界面提醒div强制id为alertDiv -->
|
||
<div id="alertDiv"></div>
|
||
<div id="menu4SelectDiv"></div>
|
||
<div id="fault4SelectDiv111"></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="paramName" name="paramName" placeholder="名称"
|
||
value="${entity.paramName}">
|
||
</div>
|
||
<label class="col-sm-2 control-label">上级菜单</label>
|
||
<c:if test="${entity.type == '1'}">
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" name="_pname" placeholder="上级菜单"
|
||
value="无" readonly="true">
|
||
<input name="pid" type="hidden" value="-1"/>
|
||
</div>
|
||
</c:if>
|
||
<c:if test="${entity.type == '2' || entity.type == '3'}">
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" name="_pname" placeholder="上级菜单"
|
||
value="${pname}" readonly="true">
|
||
<input name="pid" type="hidden" value="${entity.pid}"/>
|
||
</div>
|
||
</c:if>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<c:if test="${param.type == '3'}">
|
||
<label class="col-sm-2 control-label">编号</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="paramCode" name="paramCode"
|
||
placeholder="用于指导分厂使用的标准编号" value="${entity.paramCode}">
|
||
</div>
|
||
</c:if>
|
||
<label class="col-sm-2 control-label">顺序</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" name="morder" placeholder="顺序"
|
||
value="${entity.morder}" >
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<c:if test="${entity.type == '3'}">
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">评价规则</label>
|
||
<div class="col-sm-4">
|
||
<select id="referenceType" name="referenceType" class="form-control select2">
|
||
<option value="${Type_In}" selected>${Type_In}</option>
|
||
<option value="${Type_Out}">${Type_Out}</option>
|
||
<option value="${Type_Large}">${Type_Large}</option>
|
||
<option value="${Type_Little}">${Type_Little}</option>
|
||
<option value="${Type_NotNull}">${Type_NotNull}</option>
|
||
</select>
|
||
</div>
|
||
<label class="col-sm-2 control-label">单位</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="unit" name="unit" placeholder="单位"
|
||
value="${entity.unit}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group" id="checkDiv1">
|
||
<label class="col-sm-2 control-label">参考值</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="referenceValue" name="referenceValue"
|
||
placeholder="参考值" value="${entity.referenceValue}" step="0.1">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group" id="checkDiv2">
|
||
<label class="col-sm-2 control-label">参考值下限</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="referenceLowValue" name="referenceLowValue"
|
||
placeholder="参考值下限" value="${entity.referenceLowValue}" step="0.1">
|
||
</div>
|
||
<label class="col-sm-2 control-label">参考值上限</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="referenceHighValue" name="referenceHighValue"
|
||
placeholder="参考值上限" value="${entity.referenceHighValue}" step="0.1">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">说明</label>
|
||
<div class="col-sm-10">
|
||
<textarea class="form-control" rows="2" id="explain" name="explain"
|
||
placeholder="说明">${entity.explain}</textarea>
|
||
</div>
|
||
</div>
|
||
</c:if>
|
||
</form>
|
||
</div>
|
||
</div> |