
<div *ngIf="!inTimeFlag">
    <div class="panel panel-default">
      <ul class="list-group">
        <li class="list-group-item text-center" >
            <h4>不在报考时间范围内！</h4>
        </li>
      </ul>
    </div>
  </div>


<div class="panel panel-default" *ngIf="inTimeFlag">
  <!--标题-->
  <div class="panel-title">
    <nav aria-label="breadcrumb">
      <ol class="breadcrumb">
        <li class="breadcrumb-item">报考管理</li>
        <li class="breadcrumb-item active" aria-current="page">集体报考</li>
      </ol>
    </nav>
  </div>

  <div class="panel-body ml-sm">
    <div class="card card-default">
      <div class="card-body">
        <!--查询条件-->
        <div class="row mb-3 ml-1">
          <div class="col-lg-12">
            <form (ngSubmit)="framePager.goSearch()" class="form-inline">
              <div class="input-group mr-1 input-group-sm">
                <label>关键字：</label>
                <input name="keyword" [(ngModel)]="query.query" class="input-sm form-control" type="text" placeholder="请输入查询关键字"
                  maxlength="64">
              </div>

              <div class="input-group mr-1 input-group-sm">
                <label>缴费状态：</label>
                <select name="fee_status" [(ngModel)]="query.fee_status" frameDict [dictName]="'FeeStatus'" class="form-control">
                </select>
              </div>

              <button class="btn btn-primary btn-rounded btn-outline btn-sm  mr-1" (click)="framePager.goSearch()">
                <i class="fa fa-search"></i> 查询</button>
              <button class="btn btn-primary btn-rounded btn-outline btn-sm  mr-1" (click)="reset()">
                <i class="fa fa-undo"></i> 重置</button>
                &nbsp;&nbsp;&nbsp;&nbsp;<span class="text-danger">
                    现场报考开始时间: <strong style="font-size: 1.25rem">{{timeArr.start_time}}</strong> ，结束时间：<strong style="font-size: 1.25rem">{{timeArr.end_time}}</strong></span>
            </form>
          </div>
        </div>

        <!-- 工具栏 -->
        <div class="row mb-2">
          <div class="col-lg-12">
            <div class="pull-left" style="text-align: right;">
              <button class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left" (click)="fee('pay')"
                title="已缴费">
                <i class="fa fa-plus"></i> 已缴费</button>
              <button class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left" title="未缴费"
                (click)="fee('noPay')">
                <i class="fa fa-parking"></i> 未缴费</button>
              <button class="btn mr-1 btn-sm bg-danger" (click)="delete()" data-toggle="tooltip" data-placement="left"
                title="删除">
                <i class="fa fa-trash"> 删除</i>
              </button>
              <button class="btn btn-primary mr-1 btn-sm" (click)="downloadTemplate()" data-toggle="tooltip" data-placement="left"
                title="模板下载">
                <i class="fa fa-download"> 模板下载</i>
              </button>
              <button class="btn btn-primary mr-1 btn-sm"  (click)="upload()"  data-toggle="tooltip" data-placement="left" title="批量报考导入">
                <i class="fa fa-file-excel"> 批量报考导入</i>
              </button>
              <button class="btn btn-primary mr-1 btn-sm"  (click)="print()"  data-toggle="tooltip" data-placement="left" title="批量报考导入">
                <i class="fa icon-printer"> 报考校对单</i>
              </button>
              <button class="btn btn-primary mr-1 btn-sm"  (click)="export()"  data-toggle="tooltip" data-placement="left" title="导出">
                <i class="fa icon-cloud-download"> 导出</i>
              </button>
              <button type="button" class="btn btn-warning btn-xs ml-2" (click)="downloadErrFile()" *ngIf="filePath">
                  <span class="icon-close mr"></span> 下载错误数据
                </button>
               
            </div>
          </div>
        </div>

        <!--表格-->
        <div class="row">
          <div class="col-lg-12 ml-0">
            <table class="table table-sm table-striped table-hover table-bordered bg-white">
              <thead>
                <tr>
                  <th>
                    <div class="checkbox c-checkbox">
                      <label class="nomargin">
                        <input type="checkbox" (change)="framePager.checkedMasterToggle($event)" />
                        <span class="fa fa-check"></span>
                      </label>
                    </div>
                  </th>
                  <th>批次</th>
                  <th>考生姓名</th>
                  <th>身份证号</th>
                  <th align="center">准考证号</th>
                  <th>课程名称</th>
                  <th>专业名称</th>
                  <th align="center">考试时间</th>
                  <th>报考考区</th>
                  <th align="center">录入时间</th>
                  <th align="center">报考类型</th>
                  <th>缴费状态</th>
                  <!-- <th>收费人</th> -->
                </tr>
              </thead>
              <tbody>
                <tr *ngFor="let item of framePager.getRecords(); let i = index">
                  <td>
                    <div class="checkbox c-checkbox input-group-sm">
                      <label class="nomargin">
                        <input type="checkbox" [value]="item.id" [(checked)]="item.isChecked" [(ngModel)]="item.isChecked" />
                        <span class="fa fa-check"></span>
                      </label>
                    </div>
                  </td>

                  <td align="center">{{item.exam_year_month}}</td>
                  <td>{{item.std_name}}</td>
                  <td>{{item.cert_no}}</td>
                  <td align="center">{{item.ticket_no}}</td>
                  <td>{{item.course_full_name}}</td>
                  <td>{{item.major_full_name}}</td>
                  <td align="center">{{item.full_exam_date}}</td>
                  <td>{{item.org_name}}</td>
                  <td align="center">{{item.create_time}}</td>
                  <td align="center">{{item.enrol_type | frameDict: 'EnrolType'}}</td>
                  <td>
                    <div *ngIf="item.fee_status==have_pay" class="text-danger">{{item.fee_status| frameDict:
                      'FeeStatus' }}</div>
                    <div *ngIf="!item.fee_status || item.fee_status==no_pay " class="text-muted">{{item.fee_status| frameDict: 'FeeStatus'
                      }}</div>
                  </td>
                  <!-- <td>{{item.fee_earner}}</td> -->
                </tr>
              </tbody>
            </table>
            <frame-pager [url]="QUERY_URL" hideSearch="true" hasCheck="true" #framePager (preReqEvent)="search($event)"></frame-pager>
          </div>

        </div>


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

</div>

<div class="mt-5">
    <frame-uploader #uploader [silenceUpload]="true" [autoUpload]="true" [uploadUrl]="UPLOAD_URL"></frame-uploader>
</div>

<!-- 批量导入界面 -->
<ng-template #exportTemplateModal>
  <div class="modal-content">

    <div class="modal-header info-success-qm">
      <div class="pull-left">
        <em class="fa-lg fas fa-edit "></em>批量报考
      </div>
      <button type="button" class="close" (click)="hideModal()">×</button>
    </div>

    <div class="modal-body">
      <div [ngTemplateOutlet]="exportFormTemplate"></div>
    </div>

    <div class="modal-footer">
      <button class="btn btn-default" (click)="hideModal()">
        <i class="icon-close"> </i> 取消
      </button>
    </div>

  </div>
</ng-template>

<!--文件上传-->
<ng-template #exportFormTemplate>
  <div class="row">
    <frame-uploader #uploader [silenceUpload]="false" [autoUpload]="true" [uploadUrl]="UPLOAD_URL"  ></frame-uploader>
  </div>
</ng-template>