<div class="panel panel-default">
  <!--标题-->
  <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" [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 (ngSubmit)="framePager.goSearch()" class="form-inline">
              <table>
                <tr>
              <!-- <div class="input-group mr-1 input-group-sm">
                <label>关键字：</label>
                <input name="keyword" [(ngModel)]="query.query" class="input-sm form-control" type="text" value=""
                  maxlength="64" placeholder="请输入查询关键字">
              </div> -->
              <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]="YEAR_CODE_URL" respDataPath="array" optionValueField="year_code"
                  optionTextField="year_code" [(ngModel)]="query.year_code" placeholder="请选择"
                  [ngModelOptions]="{standalone: true}" width="130" noResultsFound="无数据">
                </flex-select>

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

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

              </div>
            </td>
            <td>
              <div class="input-group mr-1 input-group-sm">
                <label>申报专业：</label>
                <flex-select [allowClear]="true" [(items)]="majorList" optionValueField="id"
                  optionTextField="major_name" [(ngModel)]="query.mr_id" placeholder="请选择"
                  [ngModelOptions]="{standalone: true}" width="130" noResultsFound="无数据">
                </flex-select>
              </div>
            </td>
            </tr>
            <tr>
                <td>
              <div class="input-group mr-1 input-group-sm">
                <label>审核状态：</label>
                <select name="status" [(ngModel)]="query.status" frameDict [dictName]="'record_status'" style="width: 180px;"
                  class="form-control">
                </select>
              </div>
              </td>
              <td>
              <div class="input-group mr-1 input-group-sm">
                <label>准考证号：</label>
                <input name="ticket_no" [(ngModel)]="query.ticket_no" class="input-sm form-control" type="text" value="" style="width: 180px;"
                  maxlength="64" placeholder="请输入准考证号">
              </div>
            </td>
            <td>
              <div class="input-group mr-1 input-group-sm">
                <label>开考专业：</label>
                <flex-select [allowClear]="true"
                      [url]= "'pl/plMajor/openMajorList.htm'"
                      #major_code
                      respDataPath= "array"
                      optionValueField="major_code"
                      optionTextField="full_name"
                      [(ngModel)]="query.major_code"
                      placeholder="请选择"
                      width = "130"
                      noResultsFound = "无数据"
                      [ngModelOptions]="{standalone: true}"
                      >
                    </flex-select>
              </div>
            </td>
            <td>
              <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>
              </td>
              </tr>
              </table>
              </form>
          </div>
        </div>

        <!-- 工具栏 -->
        <div class="row mb-2" [hidden]="editShowType=='only'">
          <div class="col-lg-12">
            <div class="pull-left" style="text-align: right;">

              <button class="btn mr-1 btn-sm btn-primary" (click)="audit()" data-toggle="tooltip" data-placement="left"
                title="审核通过并归档">
                <i class="fa fa-check">审核通过并归档</i>
              </button>

              <button class="btn mr-1 btn-sm btn-danger" (click)="reject()" data-toggle="tooltip" data-placement="left"
                title="驳回学校">
                <i class="fa fa-times">驳回学校</i>
              </button>

              <button class="btn mr-1 btn-sm btn-primary" (click)="checkSchoolFile()" data-toggle="tooltip"
                data-placement="left" title="查看文件">
                <i class="fa fa-download">查看文件</i>
              </button>

              <button id="btnExport" class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left"
                title="导出" (click)="exportNet()">
                <i class="fa icon-cloud-download"></i>导出</button>
                <button id="btnExport" class="btn btn-primary mr-1 btn-sm" data-toggle="tooltip" data-placement="left"
                title="导出" (click)="exportJionAndExists()">
                <i class="fa icon-cloud-download"></i>导出历史批次已存在备案</button>
            </div>

          </div>
        </div>

        <!--表格-->
        <div class="row">
          <div class="col-lg-12 ml-0" [hidden]="editShowType=='only'">
            <table class="table table-sm table-striped table-hover table-bordered bg-white">
              <thead>
                <tr>
                  <th>
                    <div class="checkbox c-checkbox">
                      <label>
                        <input type="checkbox" (change)="framePager.checkedMasterToggle($event)" />
                        <span class="fa fa-check"></span>
                      </label>
                    </div>
                  </th>

                  <th align="center">批次</th>
                  <th>主考学校</th>
                  <th align="center">准考证号</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">
                  <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 align="center">{{item.year_code}}</td>
                  <td>{{item.org_name}}</td>
                  <td align="center">{{item.ticket_no}}</td>
                  <td>{{item.std_name}}</td>
                  <td>{{item.major_name}}</td>
                  <td>
                    <div *ngIf="item.status==2 " class="text-muted">{{item.status| frameDict: 'record_status'  }}</div>
                    <div *ngIf="item.status==3" class="text-danger">{{item.status| frameDict: 'record_status' }}</div>
                  </td>
                  <td>{{item.std_no}}</td>
                  <td>{{item.std_num}}</td>
                  <td>{{item.junior_grade}}</td>
                  <td>{{item.junior_major}}</td>
                </tr>
              </tbody>
            </table>
            <!-- TODO -->
            <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>
    </div>
  </div>
  <!-- only编辑页面-->
  <div class="col-lg-12" *ngIf="item && editShowType != null &&editShowType =='only'">
    <ng-container *ngTemplateOutlet="editTemplateModal">
    </ng-container>
  </div>

</div>