<!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">
        <link xmlns:th="http://www.thymeleaf.org" rel="stylesheet" th:href="${'/css/estate/server-user-open-permission.css'}" media="all">
    </head>
    <body>
        <div class="layui-fluid">
            <div class="layui-upload">
                <div class="layui-form">
                    <input type="hidden" name="id" id="id" th:value="${accessCard.id}" />
                    <input type="hidden" name="type" id="type" th:value="${accessCard.type}" />
                    <input type="hidden" name="roomId" id="room_id" th:value="${accessCard.roomId}" />
                    <input type="hidden" name="unitId" id="unit_id" th:value="${accessCard.unitId}" />
                    <input type="hidden" name="residentialId" id="residential_id" th:value="${accessCard.residentialId}" />
                    <input type="hidden" name="roomName" id="room_name" th:value="${accessCard.roomName}" />
                    <input type="hidden" name="unitName" id="unit_name" th:value="${accessCard.unitName}" />
                    <input type="hidden" name="residentialName" id="residential_name" th:value="${accessCard.residentialName}" />
                    <div class="" style="margin-top: 20px;">
                        门禁卡：
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">发卡对象：</label>
                                <div class="layui-input-inline">
                                    <span class="detail-info" th:if=" ${accessCard.type == 3}" th:text="${accessCard.residentialName}"></span>
                                    <span class="detail-info" th:if=" ${accessCard.type == 2}" th:text="${accessCard.residentialName + ' - ' +accessCard.unitName}"></span>
                                    <span class="detail-info" th:if=" ${accessCard.type == 1}" th:text="${accessCard.residentialName + ' - ' +accessCard.unitName + ' - ' + accessCard.roomName}"></span>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">卡号：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="cardNo"th:value="${accessCard.cardNo}"  lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" maxlength="16">
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">卡有效期：</label>
                                <div class="layui-input-inline" style="width:316px;">
                                    <input type="text"  class="layui-input date-icon" id="card_date"  placeholder="请选择卡号有效期" autocomplete="off" lay-verify="required">
                                    <input type="hidden" lay-verify="required" th:value="${#dates.format(accessCard.beginDate, 'yyyy-MM-dd HH:mm:ss')}" name="beginDate" id="begin_date"/>
                                    <input type="hidden" lay-verify="required" th:value="${#dates.format(accessCard.endDate, 'yyyy-MM-dd HH:mm:ss')}" name="endDate" id="end_date"/>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-filter="submit_button" lay-submit >保存</button>
                            <button type="reset" id="cancel_btn" class="layui-btn layui-btn-primary">取消</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- javascript -->
        <script th:src="@{'/layui/layui.js'}"></script>
        <script>
            layui.config({
                base: '/' //静态资源所在路径
            });
        </script>
        <script th:src="@{'/js/estate/access-card-edit.js'}"></script>
    </body>
</html>