<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">
          <span class="label">工单类型</span>：
          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="false" nzAllowClear
            nzPlaceHolder="请选择工单类型" [(ngModel)]="taskType">
            <ng-container *ngFor="let data of allTaskType">
              <nz-option nzLabel="{{data.name}}" nzValue="{{data.id}}"></nz-option>
            </ng-container>
          </nz-select>
        </div>
        <div class="list-template__searchItem">
          <span class="label label--big">执行配送人员</span>：
          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
            (nzOnSearch)="changeUser($event)" nzAllowClear nzPlaceHolder="请选择执行配送人员" [(ngModel)]="worker">
            <ng-container *ngFor="let option of allWorker">
              <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" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
            (nzOnSearch)="changeMediUser($event)" nzAllowClear nzPlaceHolder="请选择调解人" [(ngModel)]="mediUser">
            <ng-container *ngFor="let option of allMediUser">
              <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" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="false" nzAllowClear
            nzPlaceHolder="请选择处理状态" [(ngModel)]="status">
            <nz-option nzLabel="{{data.name}}" nzValue="{{data.id}}" *ngFor="let data of handleStatus"></nz-option>
          </nz-select>
        </div>
				<div class="list-template__searchItem">
				  <span class="label">单号</span>：
				  <input class="formItem" nz-input placeholder="请输入单号" [(ngModel)]="orderNo" />
				</div>
      </div>
      <div nz-col nzXl='6' class="list-template__btns">
        <button nz-button class="btn default" (click)='search()'>搜索</button>
        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
      </div>
    </div>
    <div class="list-template__bottom">
      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
        [nzLoading]="loading1">
        <thead>
          <tr class="thead">
            <th nzWidth="5%">序号</th>
						<th>工单类型</th>
            <th>单号</th>
            <th>申请科室</th>
            <!-- <th>发起时间</th> -->
						<th>执行人</th>
						<th>评价时间</th>
            <th>评价等级</th>
						<th>评价描述</th>
						<th>评价人</th>
            <th>处理状态</th>
            <th nzWidth="180px">操作</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let data of listOfData;let index=index;">
            <td>{{index+(pageIndex-1) * pageSize + 1}}</td>
						<td>{{data.orderType?data.orderType.name:'-'}}</td>
            <td>{{data.orderNo}}</td>
            <td>{{ data.startDept.dept }}</td>
            <!-- <td>{{timestampToTime(data.startTime)}}</td> -->
						<td>{{data.worker?data.worker.name:''}}</td>
						<td>{{ data.evaluationTime?timestampToTime(data.evaluationTime):'-'}}</td>
						<td>{{ data.evaluationLevel ? data.evaluationLevel.name:'-' }}</td>
						<td>
						  <span style="overflow: hidden;text-overflow: ellipsis;">{{ data.evaluationContent }}</span>
						</td>
            <td>{{data.evaluatorDTO?data.evaluatorDTO.name:''}}</td>
            <td>{{data.handleStatus.name}}</td>
						<td>
              <div class="coop">
								<span *ngIf="coopBtns.viewGd" (click)="viewDetail(data)">查看工单</span>
                <span *ngIf="coopBtns.look && data.handleStatus.value==2" (click)="detail(data.id)">查看</span>
                <span *ngIf="coopBtns.mediate && data.handleStatus.value==1" (click)="detail(data.id,true)">调解</span>
                <span *ngIf="coopBtns.designate && data.handleStatus.value==1"
                  (click)="designate(data.id,data.hosId)">指派</span>
              </div>
            </td>
          </tr>
        </tbody>
      </nz-table>
      <div class="list-template__pagination">
        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
          (nzPageIndexChange)="getList()" (nzPageSizeChange)="getList()">
        </nz-pagination>
      </div>
    </div>
  </div>

  <!-- 指派模态框 -->
  <div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="modal">
    <div class="modalBody">
      <div class="title">产品处理指派调解人员<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
      </div>
      <div class="content">
        <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
          <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="user">指派调解人员</nz-form-label>
            <nz-form-control nzErrorTip="请选择指派调解人员!">
              <nz-select [nzDropdownMatchSelectWidth]="false" type="user" nzShowSearch nzAllowClear
                formControlName="user" nzPlaceHolder="请选择指派调解人员">
                <ng-container *ngFor="let data of allDesUser">
                  <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.id"></nz-option>
                </ng-container>
                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
                </nz-option>
              </nz-select>
            </nz-form-control>
          </nz-form-item>
        </form>
      </div>
      <div class="display_flex justify-content_flex-center">
        <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">确认</button>
        <button class="btn cancel" nz-button nzType="default" (click)="hideModal()">取消</button>
      </div>
    </div>
  </div>

</div>
<!-- 操作成功/失败提示框 -->
<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
  [info]="promptInfo"></app-prompt-modal>

<!-- 查看详情 -->
<router-outlet (deactivate)="getList()"></router-outlet>

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