<div class="searchDataWrap">
  <div class="searchData">
    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
  </div>
  <div class="operation">
    <i class="icon_transport transport-gengduo" nz-tooltip nzTooltipTitle="更多搜索" (click)="showMore()"></i>
    <button nz-button class="btn default" (click)="search()">查询</button>
    <button nz-button class="btn default ml8" (click)="reset()">重置</button>
    <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
  </div>
</div>
<div class="moreFilter" *ngIf="fieldConfig.fields.category1DTO || fieldConfig.fields.category2DTO || fieldConfig.fields.category3DTO">
  <span>{{fieldConfig.fields.category1DTO?.category}}</span>
  <span>{{fieldConfig.fields.category2DTO?.category}}</span>
  <span>{{fieldConfig.fields.category3DTO?.category}}</span>
</div>
<nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
  <thead (nzSortChange)="sort($event)" nzSingleSort>
    <tr>
      <th nzWidth="10%">楼栋名称</th>
      <th nzWidth="9%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">工单总数</th>
      <th nzWidth="9%" nzShowSort nzSortKey="avgResponseTime" [(nzSort)]="sortCurrent.avgResponseTime">平均接单时长</th>
      <th nzWidth="9%" nzShowSort nzSortKey="avgResolvedTime" [(nzSort)]="sortCurrent.avgResolvedTime">平均解决时长</th>
      <th nzWidth="9%" nzShowSort nzSortKey="resolvedOverNum" [(nzSort)]="sortCurrent.resolvedOverNum">超时单数</th>
      <th nzWidth="9%" nzShowSort nzSortKey="overTimeNum" [(nzSort)]="sortCurrent.overTimeNum">挂起单数</th>
      <th nzWidth="9%" nzShowSort nzSortKey="consumablePrice" [(nzSort)]="sortCurrent.consumablePrice">耗材费用(元)</th>
      <th nzWidth="9%" nzShowSort nzSortKey="workHourPrice" [(nzSort)]="sortCurrent.workHourPrice">工时费用(元)</th>
      <th nzWidth="9%" nzShowSort nzSortKey="totalPrice" [(nzSort)]="sortCurrent.totalPrice">总费用(元)</th>
      <th nzWidth="9%" nzShowSort nzSortKey="negativeNum" [(nzSort)]="sortCurrent.negativeNum">差评单数</th>
      <th nzWidth="9%" nzShowSort nzSortKey="favorableRate" [(nzSort)]="sortCurrent.favorableRate">好评率</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let data of listOfData">
      <td>{{ data.name }}</td>
      <td>{{ data.sum }}</td>
      <td>{{ data.avgResponseTime }}</td>
      <td>{{ data.avgResolvedTime }}</td>
      <td>{{ data.resolvedOverNum }}</td>
      <td>{{ data.overTimeNum }}</td>
      <td>{{ data.consumablePrice }}</td>
      <td>{{ data.workHourPrice }}</td>
      <td>{{ data.totalPrice }}</td>
      <td>{{ data.negativeNum }}</td>
      <td>{{ data.favorableRate }}</td>
    </tr>
  </tbody>
  <ng-template #footerTpl>
    <table class="footTable">
      <tr *ngFor="let data of listOfDataEnd">
        <td style="width: 10%">{{ data.name }}</td>
        <td style="width: 9%">{{ data.sum }}</td>
        <td style="width: 9%">{{ data.avgResponseTime }}</td>
        <td style="width: 9%">{{ data.avgResolvedTime }}</td>
        <td style="width: 9%">{{ data.resolvedOverNum }}</td>
        <td style="width: 9%">{{ data.overTimeNum }}</td>
        <td style="width: 9%">{{ data.consumablePrice }}</td>
        <td style="width: 9%">{{ data.workHourPrice }}</td>
        <td style="width: 9%">{{ data.totalPrice }}</td>
        <td style="width: 9%">{{ data.negativeNum }}</td>
        <td style="width: 9%">{{ data.favorableRate }}</td>
      </tr>
    </table>
  </ng-template>
</nz-table>
<div class="pagination">
  <ng-template #totalTemplate let-total> 共 {{ total }} 条 </ng-template>
  <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize" (nzPageIndexChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)" (nzPageSizeChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)" nzShowSizeChanger [nzPageSizeOptions]="[30,50,100,200]" [nzShowTotal]="totalTemplate"></nz-pagination>
</div>

<!-- 详细搜索 -->
<app-search-more [fieldConfig]="fieldConfig" *ngIf="showSearchMore" [hosId]="hosId" [queryType]="queryType"  [dutyId]="dutyId"  [parentDutyId]="parentDutyId" (cancelEvent)="cancelEvent()" (submitEvent)="submitEvent($event)"></app-search-more>
