<!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="${user.accessCard?.id}" />
                <input type="hidden" name="userId" id="user_id" th:value="${user.id}" />
                <input type="hidden" name="userName" id="user_name" th:value="${user.name}" />
                <input type="hidden" name="residentialId" id="residential_id" th:value="${user.residentialId}" />
                <input type="hidden" name="residentialName" id="residential_name" th:value="${user.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:text="${user.name}"></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" id="card_no" name="cardNo" lay-verify="uniquecardNo" th:value="${user.accessCard?.cardNo}" placeholder="请输入" autocomplete="off" class="layui-input" maxlength="16">
                                <input type="hidden" readonly id="cardEnable" th:value="${user.accessCard?.cardEnable}">
                                <input type="hidden" readonly id="init_card_no" th:value="${user.accessCard?.cardNo}">
                            </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" >
                                <input type="hidden" th:value="${#dates.format(user.accessCard?.beginDate, 'yyyy-MM-dd HH:mm:ss')}" name="beginDate" id="begin_date"/>
                                <input type="hidden" th:value="${#dates.format(user.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 class="layui-btn" id="card_save_btn" lay-filter="save_push_button" lay-submit>下发</button>
                        <button class="layui-btn" id="extension_button" lay-filter="extension_button" lay-submit>延期</button>
                        <!--<button class="layui-btn layui-bg-green" lay-filter="enable_btn" lay-submit>下发</button>-->
                        <!--<button class="layui-btn layui-btn-danger" lay-filter="delete_btn" lay-submit>删除</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-user-card-set.js'}"></script>
    </body>
</html>
