<div class="searchDataWrap">
  <div class="searchData">
    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
    <div class="searchDataItem">
      <span class="label">统计分类</span>：
      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzAllowClear nzPlaceHolder="请选择统计分类" [(ngModel)]="statisticsTypeId" (nzOpenChange)="openChangeStatisticsType()">
        <ng-container *ngFor="let option of statisticsTypeList">
          <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>
  <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.groupDTO || fieldConfig.fields.userDTO || fieldConfig.fields.deptDTO || fieldConfig.fields.buildingDTO || fieldConfig.fields.taskTypeDTO || fieldConfig.fields.sourceDTO || fieldConfig.fields.minuteDTO || fieldConfig.fields.specialDTO || fieldConfig.fields.overtimeDTO || fieldConfig.fields.overtimeIdDTO || fieldConfig.fields.evaluateDTO || fieldConfig.fields.codeNumDTO || fieldConfig.fields.timeFrameDTO">
	<span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
	<span>{{fieldConfig.fields.userDTO?.name}}</span>
	<span>{{fieldConfig.fields.taskTypeDTO?.taskName}}</span>
	<span>{{fieldConfig.fields.buildingDTO?.buildingName}}</span>
  <span>{{fieldConfig.fields.deptDTO?.dept}}</span>
	<span>{{fieldConfig.fields.sourceDTO?.name}}</span>
	<span>{{fieldConfig.fields.minuteDTO}}</span>
	<span>{{fieldConfig.fields.specialDTO?.name}}</span>
	<span>{{fieldConfig.fields.overtimeDTO?.name}}</span>
	<!-- <span>{{fieldConfig.fields.abnormalDTO?.name}}</span> -->
	<span>{{fieldConfig.fields.evaluateDTO?.name}}</span>
	<span>{{fieldConfig.fields.codeNumDTO}}</span>
	<span>{{fieldConfig.fields.timeFrameDTO?.name}}</span>
</div>
<nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px', x: '1600px'}">
  <thead>
    <tr>
      <th nzWidth="150px">序号|单号</th>
			<th nzWidth="100px">申请科室</th>
      <th nzWidth="200px">起点|终点科室</th>
      <th nzWidth="150px">统计|任务类型</th>
      <th nzWidth="200px">时间过程</th>
      <th nzWidth="100px">时长</th>
      <th nzWidth="200px">时间考核</th>
      <th nzWidth="150px">状态|评价</th>
      <th nzWidth="150px">费用|积分</th>
			<th nzWidth="100px">执行人</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let data of listOfData; let index = index;">
      <td (click)="viewDetail(data)">
				<div>{{index+(pageIndex-1) * pageSize + 1}}</div>
				<div class="text-style">{{data.gdcode}}</div>
			</td>
			<td>{{ data.createDept }}</td>
      <td>
				<div>{{ data.startDept }}</div>
				<div>{{ data.endDept }}</div>
			</td>
      <td>
				<div>{{data.statisticsName}}</div>
				<div>{{data.taskName}}</div>
			</td>
			<td>
				<div>申:{{ data.starttime|date:'yyyy-MM-dd HH:mm:ss' }}</div>
				<div>接:{{ data.accepttime|date:'yyyy-MM-dd HH:mm:ss' }}</div>
				<div>到:{{ data.arrivetime|date:'yyyy-MM-dd HH:mm:ss' }}</div>
				<div>达:{{ data.completetime|date:'yyyy-MM-dd HH:mm:ss' }}</div>
			</td>
			<td>
				<div>总时长:{{ data.totalTime }}</div>
				<div>接单:{{ data.responseTime }}</div>
				<div>到达:{{ data.arriveTimeNum }}</div>
				<div>执行:{{ data.executionTime }}</div>
			</td>
			<td>
				<div>接单:{{ data.estimateResponseTime|date:'yyyy-MM-dd HH:mm:ss' }}</div>
				<div>到达:{{ data.estimateArriveTime|date:'yyyy-MM-dd HH:mm:ss' }}</div>
				<div>执行:{{ data.estimateCompleteTime|date:'yyyy-MM-dd HH:mm:ss' }}</div>
			</td>
      <td>
				<div>{{ data.stateName }}</div>
				<div>{{ data.evaluationName }}</div>
			</td>
      <td>
      	<div>{{ data.scorePrice }}{{data.scorePrice ? '元' : ''}}</div>
      	<div>{{ data.totalGrade }}{{data.totalGrade ? '分' : ''}}</div>
      </td>
			<td>{{data.workerName}}</td>
    </tr>
  </tbody>
</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-distribution-search-more [fieldConfig]="fieldConfig" *ngIf="showSearchMore" [hosId]="hosId" [queryType]="queryType"  [dutyId]="dutyId"  [parentDutyId]="parentDutyId" (cancelEvent)="cancelEvent()" (submitEvent)="submitEvent($event)"></app-distribution-search-more>

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