<div class="panel panel-default">
  <!--标题-->
  <div class="panel-title">
    <nav aria-label="breadcrumb">
      <ol class="breadcrumb">
        <!-- TODO 
        <li class="breadcrumb-item">学生管理</li>-->
        <li class="breadcrumb-item active" aria-current="page">健康码管理</li>
      </ol>
    </nav>
  </div>
  <div class="panel-body ml-sm" [hidden]="editShowType=='only'">
    <div class="card card-default">
      <div class="card-body">
        <!--查询条件-->
        <div class="row mb-3 ml-1" [hidden]="editShowType=='only'">
          <div class="col-lg-12">
            <form class="form-inline">
              <table>
                <tr>
                  <td>
              <div class="input-group mr-1 input-group-sm">
                  <label>考试批次：</label>
                  <flex-select [allowClear]="true"
                      [url]= "'pl/plExamTime/listtime.htm'"
                      #exam_time_id
                      respDataPath= "array"
                      optionValueField="year_code"
                      optionTextField="exam_year_month"
                      [(ngModel)]="query.year_code"
                      placeholder="请选择"
                      width = "80"
                      noResultsFound = "无数据"
                      [ngModelOptions]="{standalone: true}"
                      >
                  </flex-select>

              </div>
            </td>
            <td>
              <div class="input-group mr-1 input-group-sm">
                <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;姓名：</label>
                <input name="keyword" [(ngModel)]="query.std_name" style="width: 160px" class="input-sm form-control" type="text" value=""
                  maxlength="64">

              </div>
              </td>
              <td>
              <div class="input-group mr-1 input-group-sm">
                <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;证件号：</label>
                <input name="keyword" [(ngModel)]="query.cert_no" style="width: 160px;" class="input-sm form-control" type="text" value=""
                  maxlength="64">

              </div>
              </td>

              <td>
                <div class="input-group mr-1 input-group-sm">
                  <label>准考证号：</label>
                  <input name="keyword" style="width: 160px;" [(ngModel)]="query.ticket_no" class="input-sm form-control" type="text" value=""
                    maxlength="64">
                </div>
              </td>
              
            </tr>

            <tr>
            
              <td>
                <div class="input-group mr-1 input-group-sm">
                  <label>更新时间：</label>
                  <input class=" input-sm form-control"  name="create_date" type="date"  [(ngModel)]="query.create_date" >

                </div>
              </td>

              <td>
                <div class="input-group mr-1 input-group-sm">
                  <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;健康码：</label>
                  <select class="custom-select" style="width:160px;"
                      [ngModelOptions]="{standalone: true}"
                      [(ngModel)]="query.healthcode" 
                      >
                      <option value="">请选择</option>
                      <option [value]="1">红</option>
                      <option [value]="2">黄</option>
                      <option [value]="3">绿</option>
              </select>
              </div>
            </td>
            <td>
              <div class="input-group mr-1 input-group-sm">
                <label>更新状态：</label>
                <select class="custom-select" style="width:160px;"
                    [ngModelOptions]="{standalone: true}"
                    [(ngModel)]="query.status" 
                    >
                    <option value="">请选择</option>
                    <option [value]="1">成功</option>
                    <option [value]="0">失败</option>
                   
            </select>
            </div>
          </td>
          <td></td>
         
            </tr>


            <tr>
             
            
          <td>
              <div class="input-group mr-1 input-group-sm">

                <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;考区：</label>
                <flex-select [allowClear]="true" [url]="EXAM_AREA_URL" #school_id respDataPath="array" optionValueField="id"
                  optionTextField="org_name" [(ngModel)]="query.exam_area_id" placeholder="请选择"
                  [ngModelOptions]="{standalone: true}" width="80" noResultsFound="无数据">
                </flex-select>

              </div>
            </td>
            <td>
              <div class="input-group mr-1 input-group-sm">

                <label>主考学校：</label>
                <flex-select [allowClear]="true" [url]="SCHOOL_URL" #school_id respDataPath="array" optionValueField="id"
                  optionTextField="org_name" [(ngModel)]="query.school_id" placeholder="请选择"
                  [ngModelOptions]="{standalone: true}" width="70" noResultsFound="无数据">
                </flex-select>

              </div>
            </td>
            <td>
              <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(queryForm)">
                <i class="fa fa-undo"></i> 重置</button>
                <button class="btn btn-primary mr-1 btn-sm"  (click)="exportExcel()"  data-toggle="tooltip" data-placement="left">
                  导出Excel
                </button>

                <button class="btn btn-primary mr-1 btn-sm"  (click)="queryStdHealthcode()" title="存在更新失败记录时，可重复点击更新健康码。"  data-toggle="tooltip" data-placement="left">
                  更新健康码
                </button>
              <!-- <button type="submit">提交</button> -->
            </td>
            <td></td>
            </tr>
            </table>
            </form>
          </div>
        </div>

      

        <!--表格-->
        <div class="row">
          <div class="col-lg-12 ml-0" [hidden]="this.editShowType=='only'">
            <table class="table table-sm table-striped table-hover table-bordered bg-white">
              <thead>
                <tr>
                  
                  <th>序号</th>
                  <th>姓名</th>
                  <th>证件号</th>
                  
                  <th align="center">准考证号</th>
                  
                  <th align="center">手机号码</th>
                  <th align="center">健康码</th>
                  <th align="center">更新时间</th>
                  
                  <th>黄或红码的原因</th>
                  <th align="center">是否注册</th>
                  <th align="center">更新状态</th>
                  <th>备注</th>
                </tr>
              </thead>
              <tbody>
                <tr *ngFor="let item of framePager.getRecords(); let i = index">
                  
                  <td>{{framePager.pageStart + i}}</td>

                  <td>{{item.std_name}}</td>
                  <td>{{item.cert_no}}</td>
                  <!-- <td>{{item.enrol_no}}</td> -->
                  <td align="center">{{item.ticket_no}}</td>
                  <!-- <td>{{item.school_code}}</td> -->
                  <td align="center">{{item.std_mobile}}</td>
                  <td align="center">
                    <font *ngIf="item.healthcode=='1'" style="color:red">红</font>
                    <font *ngIf="item.healthcode=='2'" style="color:#FB8F21">黄</font>
                    <font *ngIf="item.healthcode=='3'" style="color:green">绿</font>


                  </td>
                  <td align="center">{{item.create_date}}</td>
                 
                  <td>{{item.reason}}</td>

                  <td align="center">
                    <font *ngIf="item.status=='1'">已注册</font>
                    <font *ngIf="item.status=='0'">未注册</font>
                  </td>

                  <td align="center">
                    <font *ngIf="item.status=='1'">成功</font>
                    <font *ngIf="item.status=='0'">失败</font>
                  </td>
                  
                  <td>{{item.remark}}</td>
                 

                  
                </tr>
              </tbody>
            </table>
            <!-- TODO -->
            <frame-pager [url]="QUERY_URL" hideSearch="true" [autoLoad]="false" hasCheck="true" #framePager (preReqEvent)="search($event)"></frame-pager>
          </div>

        </div>

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