<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ page isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String basePath = request.getContextPath();
%>
<jsp:include page="../../../common/admin/modal_content_pre.jsp"><jsp:param name="modal_title" value="新增"/></jsp:include>
<form id="formAdd" action="<%=basePath%>/admin/sector_mgr/add.action" method="post" class="form-horizontal">
    <div class="form-group">
        <label for="sectorName" class="col-md-3 col-sm-3 control-label"><span style="color: red;">*</span>部门名称：</label>
        <div class="col-md-7 col-sm-7">
            <input type="text" id="sectorName" name="sectorName" class="form-control" />
            <span class="help-block"></span>
        </div>
    </div>
    <div class="form-group">
        <label for="sectorCode" class="col-md-3 col-sm-3 control-label"><span style="color: red;">*</span>部门编码：</label>
        <div class="col-md-7 col-sm-7">
            <input type="text" id="sectorCode" name="sectorCode" class="form-control" />
            <span class="help-block"></span>
        </div>
    </div>
    <div class="form-group">
        <label for="parentId" class="col-md-3 col-sm-3 control-label">上级部门：</label>
        <div class="col-md-7 col-sm-7">
            <input type="hidden" id="parentId" name="parentId" />
            <button type="button" class="btn btn-default dropdown-toggle" style="min-width: 120px; text-align: right;">
                <span class="caret" style="margin-left: 10px;"></span>
            </button>
            <div id="divParent"></div>
            <span class="help-block"></span>
        </div>
    </div>
    <div class="form-group">
        <label for="contact" class="col-md-3 col-sm-3 control-label">联系人：</label>
        <div class="col-md-7 col-sm-7">
            <input type="text" id="contact" name="contact" class="form-control" />
            <span class="help-block"></span>
        </div>
    </div>
    <div class="form-group">
        <label for="phone" class="col-md-3 col-sm-3 control-label">联系电话：</label>
        <div class="col-md-7 col-sm-7">
            <input type="text" id="phone" name="phone" class="form-control" />
            <span class="help-block"></span>
        </div>
    </div>
    <div class="form-group">
        <label for="email" class="col-md-3 col-sm-3 control-label">电子邮箱：</label>
        <div class="col-md-7 col-sm-7">
            <input type="text" id="email" name="email" class="form-control" />
            <span class="help-block"></span>
        </div>
    </div>
    <div class="form-group">
        <label for="fax" class="col-md-3 col-sm-3 control-label">传真：</label>
        <div class="col-md-7 col-sm-7">
            <input type="text" id="fax" name="fax" class="form-control" />
            <span class="help-block"></span>
        </div>
    </div>
</form>
<jsp:include page="../../../common/admin/modal_content_post.jsp"></jsp:include>
<jsp:include page="../../../common/admin/modal_footer_pre.jsp"></jsp:include>
<button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-close"></i>取消</button>
<button type="button" id="btnSave" class="btn btn-primary"><i class="fa fa-check"></i>保存</button>
<jsp:include page="../../../common/admin/modal_footer_post.jsp"></jsp:include>
<script type="text/javascript">
    $("#btnSave").click(function() {
        $('#formAdd').ajaxSubmitCloseRefresh();
    });

    $("#formAdd").validate({
        rules: {
            sectorName: "required",
            sectorCode: "required"
        }
    });

    $("#divParent").selectTree({url: "<%=basePath%>/admin/common/sector_tree_data.action"});
</script>