<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sptg="http://www.thymeleaf.org/sptg">
    <head>
        <script th:replace="common/head"></script>
        <!--模糊搜索样式-->
        <link rel="stylesheet" th:href="@{'/css/permission/community-add.css'}" media="all">
        <!-- 省市区样式 -->
        <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=cbb265e2a60bbbc04a52eec4eecdeb12&plugin=AMap.Autocomplete,AMap.PlaceSearch"></script>
        <script type="text/javascript" src="https://cache.amap.com/lbs/static/addToolbar.js"></script>
    </head>
    <body>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body" pad15>
                            <div class="layui-form" >
                                <input type="hidden" lay-verify="required" name="id" th:value="${residential.id}" />
                                <div class="layui-form-item">
                                    <label class="layui-form-label"><span class="must">*</span>小区名称</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="name" lay-verify="required|specialCharacters|length"  th:value="${residential.name}" placeholder="" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <!--<div class="layui-form-item">
                                    <label class="layui-form-label">
                                        <span class="must">*</span>
                                        <span>选择地区</span>
                                    </label>
                                    <div class="layui-input-inline  w300">
                                        <input type="text" id="region" name="region" disabled class="layui-input" th:value="${residential.region}">
                                    </div>
                                    &lt;!&ndash;<div class="layui-input-inline" id="region_body">
                                        <input type="hidden" lay-verify="required" th:value="${residential.regionProvince}" name="regionProvince" />
                                        <input type="hidden" lay-verify="required" th:value="${residential.regionCity}" name="regionCity" />
                                        <input type="hidden" lay-verify="required" th:value="${residential.regionArea}" name="regionArea" />
                                        <input type="text" name="region" th:value="${residential.region}" lay-verify="required" autocomplete="off" class="layui-input" id="region" />
                                        <div th:replace="common/region"></div>
                                    </div>&ndash;&gt;
                                </div>-->
                                <div class="layui-form-item">
                                    <label class="layui-form-label">详细地址</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="address" th:value="${residential.address}" placeholder="" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <!--以后换成下拉树形-->
                                <div class="layui-form-item layui-form">
                                    <label class="layui-form-label">
                                        <span class="must">*</span>
                                        <span>所属社区</span>
                                    </label>
                                    <div class="layui-input-inline">
<!--                                        <input name="orgPidName" th:value="${residential.orgPidName}" readonly type="text" placeholder="" autocomplete="off" class="layui-input">-->
<!--                                        <input name="orgPid" th:value="${residential.orgPid}" lay-verify="required" type="hidden" />-->
<!--                                        <input name="agencyName" th:value="${residential.agencyName}" readonly type="text" placeholder="" autocomplete="off" class="layui-input">-->
<!--                                        <input name="agencyId" th:value="${residential.agencyId}" lay-verify="required" type="hidden" />-->
                                        <div class="layui-input-inline w300">
                                            <input type="text" id="input_agency" name="agencyName" class="layui-input" th:value="${residential.agencyName}" disabled>
                                            <div id="agency_id" class=" w350" style="display: none"></div>
                                            <button class="layui-btn" id="editAgency" sptg:security="estate:residential:agency">更改所属社区</button>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label"><span>经度</span></label>
                                    <div class="layui-input-inline">
                                        <input type="text" lay-verify="required" name="longitude" th:value="${residential.longitude}" class="layui-input" />
                                    </div>
                                    <label class="layui-form-label"><span>纬度</span></label>
                                    <div class="layui-input-inline">
                                        <input type="text" lay-verify="required" name="latitude" th:value="${residential.latitude}" class="layui-input" />
                                    </div>
                                    <div id="myPageTop" style="padding-left: 80%">
                                        <input id="tipinput" class="layui-input" placeholder="输入名称，查询位置"/>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div id="container1" style="width: 100%;height: 340px;padding-left: 12px;padding-top:200px;"></div>
                                </div>
                                <div id="l_estate_pid" class="layui-form-item layui-form">
                                    <label class="layui-form-label"><span class="must">*</span><span>所属物业</span></label>
                                    <div class="layui-input-inline" id="input_estate">
                                        <input name="estatePidName" th:value="${residential.estatePidName}" readonly type="text" placeholder="" autocomplete="off" class="layui-input">
                                        <input id="estate_id" th:value="${residential.estatePid}" type="hidden" />
                                    </div>
                                    <button class="layui-btn" id="editEstate">更改所属物业</button>
                                    <div class="layui-input-inline" id="select_estate" lay-filter="estate_pid_filter" style="display: none;">
                                        <div id="estate_pid"></div>
<!--                                        <select id="estate_pid" lay-search="" name="estatePidTemp" lay-verify="required" lay-filter="estate_pid_event" >-->
<!--                                    </select>-->
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">负责人</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="personName" lay-verify="personName" th:value="${residential.personName}"  placeholder="" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <!--<div class="layui-form-item">
                                    <label class="layui-form-label"><span class="must">*</span>单元总数</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="totalUnitNumber" lay-verify="required|number" th:value="${residential.totalUnitNumber}"  placeholder="" autocomplete="off"
                                               class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label"><span class="must">*</span>房间总数</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="totalRoomNumber" lay-verify="required|number"  th:value="${residential.totalRoomNumber}" placeholder="" autocomplete="off"
                                               class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label"><span class="must">*</span>住户总数</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="totalUserNumber" lay-verify="required|number"  th:value="${residential.totalUserNumber}" placeholder="" autocomplete="off"
                                               class="layui-input">
                                    </div>
                                </div>-->
                                <div class="layui-form-item">
                                    <label class="layui-form-label">联系电话</label>
                                    <div class="layui-input-inline">
                                        <input type="number" name="personTel" lay-verify="phoneNum" th:value="${residential.personTel}"  placeholder="" autocomplete="off"
                                               class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-form-item layui-form-text">
                                    <label class="layui-form-label">备注</label>
                                    <div class="layui-input-block">
                                        <textarea name="remark" placeholder="请输入300字以内的备注介绍" th:text="${residential.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="submit_button">提交</button>
                                        <button type="reset" class="layui-btn layui-btn-primary" id="cancel_btn">取消</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- javascript -->
        <!--去掉input type="number"后面的箭头-->
        <style type="text/css">
            input::-webkit-outer-spin-button,
            input::-webkit-inner-spin-button {
                -webkit-appearance: none;
            }
            input[type="number"] {
                -moz-appearance: textfield;
            }
        </style>
        <script th:src="@{'/layui/layui.js'}"></script>
        <script>
            layui.config({
                base: '/' //静态资源所在路径
            });
        </script>
        <script th:src="@{'/js/estate/residential-edit.js'}"></script>
    </body>
</html>