<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sptg="http://www.thymeleaf.org">
    <head>
        <script th:replace="common/head"></script>
        <style>
            .xm-toolbar .toolbar-tag {
                width: 100%;
                display: flex;
                justify-content: center;
                background-color: #1E9FFF!important;
                color: #fff!important;
            }
        </style>
    </head>
    <body style="position: absolute;top:0;bottom: 0;left:0;right: 0;">
        <input type="hidden" id="org_id" th:value="${onLineUser.orgId}" />
        <input type="hidden" id="residentialId" th:value="${residentialId}" />
        <div class="layui-fluid">
            <!-- 下拉树 -->
            <div th:replace="common/org-tree"></div>
            <div class="x-body per-table">
                <div class="layui-card">
                    <div class="layui-form layui-card-header layuiadmin-card-header-auto" style="padding:0;">
                            <div class="layui-inline">
                                <label class="layui-form-label">所属单元</label>
                                <div class="layui-input-block">
                                    <div id="unit_name"></div>
                                    <input id="unit_id" type="hidden" />
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">所属房间</label>
                                <div class="layui-input-block">
                                    <div id="room_name"></div>
                                    <input id="room_id" type="hidden" />
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">卡号</label>
                                <div class="layui-input-block">
                                    <input type="text" name="cardNo" placeholder="请输入" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">有效期</label>
                                <div class="layui-input-block">
                                    <input type="text"  class="layui-input date-icon" id="card_date"  placeholder="请选择" autocomplete="off">
                                    <input type="hidden" id="begin_date"  name="beginDate"/>
                                    <input type="hidden" id="end_date"  name="endDate" />
                                </div>
                            </div>
                            <div class="layui-inline" style="margin-left: 38px;">
                                <button class="layui-btn layuiadmin-btn-useradmin"  lay-submit lay-filter="query">查询</button>
                                <button class="layui-btn  layui-btn-primary"  lay-submit lay-filter="reset">重置</button>
                            </div>
                        </div>
                        <!-- 表格+头部按钮 -->
                        <div class="layui-card-body" style="padding:0;">
                            <div style="padding-bottom: 10px;">
                                <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="add" sptg:security="estate:accessCard:add">添加门禁卡</button>
                                <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="batchdel" sptg:security="estate:accessCard:delete">批量删除</button>
                            </div>
                            <table id="table_id" lay-filter="table_event"></table>
                        </div>

                    </div>

                </div>
            </div>
        </div>

        <script type="text/html" id="table-useradmin-webuser">
            <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit" sptg:security="estate:accessCard:update">修改</a>
            <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del" sptg:security="estate:accessCard:delete">删除</a>
            <a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="log4card" sptg:security="estate:access:cardLog">卡日志</a>
            <a class="layui-btn layui-bg-green layui-btn-xs" lay-event="realNameReg" sptg:security="estate:accessCard:update">门禁卡实名登记</a>
        </script>

        <!-- javascript -->
        <script th:src="@{'/layui/layui.js'}"></script>
        <script>
            layui.config({
                base: '/' //静态资源所在路径
            });
        </script>
        <script th:src="@{'/js/estate/residential-access-card.js'}"></script>
    </body>
</html>