<div class="content-heading  justify-content-between">
  <div>报考专业统计<span *ngIf="category"> - {{category.category_name}}</span></div>
  <div class="float-right">
    <div class="row">
      <div *ngIf="categoryArray && categoryArray.length>1" class="ml-3 wd-sm">
        <select class="form-control mt-1" [(ngModel)]="category_id" (ngModelChange)="changCategory()">
          <option [value]="v['category_id']" *ngFor="let v of categoryArray">{{v['category_name']}}</option>
        </select>
      </div>
      <div class="ml-3">
        <select class="form-control mt-1" [(ngModel)]="batch_id" (ngModelChange)="changCategory()">
          <option [value]="v.dict_value" *ngFor="let v of batchArr">{{v.dict_text}}</option>
        </select>

      </div>
      <div class="btn-group  ml-3" dropdown>
        <button class="btn dropdown-toggle btn-secondary" type="button" dropdownToggle>报表管理
          <span class="caret"></span>
        </button>
        <div *dropdownMenu class="dropdown-menu modal-lg" role="menu">
          <!-- <a class="dropdown-item" href="#"
             (click)="FuncService.ajaxDownload('frame/report/download.htm', {report_name:'EnrolReportAspect', report_title :'报考统计报表(分专业统计)'})">下载报表</a> -->
          <a class="dropdown-item" href="#" (click)="downloadReport()">下载报表</a>
          <div class="dropdown-divider"></div>
        </div>
      </div>
    </div>
  </div>
</div>
<div class="table-responsive bg-white table-full">
  <table class="table table-striped table-hover table-bordered">
    <thead>
    <tr>
      <th><span class="table-sort" (click)="pager.sort('aspect_code')">专业代码</span></th>
      <th><span class="table-sort" (click)="pager.sort('aspect_name')">专业名称</span></th>
      <th><span class="table-sort" (click)="pager.sort('enrol_total')">报考人数</span></th>
      <th><span class="table-sort" (click)="pager.sort('pay_total')">缴费人数</span></th>
      <th><span class="table-sort" (click)="pager.sort('man_total')">缴费(男)</span></th>
      <th><span class="table-sort" (click)="pager.sort('women_total')">缴费(女)</span></th>
      <th><span class="table-sort" (click)="pager.sort('province_total')">缴费(本省)</span></th>
      <th><span class="table-sort" (click)="pager.sort('outside_total')">缴费(省外)</span></th>
      <th><span class="table-sort" (click)="pager.sort('province_man_total')">缴费(本省男)</span></th>
      <th><span class="table-sort" (click)="pager.sort('province_women_total')">缴费(本省女)</span></th>
      <th><span class="table-sort" (click)="pager.sort('outside_man_total')">缴费(省外男)</span></th>
      <th><span class="table-sort" (click)="pager.sort('outside_women_total')">缴费(省外女)</span></th>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let v of pager.getRecords(); let i = index">
      <td>{{v.aspect_code}}</td>
      <td>{{v.aspect_name}}</td>
      <td><a href="#" (click)="showStudentDetail(v, null,null,null)">{{v.enrol_total}}</a></td>
      <td><a href="#" (click)="showStudentDetail(v, 'Active',null,null)">{{v.pay_total}}</a></td>
      <td><a href="#" (click)="showStudentDetail(v, 'Active','男',null)">{{v.man_total}}</a></td>
      <td><a href="#" (click)="showStudentDetail(v, 'Active','女',null)">{{v.women_total}}</a></td>
      <td><a href="#" (click)="showStudentDetail(v, 'Active', null,'Active')">{{v.province_total}}</a></td>
      <td><a href="#" (click)="showStudentDetail(v, 'Active', null,'InActive')">{{v.outside_total}}</a></td>
      <td><a href="#" (click)="showStudentDetail(v, 'Active', '男','Active')">{{v.province_man_total}}</a></td>
      <td><a href="#" (click)="showStudentDetail(v, 'Active', '女','Active')">{{v.province_women_total}}</a></td>
      <td><a href="#" (click)="showStudentDetail(v, 'Active', '男','InActive')">{{v.outside_man_total}}</a></td>
      <td><a href="#" (click)="showStudentDetail(v, 'Active', '女','InActive')">{{v.outside_women_total}}</a></td>
    </tr>
    <tr>
      <td [colSpan]="2">合计</td>
      <td><a href="#" (click)="showStudentDetail(null, null,null,null)">{{pager.getRecords() | frameSum:'enrol_total'}}</a></td>
      <td><a href="#" (click)="showStudentDetail(null, 'Active',null,null)">{{pager.getRecords() | frameSum:'pay_total'}}</a></td>
      <td><a href="#" (click)="showStudentDetail(null, 'Active','男',null)">{{pager.getRecords() | frameSum:'man_total'}}</a></td>
      <td><a href="#" (click)="showStudentDetail(null, 'Active','女',null)">{{pager.getRecords() | frameSum:'women_total'}}</a></td>
      <td><a href="#" (click)="showStudentDetail(null, 'Active', null,'Active')">{{pager.getRecords() | frameSum:'province_total'}}</a></td>
      <td><a href="#" (click)="showStudentDetail(null, 'Active', null,'InActive')">{{pager.getRecords() | frameSum:'outside_total'}}</a></td>
      <td><a href="#" (click)="showStudentDetail(null, 'Active', '男','Active')">{{pager.getRecords() | frameSum:'province_man_total'}}</a></td>
      <td><a href="#" (click)="showStudentDetail(null, 'Active', '女','Active')">{{pager.getRecords() | frameSum:'province_women_total'}}</a></td>
      <td><a href="#" (click)="showStudentDetail(null, 'Active', '男','InActive')">{{pager.getRecords() | frameSum:'outside_man_total'}}</a></td>
      <td><a href="#" (click)="showStudentDetail(null, 'Active', '女','InActive')">{{pager.getRecords() | frameSum:'outside_women_total'}}</a></td>
    </tbody>
  </table>
  <frame-pager [url]="'./enrol/report/aspect.htm'" [pagerLimit]="100" [autoRequest]="false"  #pager></frame-pager>
</div>

