<div class="content-heading  justify-content-between">
  <div>分省分批次录取报到情况统计</div>
</div>

<div class="row ml-1 mt-3" *ngIf="showSearchCondition==true">
  <div class="col-lg-12">
    <form >
      <table>
        <tr style="height: 60px">
          <td align='right' style="width: 80px">年份：</td>
          <td style="width: 180px"> 
            <input [(ngModel)]="query.year" type="text" style="width: 180px;margin-right: 4px" [ngModelOptions]="{standalone: true}">
          </td>
          <td align='right' style="width: 80px">省份：</td>
          <td style="width: 180px"> 
            <input [(ngModel)]="query.province" type="text" style="width: 180px;margin-right: 4px" [ngModelOptions]="{standalone: true}">
          </td>
          <td align='right' style="width: 80px">批次：</td>
          <td style="width: 180px">
            <input [(ngModel)]="query.batch" type="text" style="width: 180px;margin-right: 4px" [ngModelOptions]="{standalone: true}">
          </td>
          <td align='center' colspan="2">
            <button class="btn btn-primary btn-rounded btn-outline btn-sm  mr-1" (click)="pager.reload();">
                <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 >

  <div class="float-left">
    <div class="input-group">
        <input class="form-control ml-2 mt-2" style="width: 200px;" type="text" [(ngModel)]="query.query" (keyup)="search" placeholder="模糊查询" />
        <div class="input-group-append mt-2" style="height: 35px;">
          <button class="btn btn-outline-secondary bg-white" (click)="pager.goSearch()">
            <em class="fa fas fa-search"></em>
          </button>
        </div>

        <button class="btn btn-primary mt-2 ml-2 mr-1 mb-1 btn-sm "  style="height: 35px;" data-toggle="tooltip" data-placement="left"  (click)="toggleShowSearchCondition()"
      title="高级查询">
      <span *ngIf="showSearchCondition==true">隐藏</span><span *ngIf="showSearchCondition==false">显示</span>高级查询</button>
    </div>
  </div>

  <div class="float-right">
    <div class="btn-group mb-1 mr-1" dropdown>
      <button class="btn dropdown-toggle btn-secondary btn-lg" type="button" dropdownToggle>分省分批次录取报到情况统计管理
        <span class="caret"></span>
      </button>
      <div *dropdownMenu class="dropdown-menu modal-lg" role="menu">
          <a class="dropdown-item" href="#" (click)="uploader.downloadTempalte()">下载省份批次计划数据模版</a>
        <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="#" (click)="uploader.uploadFiles()">导入省份批次计划数据</a>
        <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="#"   (click)="batchDownloadReport()">导出分省分批次录取报到情况统计表</a>
      </div>
    </div>
  </div>

</div>

<div class="table-responsive bg-white table-full">
  <table class="table table-striped table-hover table-bordered">
    <thead>
    <tr>
      <th nowrap><span class="table-sort" >序号</span></th>
      <th nowrap><span class="table-sort" (click)="pager.sort('year')">年份</span></th>
      <th nowrap><span class="table-sort" (click)="pager.sort('province')">省份</span></th>
      <th nowrap><span class="table-sort" (click)="pager.sort('batch')">批次</span></th>
      <th nowrap><span class="table-sort" (click)="pager.sort('plan_num')">计划数</span></th>
      <th nowrap><span class="table-sort" (click)="pager.sort('admission_num')">录取总数</span></th>
      <th nowrap><span class="table-sort" (click)="pager.sort('admission_male_num')">录取男生数</span></th>
      <th nowrap><span class="table-sort" (click)="pager.sort('admission_female_num')">录取女生数</span></th>
      <th nowrap><span class="table-sort" (click)="pager.sort('reported_num')">报道总数</span></th>
      <th nowrap><span class="table-sort" (click)="pager.sort('report_male_num')">报道男生数</span></th>
      <th nowrap><span class="table-sort" (click)="pager.sort('report_female_num')">报道女生数</span></th>
      <th nowrap><span class="table-sort" (click)="pager.sort('registration_rate')">报道率</span></th>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let v of pager.getRecords(); let i = index">
      <td>{{i+1}}</td>
      <td>{{v.year}}</td>
      <td>{{v.province}}</td>
      <td>{{v.batch}}</td>
      <td>{{v.plan_num}}</td>
      <td>{{v.admission_num}}</td>
      <td>{{v.admission_male_num}}</td>
      <td>{{v.admission_female_num}}</td>
      <td>{{v.reported_num}}</td>
      <td>{{v.report_male_num}}</td>
      <td>{{v.report_female_num}}</td>
      <td>{{v.registration_rate}}</td>
    </tr>
    </tbody>
  </table>
  <frame-pager [url]="PAGE_URL" [pagerParams]="query" #pager [showSearch]='false'></frame-pager>
</div>

<frame-uploader [uploadUrl]="'std/batch/batchRegion.htm'" [templateFile]="'模板-导入省份批次计划数.xlsx'" [allowedFileType]="['xlsx']" [confirmMsg]="'确定要继续吗'" (allUpload)="reloadPage()" #uploader></frame-uploader>