{{:ModuleInclude('public/header')}}

<style>
    .page-title {
        font-size: 18px;
        font-weight: 600;
        color: #1a1a2e;
        padding: 24px 0 16px 0;
        border-bottom: 2px solid #e8e8e8;
        margin-bottom: 20px;
    }
</style>

<div class="right-content">
    <div class="page-title">
        <i class="am-icon-user am-margin-right-sm"></i>核销员管理
    </div>

    <!-- 搜索栏 -->
    <div class="am-panel am-panel-default am-radius am-margin-bottom-sm">
        <div class="am-panel-bd am-cf">
            <form action="{{:PluginsAdminUrl('vr_ticket', 'admin', 'VerifierList')}}" method="POST" class="am-form form-validation form-search am-fl" request-type="form">
                <div class="am-input-group am-input-group-sm am-fl" style="width: 200px;">
                    <input type="text" name="keywords" value="{{$keywords|default=''}}" placeholder="搜索名称/用户ID" class="am-radius" />
                </div>
                <div class="am-input-group am-input-group-sm am-fl am-margin-left-xs" style="width: 120px;">
                    <select name="status" class="am-radius">
                        <option value="">全部状态</option>
                        <option value="1" {{if isset($status) && $status==1}}selected{{/if}}>启用</option>
                        <option value="0" {{if isset($status) && $status==0}}selected{{/if}}>禁用</option>
                    </select>
                </div>
                <button type="submit" class="am-btn am-btn-primary am-btn-xs am-radius am-fl am-margin-left-xs" data-am-loading="{spinner:'circle-o-notch', loadingText:'搜索中...'}">
                    <i class="am-icon-search"></i> 搜索
                </button>
                <a href="{{:PluginsAdminUrl('vr_ticket', 'admin', 'VerifierList')}}" class="am-btn am-btn-default am-btn-xs am-radius am-fl am-margin-left-xs">
                    <i class="am-icon-refresh"></i> 重置
                </a>
            </form>
            <a href="{{:PluginsAdminUrl('vr_ticket', 'admin', 'VerifierSave')}}" class="am-btn am-btn-success am-btn-xs am-radius am-fr">
                <i class="am-icon-plus"></i> 添加核销员
            </a>
        </div>
    </div>

    <!-- 表格 -->
    <div class="am-panel am-panel-default am-radius">
        <div class="am-panel-hd">核销员列表 <span class="am-text-xs am-padding-left">共 {{$count|default=0}} 条</span></div>
        <div class="am-panel-bd am-scrollable-horizontal">
            <table class="am-table am-table-striped am-table-hover am-text-middle am-margin-bottom-0">
                <thead>
                    <tr>
                        <th class="am-text-center" width="60">ID</th>
                        <th class="am-text-left">核销员名称</th>
                        <th class="am-text-left">关联用户</th>
                        <th class="am-text-center" width="80">状态</th>
                        <th class="am-text-left">添加时间</th>
                        <th class="am-text-right" width="160">操作</th>
                    </tr>
                </thead>
                <tbody>
                    {{if !empty($list)}}
                    {{foreach $list as $item}}
                    <tr id="data-list-{{$item.id}}">
                        <td class="am-text-center">{{$item.id}}</td>
                        <td>{{$item.name}}</td>
                        <td>{{$item.user_name|default='-'}}</td>
                        <td class="am-text-center">
                            {{if $item.status == 1}}
                            <span class="am-badge am-badge-success am-radius">启用</span>
                            {{else}}
                            <span class="am-badge am-badge-danger am-radius">禁用</span>
                            {{/if}}
                        </td>
                        <td>{{if !empty($item.created_at)}}{{$item.created_at|date='Y-m-d H:i'}}{{else}}-{{/if}}</td>
                        <td class="am-text-right view-operation">
                            <a href="{{:PluginsAdminUrl('vr_ticket', 'admin', 'VerifierSave', ['id'=>$item.id])}}" class="am-btn am-btn-secondary am-btn-xs am-radius">
                                <i class="am-icon-edit"></i> 编辑
                            </a>
                            {{if $item.status == 1}}
                            <button type="button" class="am-btn am-btn-warning am-btn-xs am-radius am-margin-left-xs submit-ajax" data-url="{{:PluginsAdminUrl('vr_ticket', 'admin', 'VerifierDelete')}}" data-id="{{$item.id}}" data-view="reload" data-msg="确定要禁用该核销员？">
                                <i class="am-icon-ban"></i> 禁用
                            </button>
                            {{else}}
                            <button type="button" class="am-btn am-btn-success am-btn-xs am-radius am-margin-left-xs submit-ajax" data-url="{{:PluginsAdminUrl('vr_ticket', 'admin', 'VerifierDelete')}}" data-id="{{$item.id}}" data-value="enable" data-view="reload" data-msg="确定要启用该核销员？">
                                <i class="am-icon-check"></i> 启用
                            </button>
                            {{/if}}
                        </td>
                    </tr>
                    {{/foreach}}
                    {{else}}
                    <tr>
                        <td colspan="6" class="am-text-center">暂无数据</td>
                    </tr>
                    {{/if}}
                </tbody>
            </table>

            <!-- 分页 -->
            {{if !empty($page)}}
            <div class="am-margin-top-sm">
                {{$page|raw}}
            </div>
            {{/if}}
        </div>
    </div>
</div>

{{:ModuleInclude('public/footer')}}