<ng-container *ngIf="agent">

  <div class="content-heading  justify-content-between">
    <div>准考证 - {{agent?.ly_agent_name}}</div>
    <div class="float-right">
      <div class="row">


        <div class="ml-3 mr-2">
          <select class="form-control mt-1" [(ngModel)]="batch_id" (ngModelChange)="reloadTicket()">
            <option value="" >全部</option>
            <option [value]="v.dict_value" *ngFor="let v of batchArr">{{v.dict_text}}</option>
          </select>
        </div>

        <div class="btn-group  ml-3" dropdown *ngIf="FrameService.FrameOptr.optr_id == 0">
          <button class="btn dropdown-toggle btn-secondary" type="button" dropdownToggle>准考证管理
            <span class="caret"></span>
          </button>
          <div *dropdownMenu class="dropdown-menu modal-lg" role="menu">
            <a class="dropdown-item" href="#" (click)="pullTicketData()">拉取数据</a>
            <div class="dropdown-divider"></div>
          </div>
        </div>

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


  <div class="table-responsive bg-white table-full">
    <table class="table table-striped table-hover table-bordered">
      <thead>
        <tr>
          <th>准考证号</th>
          <th>考生姓名</th>
          <th>证件号码</th>
          <th>公安验证</th>
          <th>生源地</th>
          <th>考生性别</th>
          <th>联系电话</th>
          <th>初/复试</th>
          <th class="th-b-2"></th>
        </tr>
      </thead>
      <tbody>
        <tr *ngFor="let v of pager.getRecords(); let i = index">
          <td>{{v.ticket_no}}</td>
          <td>{{v.std_name}}</td>
          <td>{{v.cert_id}}</td>
          <td [innerHTML]="v.std_verify_flag | frameStatusCustom: ['已通过','']">{{v.std_verify_flag }}</td>
          <td>{{v.province_name}}</td>
          <td>{{v.std_sex}}</td>
          <td>{{v.std_mobile}}</td>
          <td>{{v.ticket_batch | frameDict: 'ExamBatchName'}}</td>
          <td>
            <div class="btn-group" dropdown style="margin-top: -2px;">
              <button class="btn dropdown-toggle btn-secondary btn-sm" type="button" dropdownToggle>准考证
                <span class="caret"></span>
              </button>
              <div *dropdownMenu class="dropdown-menu modal-lg" role="menu">
                <a class="dropdown-item" href="#" (click)="downloadTicket(v)" *ngIf="v.ticket_file_name">下载</a>
              </div>
            </div>
          </td>
        </tr>
      </tbody>
    </table>
    <frame-pager [url]="'./ly/std/ticket/result/page.htm'" #pager [pagerParams]="{ly_agent_id: agent.ly_agent_id, batch_id: batch_id}"
      [autoRequest]="false"></frame-pager>
  </div>
</ng-container>
