<%@include file="/WEB-INF/common/layouts/common.jsp" %>
<%@ page language="java" pageEncoding="UTF-8" %>
<html>
<head>
    <title>${entity.id}</title>
</head>
<body>
<form id="input_form" class="form-horizontal valid"
      action="${ctx}/department<c:if test="${action=='edit'}">/update/${entity.id}</c:if><c:if test="${action!='edit'}">/detail/${entity.id}</c:if>"
      method="post">
        
    <!-- 面包屑 begin -->
	<div class="row-fluid">
	<%-- 	<div class="span12">
				<ul class="breadcrumb">
					<li>
						<span class="divider" style="color:#26a0da;font-weight:bold;">/</span>
						<a href="${ctx}/department">部门表列表</a>
					</li>
					<li class="active" >
						<span class="divider" style="color:#26a0da;font-weight:bold;">/</span>
						<c:choose>
                             <c:when test="${action=='create'}">
								<span class="inline">新增</span>
                             </c:when>
                             <c:when test="${action=='edit'}">
								<span class="inline"> ${entity.id} </span>
                             </c:when>
                             <c:otherwise>
                             	<span class="inline"> ${entity.id}</span>
                             </c:otherwise>
                         </c:choose>
					</li>
			</ul>
		</div> --%>
	</div>     
	<!-- 面包屑 end -->      
	 <div class="row${fluid}">
		<div class="span12">
        	<div class="portlet-header">
                <div class="operation-btn pull-left">
                    <c:choose>
                        <c:when test="${action=='edit'}">
                            <button class="btn blue" type="submit" onClick="return btnSubmit()"><i
                                    class="icon-save"></i>&nbsp;保存
                            </button>
                           <%--  <a href="${ctx}/department/${entity.id}" class="btn gray"><i
                                    class="icon-mail-reply"></i>&nbsp;取消</a> --%>
                        </c:when>
                        <%-- <c:when test="${action=='create'}">
                            <button class="btn blue"><i class="icon-save"></i>&nbsp;保存</button>
                            <a href="${ctx}/department" class="btn gray"><i class="icon-mail-reply"></i>&nbsp;返回</a>
                        </c:when> --%>
                        <c:otherwise>
                            <a href="${ctx}/department/update/${entity.id}?action=edit" class="btn blue"><i
                                    class="icon-edit"></i>&nbsp;编辑</a>
                          <%--   <a href="${ctx}/department" class="btn gray"><i class="icon-mail-reply"></i>&nbsp;返回</a> --%>
                        </c:otherwise>
                    </c:choose>
                </div>
            </div>
			<div class="form-horizontal house365Page">
				<div class="house365Border">
               		<!-- 片段头 begin -->
               		<div class="sectionTitle">
               		</div>
				<%-- 	<div class="sectionTitle">
						<c:choose>
                             <c:when test="${action=='create'}">
								<h5>新增</h5>
                             </c:when>
                             <c:when test="${action=='edit'}">
								<h5>编辑</h5>
                             </c:when>
                             <c:otherwise>
                             	<h5>详情</h5>
                             </c:otherwise>
                         </c:choose>
					</div> --%>
                    <input name="entity.id" type="hidden" value="${entity.id}"/>
                    <input name="entity.parentId" type="hidden" value="${entity.parentId}"/>
					<div class="row-fluid">
                        <div class="span6 control-group">
                            <label class="control-label">部门名称:</label>
                            <div class="controls">
                            	<c:choose>
                                    <c:when test="${action=='create' || action=='edit'}">
										<input type="text" id="entity.name"
											name="entity.name"
											value="${entity.name}"  maxlength="64"/>
										<font color="red"><form:errors path="departmentVo.entity.name" /></font>
                                    </c:when>
                                    <c:otherwise>
                                        <span class="inline">${entity.name}&nbsp;</span>
                                    </c:otherwise>
                                </c:choose>
                            
                            </div>
                        </div>
                          <div class="span6 control-group">
                            <label class="control-label">部门编码:</label>
                            <div class="controls">
                            	<c:choose>
                                    <c:when test="${action=='create' || action=='edit'}">
										<input type="text" id="entity.descripition"
											name="entity.descripition"
											value="${entity.descripition}" />
										<font color="red"><form:errors path="departmentVo.entity.descripition" /></font>
                                    </c:when>
                                    <c:otherwise>
                                        <span class="inline">${entity.descripition}&nbsp;</span>
                                    </c:otherwise>
                                </c:choose>
                            
                            </div>
                        </div>
                      <%--   <div class="span6 control-group">
                            <label class="control-label">部门层级:</label>
                            <div class="controls">
                            	<c:choose>
                                    <c:when test="${action=='create' || action=='edit'}">
										<input type="text" id="entity.urlPath"
											name="entity.urlPath"
											value="${entity.urlPath}" />
										<font color="red"><form:errors path="departmentVo.entity.urlPath" /></font>
                                    </c:when>
                                    <c:otherwise>
                                        <span class="inline">${entity.urlPath}&nbsp;</span>
                                    </c:otherwise>
                                </c:choose>
                            
                            </div>
                        </div> --%>
					</div>
					<%-- <div class="row-fluid">
                        <div class="span6 control-group">
                            <label class="control-label">部门类型:</label>
                            <div class="controls">
                            	<c:choose>
                                    <c:when test="${action=='create' || action=='edit'}">
										<input type="text" id="entity.type"
											name="entity.type"
											value="${entity.type}" />
										<font color="red"><form:errors path="departmentVo.entity.type" /></font>
                                    </c:when>
                                    <c:otherwise>
                                        <span class="inline">${entity.type}&nbsp;</span>
                                    </c:otherwise>
                                </c:choose>
                            
                            </div>
                        </div>
                        <div class="span6 control-group">
                            <label class="control-label">父部门:</label>
                            <div class="controls">
                            	<c:choose>
                                    <c:when test="${action=='create' || action=='edit'}">
										<input type="text" id="entity.parentId"
											name="entity.parentId"
											value="${entity.parentId}" />
										<font color="red"><form:errors path="departmentVo.entity.parentId" /></font>
                                    </c:when>
                                    <c:otherwise>
                                        <span class="inline">${entity.parentId}&nbsp;</span>
                                    </c:otherwise>
                                </c:choose>
                            
                            </div>
                        </div>
					</div> --%>
					<%-- <div class="row-fluid">
                        <div class="span6 control-group">
                            <label class="control-label">在父部门中的次序值:</label>
                            <div class="controls">
                            	<c:choose>
                                    <c:when test="${action=='create' || action=='edit'}">
										<input type="text" id="entity.orderNum"
											name="entity.orderNum"
											value="${entity.orderNum}" />
										<font color="red"><form:errors path="departmentVo.entity.orderNum" /></font>
                                    </c:when>
                                    <c:otherwise>
                                        <span class="inline">${entity.orderNum}&nbsp;</span>
                                    </c:otherwise>
                                </c:choose>
                            
                            </div>
                        </div>
                        <div class="span6 control-group">
                            <label class="control-label">创建时间:</label>
                            <div class="controls">
                            	<c:choose>
                                    <c:when test="${action=='create' || action=='edit'}">
										<input type="text" id="entity.createTimeStr"
											name="entity.createTimeStr"
											value="<fmt:formatDate value='${entity.createTime}' pattern='yyyy-MM-dd HH:mm:ss' />" />
										<font color="red"><form:errors path="departmentVo.entity.createTime" /></font>
                                    </c:when>
                                    <c:otherwise>
                                        <span class="inline">${entity.createTime}&nbsp;</span>
                                    </c:otherwise>
                                </c:choose>
                            
                            </div>
                        </div>
					</div> --%>
					<%-- <div class="row-fluid">
                        <div class="span6 control-group">
                            <label class="control-label">修改时间:</label>
                            <div class="controls">
                            	<c:choose>
                                    <c:when test="${action=='create' || action=='edit'}">
										<input type="text" id="entity.updateTimeStr"
											name="entity.updateTimeStr"
											value="<fmt:formatDate value='${entity.updateTime}' pattern='yyyy-MM-dd HH:mm:ss' />" />
										<font color="red"><form:errors path="departmentVo.entity.updateTime" /></font>
                                    </c:when>
                                    <c:otherwise>
                                        <span class="inline">${entity.updateTime}&nbsp;</span>
                                    </c:otherwise>
                                </c:choose>
                            
                            </div>
                        </div>
				</div> --%>
			</div>               
        </div>
    </div>   

</form>
<script type="text/javascript">
$(document).ready(function () {
})

function btnSubmit(){
	var $form = $("#input_form");
	 $.ajax({
         url: $form.attr("action"),
         type: "POST",
         data: $form.serialize(),
         success: function (data) {
           window.parent.parent.location = "${ctx}/department/main";
         }
     });
	return false;
}
</script>
</body>

</html>