<div class="content-heading  justify-content-between">
  <div>分考点统计</div>
  <div class="float-right">
    <div class="row">
      <div *ngIf="agentArray && agentArray.length>1" class="ml-3" style="width:200px;">
        <ngx-select [items]="agentArray" [(ngModel)]="agent_id" (ngModelChange)="changAgent()"
                    optionValueField="agent_id" optionTextField="agent_name"></ngx-select>
      </div>
      <div class="ml-3"  style="width:100px;">
        <ngx-select [items]="batchArr" [(ngModel)]="batch_id" (ngModelChange)="changAgent()"
                    optionValueField="dict_value" optionTextField="dict_text"></ngx-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)="downloadReport()">下载报表</a>
          <div class="dropdown-divider"></div>
        </div>
      </div>
    </div>
  </div>
</div>

<tabset class="bg-white p-0" justified="true">

  <tab>
    <ng-template tabHeading>
      <em class="fas fa-map fa-fw"></em> 考点汇总
    </ng-template>
    <div class="table-responsive bg-white table-full">
      <table class="table table-striped table-hover table-bordered">
        <thead>
        <tr>
          <th>考点代码</th>
          <th>考点名称</th>
          <th>考点地址</th>
          <th>缴费总金额</th>
          <th>缴费人次</th>
          <th>缴费人数</th>
          <th>本省人数</th>
          <th>外省人数</th>
        </tr>
        </thead>
        <tbody>
        <tr *ngFor="let v of agentAjax.getArray(); let i = index">
          <td>{{v.agent_id}}</td>
          <td>{{v.agent_name}}</td>
          <td>{{v.agent_addr}}</td>
          <td>{{v.enrol_fee_total | currency:'CNY' }}</td>
          <td>{{v.pay_total}}</td>
          <td>{{v.std_total}}</td>
          <td>{{v.province_total}}</td>
          <td>{{v.outside_total}}</td>
        </tr>
        </tbody>
      </table>
    </div>
    <frame-ajax [url]="'./enrol/report/agent.htm'" [autoRequest]="false" [ajaxDataType]="'array'"
                #agentAjax></frame-ajax>
  </tab>

  <tab>
    <ng-template tabHeading>
      <em class="fas fa-map fa-fw"></em> 大类统计
    </ng-template>
    <div class="table-responsive bg-white table-full">
      <table class="table table-striped table-hover table-bordered">
        <thead>
        <tr>
          <th>代码</th>
          <th>大类名称</th>
          <th>缴费人次</th>
        </tr>
        </thead>
        <tbody>
        <tr *ngFor="let v of categoryAjax.getArray(); let i = index">
          <td>{{v.category_code}}</td>
          <td>{{v.category_name}}</td>
          <td>{{v.pay_total}}</td>
        </tr>
        <tr>
          <td [colSpan]="2">合计</td>
          <td>{{categoryAjax.getArray() | frameSum:'pay_total'}}</td>
        </tr>
        </tbody>
      </table>
    </div>
    <frame-ajax [url]="'./enrol/report/agent/category.htm'" [autoRequest]="false" [ajaxDataType]="'array'"
                #categoryAjax></frame-ajax>
  </tab>

  <tab>
    <ng-template tabHeading>
      <em class="fas fa-map fa-fw"></em> 专业统计
    </ng-template>
    <div class="table-responsive bg-white table-full">
      <table class="table table-striped table-hover table-bordered">
        <thead>
        <tr>
          <th>代码</th>
          <th>专业名称</th>
          <th>品种名称</th>
          <th>缴费人次</th>
          <th>本省人数</th>
          <th>外省人数</th>
        </tr>
        </thead>
        <tbody>
        <tr *ngFor="let v of aspectAjax.getArray(); let i = index">
          <td>{{v.aspect_code}}</td>
          <td>{{v.aspect_name}}</td>
          <td>{{v.variety_name}}</td>
          <td>{{v.pay_total}}</td>
          <td>{{v.province_total}}</td>
          <td>{{v.outside_total}}</td>
        </tr>
        <tr>
          <td [colSpan]="2">合计</td>
          <td [colSpan]="4" align="center">{{aspectAjax.getArray() | frameSum:'pay_total'}}</td>
        </tr>
        </tbody>
      </table>
    </div>
    <frame-ajax [url]="'./enrol/report/agent/aspect.htm'" [autoRequest]="false" [ajaxDataType]="'array'"
                #aspectAjax></frame-ajax>
  </tab>
</tabset>
