<div class="list-template">
  <div class="list-template__content">
    <div class="list-template__top" nz-row>
      <div nz-col nzXl='18' class="list-template__searchBox">
        <div class="list-template__searchItem">
          <nz-radio-group [(ngModel)]="dateType" (ngModelChange)="changeDateType($event)">
            <label *ngFor="let data of dateTypes" nz-radio-button [nzValue]="data.value">{{data.label}}</label>
          </nz-radio-group>
        </div>
        <div class="list-template__searchItem">
          <span class="label">发起时间</span>：
          <nz-range-picker *ngIf="dateType=='day'" [(ngModel)]="dateRange" [nzAllowClear]='false'
            [nzDisabledDate]="disabledDate" (ngModelChange)="changeDate($event)">
          </nz-range-picker>
          <nz-month-picker *ngIf="dateType=='month'" [(ngModel)]="monthRangeStart" [nzDisabledDate]="disabledMonthStart"
            (ngModelChange)="changeMonthStart($event)" nzPlaceHolder="请选择开始月份">
          </nz-month-picker>
          <span *ngIf="dateType=='month'"> ~ </span>
          <nz-month-picker *ngIf="dateType=='month'" [(ngModel)]="monthRangeEnd" [nzDisabledDate]="disabledMonthEnd"
            (ngModelChange)="changeMonthEnd($event)" nzPlaceHolder="请选择截止月份">
          </nz-month-picker>
          <nz-year-picker *ngIf="dateType=='year'" [(ngModel)]="yearRangeStart" [nzDisabledDate]="disabledYearStart"
            (ngModelChange)="changeYearStart($event)" nzPlaceHolder="请选择开始年份">
          </nz-year-picker>
          <span *ngIf="dateType=='year'"> ~ </span>
          <nz-year-picker *ngIf="dateType=='year'" [(ngModel)]="yearRangeEnd" (ngModelChange)="changeYearEnd($event)"
            [nzDisabledDate]="disabledYearEnd" nzPlaceHolder="请选择截止年份">
          </nz-year-picker>
        </div>
        <div class="list-template__searchItem ml8">
          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="false" nzPlaceHolder="请选择时间"
            [(ngModel)]="defRange" (ngModelChange)="changeDateRange($event)">
            <nz-option nzLabel="{{data.label}}" nzValue="{{data.id}}" *ngFor="let data of defRanges"></nz-option>
          </nz-select>
        </div>
        <div class="list-template__searchItem">
          <span class="label">人员名称</span>：
          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
            (nzOnSearch)="changeInp($event)" nzAllowClear nzPlaceHolder="请选择人员名称" [(ngModel)]="searchDto.user">
            <ng-container *ngFor="let option of userList">
              <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
            </ng-container>
            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
            </nz-option>
          </nz-select>
        </div>
        <div class="list-template__searchItem">
          <span class="label">人员分组</span>：
          <nz-select class="formItem" nzAllowClear [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="false" nzPlaceHolder="请选择人员分组" [(ngModel)]="searchDto.group">
            <nz-option [nzLabel]="data.groupName" [nzValue]="data.id" *ngFor="let data of groupList"></nz-option>
          </nz-select>
        </div>
      </div>
      <div nz-col nzXl='6' class="list-template__btns">
        <button nz-button class="btn default" (click)='search(1)'>搜索</button>
        <button nz-button class="btn default ml8" (click)='export()' [nzLoading]="loading2">导出</button>
        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
      </div>
    </div>
		<div class="cont">
		  <div>
		    <span>总计</span>
		    <span class="rate"></span>
		  </div>
		  <div>
		    <span>总人数</span>
		    <span>{{summary.personalNum || 0}}</span>
		  </div>
		  <div>
		    <span>总趟数</span>
		    <span>{{summary.totalTrip || 0}}</span>
		  </div>
		  <div>
		    <span>总单数</span>
		    <span>{{summary.totalOrder || 0}}</span>
		  </div>
		  <div>
		    <span>总重量</span>
		    <span>{{summary.totalWeight || 0}}</span>
		  </div>
		</div>
    <div class="list-template__bottom">
      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
        [nzLoading]="loading1">
        <thead (nzSortChange)="sort($event)" nzSingleSort>
          <tr class="thead">
            <th nzWidth="6%">序号</th>
            <th nzWidth="10%">人员姓名</th>
            <th nzWidth="28%" nzShowSort nzSortKey="totalTrip" [(nzSort)]="sortCurrent.totalTrip">总趟数</th>
            <th nzWidth="28%" nzShowSort nzSortKey="totalOrder" [(nzSort)]="sortCurrent.totalOrder">总单数</th>
            <th nzWidth="28%" nzShowSort nzSortKey="totalWeight" [(nzSort)]="sortCurrent.totalWeight">总重量(KG)</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let data of listOfData;let index=index;">
            <td>{{index+(pageIndex-1) * pageSize + 1}}</td>
            <td>{{ data.userName }}</td>
            <td>{{ data.totalTrip }}</td>
            <td>{{ data.totalOrder }}</td>
            <td>{{ data.totalWeight }}</td>
          </tr>
        </tbody>
      </nz-table>
      <div class="list-template__pagination">
        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
          (nzPageIndexChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)"
          (nzPageSizeChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)">
        </nz-pagination>
      </div>
    </div>
  </div>
</div>
<!-- 操作成功/失败提示框 -->
<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
  [info]="promptInfo"></app-prompt-modal>

<!-- 查看详情 -->
<router-outlet></router-outlet>
