105 lines
4.2 KiB
Plaintext
105 lines
4.2 KiB
Plaintext
<%@ page contentType="text/html;charset=UTF-8" %>
|
||
<%@ include file="/webpage/include/taglib.jsp"%>
|
||
<html>
|
||
<head>
|
||
<title>字典管理</title>
|
||
<meta name="decorator" content="default"/>
|
||
<script type="text/javascript">
|
||
var validateForm;
|
||
function doSubmit(){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
|
||
if(validateForm.form()){
|
||
$("#inputForm").submit();
|
||
return true;
|
||
}
|
||
|
||
return false;
|
||
}
|
||
$(document).ready(function() {
|
||
$("#value").focus();
|
||
validateForm = $("#inputForm").validate({
|
||
submitHandler: function(form){
|
||
loading('正在提交,请稍等...');
|
||
form.submit();
|
||
},
|
||
errorContainer: "#messageBox",
|
||
errorPlacement: function(error, element) {
|
||
$("#messageBox").text("输入有误,请先更正。");
|
||
if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
|
||
error.appendTo(element.parent().parent());
|
||
} else {
|
||
error.insertAfter(element);
|
||
}
|
||
}
|
||
});
|
||
});
|
||
|
||
function changeType(){
|
||
var typeName = $("#type").val();
|
||
if(typeName=="supplies_type"){
|
||
$("#suppliesTypeId").show();
|
||
}else{
|
||
$("#suppliesTypeId").hide();
|
||
}
|
||
}
|
||
|
||
|
||
</script>
|
||
</head>
|
||
<body>
|
||
<form:form id="inputForm" modelAttribute="dict" action="${ctx}/sys/dict/save" method="post" class="form-horizontal">
|
||
<form:hidden path="id"/>
|
||
<form:hidden path="typeSelect"/>
|
||
<sys:message content="${message}"/>
|
||
<table class="table table-bordered table-condensed dataTables-example dataTable no-footer">
|
||
<tbody>
|
||
<tr>
|
||
<td class="width-15 active"> <label class="pull-right"><font color="red">*</font>键值:</label></td>
|
||
<td class="width-35" ><form:input path="value" htmlEscape="false" maxlength="50" class="form-control required"/></td>
|
||
<td class="width-15 active"> <label class="pull-right"><font color="red">*</font>标签:</label></td>
|
||
<td class="width-35" ><form:input path="label" htmlEscape="false" maxlength="50" class="form-control required"/></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="width-15 active"> <label class="pull-right"><font color="red">*</font>类型:</label></td>
|
||
<td class="width-35" ><form:input path="type" htmlEscape="false" maxlength="50" class="form-control required abc" onchange="changeType()"/></td>
|
||
<td class="width-15 active"> <label class="pull-right"><font color="red">*</font>描述:</label></td>
|
||
<td class="width-35" ><form:input path="description" htmlEscape="false" maxlength="50" class="form-control required"/></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="width-15 active"> <label class="pull-right"><font color="red">*</font>排序:</label></td>
|
||
<td class="width-35" ><form:input path="sort" htmlEscape="false" maxlength="11" class="form-control required digits"/></td>
|
||
<td class="width-15 active"> </td>
|
||
<td class="width-35" > </td>
|
||
</tr>
|
||
<tr style="display: none;" id="suppliesTypeId">
|
||
<td class="width-15 active"> <label class="pull-right"><font color="red">*</font>耗材单位:</label></td>
|
||
<td class="width-35" ><form:input path="flag1" htmlEscape="false" maxlength="50" class="form-control required"/></td>
|
||
<td class="width-15 active"> <label class="pull-right">是否消耗品:</label></td>
|
||
<td class="width-35" >
|
||
<form:select path="flag2" class="form-control">
|
||
<form:options items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
|
||
</form:select>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="width-15 active"> <label class="pull-right">备注:</label></td>
|
||
<td class="width-35" colspan="3"><form:textarea path="remarks" htmlEscape="false" rows="5" maxlength="200" class="form-control "/></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</form:form>
|
||
<script type="text/javascript">
|
||
$(document).ready(function() {
|
||
window.onload=typeLoad;
|
||
});
|
||
|
||
function typeLoad(){
|
||
var typeName = $("#type").val();
|
||
if(typeName=="supplies_type"){
|
||
$("#suppliesTypeId").show();
|
||
}else{
|
||
$("#suppliesTypeId").hide();
|
||
}
|
||
}
|
||
</script>
|
||
</body>
|
||
</html> |