<!DOCTYPE html>
<html  lang="en" xmlns:th="http://www.thymeleaf.org">
    <head>
        <script th:replace="common/head"></script>
        <link xmlns:th="http://www.thymeleaf.org" rel="stylesheet" th:href="${'/css/estate/access.css'}" media="all">
    </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="${user.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" th:value="${user.name}" lay-verify="required|specialCharacters|length" 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="residentialName" th:value="${user.residentialName}" readonly type="text" placeholder="" autocomplete="off" class="layui-input">
                                        <input name="residentialId" th:value="${user.residentialId}" lay-verify="required" type="hidden" />
                                    </div>
                                    <label class="layui-form-label"><span class="must">*</span><span>所属楼栋</span></label>
                                    <div class="layui-input-inline">
                                        <input name="buildingName" th:value="${user.buildingName}" readonly type="text" placeholder="" autocomplete="off" class="layui-input">
                                        <input name="buildingId" th:value="${user.buildingId}" lay-verify="required" type="hidden" />
                                    </div>
                                    <label class="layui-form-label"><span class="must">*</span><span>所属单元</span></label>
                                    <div class="layui-input-inline">
                                        <input name="unitName" th:value="${user.unitName}" readonly type="text" placeholder="" autocomplete="off" class="layui-input">
                                        <input name="unitId" th:value="${user.unitId}" lay-verify="required" type="hidden" />
                                    </div>
                                    <label class="layui-form-label"><span class="must">*</span><span>所属房间</span></label>
                                    <div class="layui-input-inline">
                                        <input name="roomName" th:value="${user.roomName}" readonly type="text" placeholder="" autocomplete="off" class="layui-input">
                                        <input name="roomId" th:value="${user.roomId}" lay-verify="required" type="hidden" />
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                        <label class="layui-form-label"><span class="must">*</span>住户类型</label>
                                        <div class="layui-input-inline">
                                            <div id="type"></div>
                                            <input type="hidden" id="typeValue" th:value="${user.type}">
                                            <!--<select id="type" name="type" th:value="${user.type}">
                                                <option value="0">业主</option>
                                                <option value="1">家属</option>
                                                <option value="2">租客</option>
                                            </select>-->
                                        </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">手机号</label>
                                    <div class="layui-input-inline">
                                        <input type="number" name="tel" lay-verify="phoneNum" th:value="${user.tel}" 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">
                                        <div id="sex_dic"></div>
                                        <input type="hidden" id="sexValue" th:value="${user.sex}">
                                        <!--<select id="sex" name="sex" th:value="${user.sex}" >
                                            <option value="0">未定义</option>
                                            <option value="1">男</option>
                                            <option value="2">女</option>
                                        </select>-->
                                    </div>
                                </div>
                                <!--<div class="layui-form-item">
                                    <div class="layui-form" lay-filter="">
                                        <label class="layui-form-label"><span class="must"></span>国籍</label>
                                        <div class="layui-input-inline">
                                            <div id="nationality"></div>
                                            <input type="hidden" id="nationalityValue" th:value="${user.nationality}">
                                        </div>
                                    </div>
                                </div>-->
                                <div class="layui-form-item">
                                    <label class="layui-form-label"><span class="must"></span>证件类型</label>
                                    <div class="layui-input-inline">
                                        <span id="card_name" class="detail-info" th:if="${user.nationality == 0 || user.nationality == null}" >身份证</span>
                                        <span id="card_name" class="detail-info" th:if="${user.nationality == 1}" >港澳居民往来内地通行证</span>
                                        <span id="card_name" class="detail-info" th:if="${user.nationality == 2}" >台湾居民往来大陆通行证</span>
                                        <span id="card_name" class="detail-info" th:if="${user.nationality == 3}" >海外</span>
                                    </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="idCard"  th:value="${user.idCard}" lay-verify="cardNum" placeholder="" autocomplete="off"
                                               class="layui-input">
                                    </div>
                                </div>
                                <!--中国大陆/港澳台-->
                                <div class="layui-form-item" id="birth_place">
                                    <label class="layui-form-label">籍贯</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="birthPlace" th:value="${user.birthPlace}" lay-verify="" placeholder="" autocomplete="off"
                                               class="layui-input">
                                    </div>
                                </div>
                                <!--海外-->
                                <div class="layui-form-item" id="passport_pic" style="display: none">
                                    <label class="layui-form-label"><span class="must"></span>护照图片</label>
                                    <div th:if="${user.passportImgUri != null && user.passportImgUri != ''}" class="avatar" style="display: inline-block;" >
                                        <input type="hidden" name="passportImgUri" th:value="${user.passportImgUri}"  />
                                        <img th:src="${fastDfsServer + user.passportImgUri}" class="layui-upload-img" />
                                    </div>
                                    <button type="button"  id="passport_upload" class="layui-btn layui-btn-primary" ><i class="layui-icon layui-icon-upload-drag"></i>上传照片</button>
                                    <span class="detail-info" style="color:#FF5722">&nbsp基本身份信息页</span>
                                </div>
                                <div class="layui-form-item" id="entry_pic" style="display: none">
                                    <label class="layui-form-label"><span class="must"></span>入境证明</label>
                                    <div  th:if="${user.entryImgUri != null && user.entryImgUri != ''}" class="avatar" style="display: inline-block;">
                                        <input type="hidden" name="entryImgUri" th:value="${user.entryImgUri}"  />
                                        <img th:src="${fastDfsServer + user.entryImgUri}" class="layui-upload-img" />
                                    </div>
                                    <button type="button" id="entry_upload" class="layui-btn layui-btn-primary"><i class="layui-icon layui-icon-upload-drag"></i>上传照片</button>
                                    <span class="detail-info" style="color:#FF5722">&nbsp入镜盖章页</span>
                                </div>
                                <div class="layui-form-item layui-form-text">
                                    <label class="layui-form-label">备注</label>
                                    <div class="layui-input-block">
                                        <textarea name="remark" th:text="${user.remark}"  placeholder="请输入300字以内的备注介绍" class="layui-textarea w500"></textarea>
                                    </div>
                                </div>
                                <input id="fastDfsServer" type="hidden" th:value="${fastDfsServer}">
                                <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 type="text/javascript" th:src="@{'/layui/layui.js'}"></script>
        <script type="text/javascript">
            layui.config({
                base: '/' //静态资源所在路径
            });
        </script>
        <script type="text/javascript" th:src="@{'/js/estate/user-edit.js'}"></script>
    </body>
</html>
