<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" nzServerSearch nzShowSearch (nzOnSearch)="changeRepairDeptInp($event)" nzAllowClear nzPlaceHolder="请选择报修科室" [(ngModel)]="repairDeptId" (nzOpenChange)="openChangeRepairDept($event)">
        <ng-container *ngFor="let option of repairDeptList">
          <nz-option *ngIf="!isLoading" [nzLabel]="option.hospital.hosName + '-' + option.dept" [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.category1DTO || fieldConfig.fields.category2DTO || fieldConfig.fields.category3DTO || fieldConfig.fields.sourceDTO || fieldConfig.fields.buildingDTO || fieldConfig.fields.floorDTO || 
		fieldConfig.fields.companyDTO || fieldConfig.fields.workHourParentDTO || fieldConfig.fields.workHourSmallDTO || fieldConfig.fields.evaluateDTO || fieldConfig.fields.repairUserDTO || fieldConfig.fields.consumableDTO || 
		fieldConfig.fields.isHangDTO || fieldConfig.fields.overtimeDTO || fieldConfig.fields.codeNumDTO || fieldConfig.fields.deptTypeDTO">
  <span>{{fieldConfig.fields.workHourParentDTO?.workName}}</span>
	<span>{{fieldConfig.fields.workHourSmallDTO?.workName}}</span>
	<span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
  <span>{{fieldConfig.fields.userDTO?.name}}</span>
  <span>{{fieldConfig.fields.category1DTO?.category}}</span>
  <span>{{fieldConfig.fields.category2DTO?.category}}</span>
  <span>{{fieldConfig.fields.category3DTO?.category}}</span>
  <span>{{fieldConfig.fields.sourceDTO?.name}}</span>
	<span>{{fieldConfig.fields.buildingDTO?.buildingName}}</span>
	<span>{{fieldConfig.fields.floorDTO?.floorName}}</span>
	<span>{{fieldConfig.fields.companyDTO?.name}}</span>
	<span>{{fieldConfig.fields.repairUserDTO?.name}}</span>
	<span>{{fieldConfig.fields.evaluateDTO?.name}}</span>
	<span>{{fieldConfig.fields.consumableDTO?.name}}</span>
	<span>{{fieldConfig.fields.isHangDTO?.name}}</span>
	<span>{{fieldConfig.fields.overtimeDTO?.name}}</span>
	<span>{{fieldConfig.fields.codeNumDTO}}</span>
	<span>{{fieldConfig.fields.deptTypeDTO?.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="300px">故障描述</th>
      <th nzWidth="200px">详细地址</th>
      <th nzWidth="100px">受|处理人/组</th>
      <th nzWidth="200px">时间过程</th>
      <th nzWidth="100px">时长</th>
      <th nzWidth="200px">时间考核</th>
      <th nzWidth="150px">延期记录</th>
      <th nzWidth="100px">状态|评价</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}} {{data.priorityName}}</div>
				<div class="text-style">{{data.incidentsign}}</div>
			</td>
      <td class="hide-describe">
				<div>{{data.mutiCategory}}</div>
				<div>{{data.description}}</div>
			</td>
      <td>
				<div>{{data.hosName}}-{{data.repairDept}}</div>
				<div>{{ data.housenumber }}</div>
			</td>
      <td>
				<div>{{data.creator}}</div>
				<div>{{data.groupOrHandlerUser}}</div>
			</td>
      <td>
				<div>申:{{ data.startdate|date:'yyyy-MM-dd HH:mm:ss' }}</div>
				<div>受:{{ data.acceptdate|date:'yyyy-MM-dd HH:mm:ss' }}</div>
				<div>接:{{ data.responsehandletime|date:'yyyy-MM-dd HH:mm:ss' }}</div>
				<div>解:{{ data.handleTime|date:'yyyy-MM-dd HH:mm:ss' }}</div>
			</td>
      <td>
				<div>接单:{{data.responseTime}}</div>
				<div>解决:{{data.resolvedTime}}</div>
			</td>
      <td>
      	<div>预接:{{data.overdueResponseDate|date:'yyyy-MM-dd HH:mm:ss'}}</div>
      	<div>预解:{{data.overdueTime|date:'yyyy-MM-dd HH:mm:ss'}}</div>
      </td>
      <td>{{ data.remark }}</td>
      <td>
				<div>{{ data.stateName }}</div>
				<div>{{ data.degreeName }}</div>
			</td>
      <td>
				<div>总:{{data.totalPrice}}{{data.totalPrice?'元':''}}</div>
				<div>耗:{{data.consumablePrice}}{{data.consumablePrice?'元':''}}</div>
				<div>工:{{data.workHourPrice}}{{data.workHourPrice?'元':''}}</div>
			</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-search-more [fieldConfig]="fieldConfig" *ngIf="showSearchMore" [hosId]="hosId" [queryType]="queryType"  [dutyId]="dutyId"  [parentDutyId]="parentDutyId" (cancelEvent)="cancelEvent()" (submitEvent)="submitEvent($event)" [going]="goingType"></app-search-more>

<!-- 详情 -->
<app-incident-detail [id]="coopData.id" *ngIf="detailModalShow" (closeModelHs)="closeDetailModelOrder($event)" (confirmModelHs)="confirmDetailModelOrder($event)"></app-incident-detail>
