<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
    <head>
        <script th:replace="common/head"></script>
        <!-- 样式 -->
        <link rel="stylesheet" th:href="@{'/css/permission/community-add.css'}" media="all">
        <!-- 省市区样式 -->
        <link rel="stylesheet" th:href="@{'/layui/lay/mymodules/region.css'}" media="all">

        <style>
            #pid xm-select {
                width: 350px;
            }
        </style>
    </head>
    <body>
    <div class="layui-fluid">

        <input type="hidden" id="user_org_type" th:value="${userOrg.orgType}">

        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body">
                        <div class="layui-form">
                            <!-- 机构类型 -->
                            <div id="i_org_type" class="layui-form-item layui-form" style="display: none">
                                <label class="layui-form-label">
                                    <span class="must">*</span>
                                    <span>机构类型</span>
                                </label>
                                <div class="layui-input-block">
<!--                                    <input type="radio" name="orgType" lay-filter="select_orgType" value="1" title="内部" checked>-->
<!--                                    <input type="radio" name="orgType" lay-filter="select_orgType" value="2" title="广告商">-->
                                    <input type="radio" name="orgType" lay-filter="select_orgType" value="3" title="物业">
                                    <input type="radio" name="orgType" lay-filter="select_orgType" value="4" title="社区" checked>
                                    <input type="radio" name="orgType" lay-filter="select_orgType" value="5" title="园区">
                                </div>
                            </div>
                            <!-- 机构名称 -->
                            <div class="layui-form-item">
                                <label class="layui-form-label">
                                    <span class="must">*</span>
                                    <span>机构名称</span>
                                </label>
                                <div class="layui-input-inline">
                                    <input type="text" name="name" lay-verify="required|specialCharacters|length" autocomplete="off" class="layui-input w350">
                                </div>
                            </div>
                            <!-- 上级机构 -->
                            <div id="parent_entity" class="layui-form-item layui-form">
                                <label class="layui-form-label"><span class="must">*</span><span>上级机构</span></label>
                                <div class="layui-input-inline">
                                    <div id="pid" name="pid"></div>
                                </div>
                            </div>

                            <!-- 地区 -->
                            <div class="layui-form-item">
                                <label class="layui-form-label">
                                    <span class="must">*</span>
                                    <span>选择地区</span>
                                </label>
                                <div class="layui-input-inline" id="region_body" style="width: 350px">
                                    <input type="hidden" lay-verify="required" name="regionProvince" />
                                    <input type="hidden" lay-verify="required" name="regionCity" />
                                    <input type="hidden" lay-verify="required" name="regionArea" />
                                    <input type="text" name="region" lay-verify="required" autocomplete="off" class="layui-input" id="region" />
                                    <div th:replace="common/region"></div>
                                </div>
                            </div>

                            <!-- 详细地址 -->
                            <div class="layui-form-item layui-form-text">
                                <label class="layui-form-label">
                                    <span>详细地址</span>
                                </label>
                                <div class="layui-input-block">
                                    <textarea name="address" class="layui-textarea w500"></textarea>
                                </div>
                            </div>
                            <!-- 机构负责人 -->
                            <div class="layui-form-item">
                                <label class="layui-form-label">机构负责人</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="personName" autocomplete="off" class="layui-input w350" >
                                </div>
                            </div>
                            <!-- 负责人电话 -->
                            <div class="layui-form-item">
                                <label class="layui-form-label">负责人电话</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="personTel" autocomplete="off" class="layui-input w350">
                                </div>
                            </div>
                            <!-- 备注 -->
                            <div class="layui-form-item layui-form-text">
                                <label class="layui-form-label">备注</label>
                                <div class="layui-input-block">
                                    <textarea name="remark" class="layui-textarea w500"></textarea>
                                </div>
                            </div>
                            <!-- 按钮 -->
                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button class="layui-btn" lay-submit lay-filter="entity_submit_event">提交</button>
                                    <button type="reset" class="layui-btn layui-btn-primary">取消</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </body>
    <!-- javascript -->
    <script type="text/javascript" th:src="@{'/layui/layui.js'}"></script>
    <script type="text/javascript">
        layui.config({
            base: '/' //静态资源所在路径
        });
    </script>
    <script type="text/javascript" th:src="@{'/js/permissions/org-add.js'}"></script>

</html>