<div class="panel panel-default">
  <div>
    <!--标题-->
    <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>

  <div class="panel-body ml-sm " [hidden]="editShowType=='only'">
    <!--查询条件-->
    <div class="row mb-3 ml-1" [hidden]="editShowType=='only'">
      <div class="col-lg-12">
        <form (ngSubmit)="framePager.goSearch()" class="form-inline">
          <!-- 支持排序 -->
          <table>
            <tr>
        <td>
          <div class="input-group mr-1 input-group-sm">
            <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;批次：</label>
            <select [(ngModel)]="query.exam_time_id" class="custom-select" style="width:140px;" [ngModelOptions]="{standalone: true}" (change)="changetime()">
            <option value="">请选择</option>
            <option *ngFor="let time of timeList" value="{{time.id}}">
              {{time.examyearmonth}}
            </option>
          </select>
          </div>
        </td>
        <td>
          <div class="input-group mr-1 input-group-sm">
            <label>地市：</label>
            <select [(ngModel)]="query.dishidaiha" class="custom-select" style="width:150px;" [ngModelOptions]="{standalone: true}" (change)="changedishi()">
              <option value="">全区</option>
              <option *ngFor="let city of cityList" value="{{city.dishidaiha}}">
                {{city.dishimingc}}
              </option>
            </select>

            
          </div>
        </td>

        <td>
         
            <div class="input-group mr-1 input-group-sm">
              <label>考区：</label>
              <select [(ngModel)]="query.kaoqudaiha" class="custom-select" style="width:150px;" [ngModelOptions]="{standalone: true}" (change)="changekaoqu()" >
                <option value="">所有</option>
                <option *ngFor="let school of schoolList" value="{{school.kaoqudaiha}}">
                  {{school.kaoqumingc}}
                </option>
              </select>

            </div>
         
        </td>

        <td>
         
          <div class="input-group mr-1 input-group-sm">
            <label>考点：</label>
            <select [(ngModel)]="query.kaodiandai" class="custom-select" style="width:150px;" [ngModelOptions]="{standalone: true}" >
              <option value="">所有</option>
              <option *ngFor="let point of pointList" value="{{point.kaodiandai}}">
                {{point.kaodiandai}}-{{point.kaodianmin}}
              </option>
            </select>

          </div>
       
      </td>

        </tr>
        <tr>
            <td>
                <div class="input-group mr-1 input-group-sm">
                    <label>是否网评：</label>
                    <select name="pj_type" [(ngModel)]="query.pj_type" class="custom-select" style="width: 100px;">
                        <option value="">请选择</option>
                        <option value="1">是</option>
                        <option value="2">否</option>
                        
                      </select>
                  </div>

          </td>
          <td>
              <div class="input-group mr-1 input-group-sm">
                  <label>课程：</label>
                  <flex-select [allowClear]="true" [(items)]="courseList" respDataPath="array"
                      optionValueField="kechengdai" optionTextField="mingcheng"
                       [(ngModel)]="query.kechengdai"
                      [ngModelOptions]="{standalone: true}" placeholder="请选择" width="150"
                      noResultsFound="无数据">
                  </flex-select>
                </div>
        </td>

        <td>
         
          <div class="input-group mr-1 input-group-sm">
            <label>场次：</label>
            <select [(ngModel)]="query.kaoshicish" class="custom-select" style="width:150px;" [ngModelOptions]="{standalone: true}" >
              <option value="">全部</option>
              <option *ngFor="let cish of cishList" value="{{cish.kaoshicish}}">
                {{cish.changname}}
              </option>
            </select>

          </div>
       
      </td>
        
        <td align="right">
            
          <button class="btn btn-primary btn-rounded btn-outline btn-sm  mr-1">
            <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>
            <button class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left"
            (click)="buildSecurity()" title="生成保密号数据，请在考场编排完成后进行。">
            <i class="fa fa-plus"></i> 生成保密号数据</button>
          </td>
          </tr>
          </table>
          </form>
      </div>
    </div>

    <!-- 工具栏 -->
    <div class="row mb-2" [hidden]="editShowType=='only'">
      <div class="col-lg-12">
        <div class="pull-left">
          
          <button class="btn btn-primary mr-1 btn-sm" (click)="exportSecurityCodeThreePdf()" data-toggle="tooltip" data-placement="left"
            title="保密号标签打印表.pdf">
            <i class="fa icon-cloud-download"> 保密号标签打印</i>
          </button>
          <button class="btn btn-primary mr-1 btn-sm" (click)="exportSecurityCodeThreePdf('one')" data-toggle="tooltip" data-placement="left"
            title="保密号标签打印表.pdf">
            <i class="fa icon-cloud-download"> 打印选中行保密号标签</i>
          </button>
          <button class="btn btn-primary mr-1 btn-sm" (click)="exportSecurityCodeOnePdf()" data-toggle="tooltip" data-placement="left"
            title="保密号标签打印表.pdf">
            <i class="fa icon-cloud-download"> 考场信息表打印</i>
          </button>
          <button class="btn btn-primary mr-1 btn-sm" (click)="exportSecurityCodeOnePdf('one')" data-toggle="tooltip" data-placement="left"
            title="保密号标签打印表.pdf">
            <i class="fa icon-cloud-download"> 打印选中行考场信息表</i>
          </button>

          <button class="btn btn-primary mr-1 btn-sm" (click)="exportSecurityCodeTwoPdf()" data-toggle="tooltip" data-placement="left"
            title="保密号标签打印表.pdf">
            <i class="fa icon-cloud-download"> 考场登记表打印</i>
          </button>
          <button class="btn btn-primary mr-1 btn-sm" (click)="exportSecurityCodeTwoPdf('one')" data-toggle="tooltip" data-placement="left"
            title="保密号标签打印表.pdf">
            <i class="fa icon-cloud-download"> 打印选中行考场登记表</i>
          </button>
          
        </div>

      </div>
    </div>

    <!--表格-->
    <div class="row" [hidden]="editShowType=='only'">
      <div class="col-sm-12 ml-0">
        <table class="table table-sm table-striped table-hover table-bordered bg-white">
          <thead>
            <tr align="center">
            <th>
                <div class="checkbox c-checkbox">
                  <label>
                    <input type="checkbox" (change)="framePager.checkedMasterToggle($event)" />
                    <span class="fa fa-check"></span>
                  </label>
                </div>
              </th>
              <th>序号</th>
              <th>考试场次</th>
              <th>地市</th>
              <th>考区名称</th>
              <th>考点代号</th>
              <th>考场代号</th>
              <th>课程名称</th>
              <th>人数</th>
              <th>保密号</th>
              <th>试卷代号</th>
              <th>试卷代类型</th>
            </tr>
          </thead>
          <tbody>
            <tr *ngFor="let item of framePager.getRecords(); let i = index" align="center">
              <td>
                  <div class="checkbox c-checkbox input-group-sm">
                    <label>
                      <input type="checkbox" [value]="item.id" [(checked)]="item.isChecked"
                        [(ngModel)]="item.isChecked" />
                      <span class="fa fa-check"></span>
                    </label>
                  </div>
              </td>
              <td>{{framePager.pageStart+i}}</td>
              <td>{{item.kaoshicish}}</td>
              <td>{{item.dishimingc}}</td>
              <td>{{item.kaoqumingc}}</td>
              <td>{{item.kaodiandai}}</td>
              <td>{{item.kaochangda}}</td>
              <td>{{item.kechengdai}}-{{item.mingcheng}}</td>
              <td>{{item.renshu}}</td>
              <td>{{item.baomihao}}</td>
              <td>{{item.shijuandai}}</td>
              <td>{{item.dai_type}}</td>
            </tr>
          </tbody>
        </table>
        <frame-pager [url]="QUERY_URL" [autoLoad]="false" hideSearch="true" hasCheck="true" #framePager (preReqEvent)="search($event)">
        </frame-pager>
      </div>
      <!-- 编辑页面 -->
      <div class="col-lg-12" *ngIf="item && editShowType != null &&editShowType!='modal'">
        <ng-container *ngTemplateOutlet="editTemplateModal">
        </ng-container>
      </div>

    </div>
  </div>
  <!-- only编辑页面-->
  <div class="col-lg-12" *ngIf="item && editShowType != null &&editShowType =='only'">
    <ng-container *ngTemplateOutlet="editTemplateModal">
    </ng-container>
  </div>
</div>



