<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>物资类型管理</title>
	<meta name="decorator" content="ani"/>
	<script type="text/javascript">

		$(document).ready(function() {
			jp.ajaxForm("#inputForm",function(data){
				if(data.success){
				    jp.success(data.msg);
				    jp.go("${ctx}/warehouse/materialtype/materialType?parentIds="+data.body.parentIds);
				}else{
				    jp.error(data.msg);
				    $("#inputForm").find("button:submit").button("reset");
				}
			});
			
		});
	</script>
</head>
<body>
<div class="wrapper wrapper-content">				
<div class="row">
	<div class="col-md-12">
	<div class="panel panel-primary">
		<div class="panel-heading">
			<h3 class="panel-title"> 
				<a class="panelButton" href="${ctx}/warehouse/materialtype/materialType"><i class="ti-angle-left"></i> 返回</a>
			</h3>
		</div>
		<div class="panel-body">
		<form:form id="inputForm" modelAttribute="materialType" action="${ctx}/warehouse/materialtype/materialType/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
			<div class="form-group">
				<label class="col-sm-2 control-label"><font color="red">*</font>名称：</label>
				<div class="col-sm-10">
					<form:input path="name" htmlEscape="false"    class="form-control required"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"><font color="red">*</font>排序：</label>
				<div class="col-sm-10">
					<form:input path="sort" htmlEscape="false"    class="form-control required"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">物资类型编码：</label>
				<div class="col-sm-10">
					<form:input path="code" htmlEscape="false"    class="form-control "/>
				</div>
			</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">备注信息：</label>
					<div class="col-sm-10">
						<form:textarea path="remarks" htmlEscape="false" rows="4"    class="form-control "/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">上级父级编号:</label>
					<div class="col-sm-10">
						<sys:treeselect id="parent" name="parent.id" value="${materialType.parent.id}" labelName="parent.name" labelValue="${materialType.parent.name}"
						title="父级编号" url="/warehouse/materialtype/materialType/treeData" extId="${materialType.id}" cssClass="form-control " allowClear="true"/>
					</div>
				</div>

		<c:if test="${mode == 'add' || mode=='edit'}">
				<div class="col-lg-3"></div>
		        <div class="col-lg-6">
		             <div class="form-group text-center">
		                 <div>
		                     <button class="btn btn-primary btn-block btn-lg btn-parsley" data-loading-text="正在提交...">提 交</button>
		                 </div>
		             </div>
		        </div>
		</c:if>
		</form:form>
		</div>				
	</div>
	</div>
</div>
</div>
</body>
</html>