<div class="list-template">
  <div class="list-template__content">
    <div class="list-template__top" nz-row>
      <div nz-col nzXl='16' class="list-template__searchBox">
        <div class="list-template__searchItem">
          <span class="label">患者姓名：</span>
          <input nz-input class="formItem" placeholder="请输入患者姓名" [(ngModel)]="searchCriteria.patientName" />
        </div>
        <div class="list-template__searchItem">
          <span class="label">检查单号：</span>
          <input nz-input class="formItem" placeholder="请输入检查单号" [(ngModel)]="searchCriteria.inspectCode" />
        </div>
        <div class="list-template__searchItem">
          <span class="label">配送人员：</span>
          <nz-select [nzDropdownMatchSelectWidth]="false" class="formItem" nzServerSearch nzShowSearch nzAllowClear
            nzPlaceHolder="请选择配送人员" [(ngModel)]="searchCriteria.workerId" (nzOnSearch)="changeInp($event)"
            (nzOpenChange)="changeSearch($event)">
            <ng-container *ngFor="let data of workerSearch">
              <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>
        </div>
        <div class="list-template__searchItem">
          <span class="label">状态：</span>
          <nz-select
            [nzDropdownMatchSelectWidth]="false"
            class="formItem"
            nzServerSearch
            nzShowSearch
            nzAllowClear
            nzPlaceHolder="请选择状态"
            [(ngModel)]="searchCriteria.inspectState"
            (nzOpenChange)="changeSearch1($event)"
          >
            <ng-container *ngFor="let data of types">
              <nz-option
                *ngIf="!isLoading1"
                nzLabel="{{ data.name }}"
                nzValue="{{ data.id }}"
              ></nz-option>
            </ng-container>
            <nz-option *ngIf="isLoading1" nzDisabled nzCustomContent>
              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
            </nz-option>
          </nz-select>
        </div>
      </div>
      <div nz-col nzXl="8" class="list-template__btns">
        <button nz-button class="btn default" (click)='reset()'>重置</button>
        <button nz-button class="btn default ml8" (click)='getList(1)'>搜索</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="6%">序号</th>
            <th nzWidth="8%">患者姓名</th>
            <th nzWidth="8%">住院号</th>
            <th nzWidth="8%">申请科室</th>
            <th nzWidth="8%">检查科室</th>
            <th nzWidth="8%">检查单号</th>
            <th nzWidth="8%">患者床号</th>
            <th nzWidth="8%">检查项目</th>
            <th nzWidth="11%">预约时间</th>
            <th nzWidth="11%">到达时间</th>
            <th nzWidth="8%">检查状态</th>
            <th nzWidth="8%">配送人员</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let data of listOfData;let i = index">
            <td>{{i+1}}</td>
            <td>{{ data.patientName||'-' }}</td>
            <td>{{ data.residenceNo||'-' }}</td>
            <td>{{ data.applyDept ? data.applyDept.dept : '-' }}</td>
            <td>{{ data.execDept ? data.execDept.dept : '-' }}</td>
            <td>{{ data.inspectCode||'-' }}</td>
            <td>{{ data.patientBedNum||'-' }}</td>
            <td>{{data.inspectName||'-'}}</td>
            <td>{{ data.yyTime||'-' }}</td>
            <td>{{data.arriveTime||'-'}}</td>
            <td>{{ data.inspectState?data.inspectState.name:''}}</td>
            <td>{{ data.workerName||'-' }}</td>
          </tr>
        </tbody>
      </nz-table>
      <div class="list-template__pagination">
        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize"
          (nzPageIndexChange)="getList(0)" (nzPageSizeChange)="getList(0)">
        </nz-pagination>
      </div>
    </div>
  </div>
</div>
