<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.bedNum" />
        </div>
        <div class="list-template__searchItem">
          <span class="label">当前科室：</span>
          <nz-select
            [nzDropdownMatchSelectWidth]="false"
            class="formItem"
            nzServerSearch
            nzShowSearch
            nzAllowClear
            nzPlaceHolder="请选择当前科室"
            [(ngModel)]="searchCriteria.department"
            (nzOnSearch)="changeInp($event, 'search')"
            (nzOpenChange)="changeSearch($event)"
          >
            <ng-container *ngFor="let data of departmentSearch">
              <nz-option
                *ngIf="!isLoading"
                nzLabel="{{ data.dept }}"
                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>
      <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="10%">序号</th>
            <th nzWidth="15%">患者姓名</th>
            <th nzWidth="15%">住院号</th>
            <th nzWidth="15%">床号</th>
            <th nzWidth="15%">当前科室</th>
            <th nzWidth="15%">护理等级</th>
            <th nzWidth="15%">病情级别</th>
            <!-- <th nzWidth="9%">操作</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.bedNum||'-' }}</td>
            <td>{{data.department?data.department.dept:'-'}}</td>
            <td>{{data.careLevel?data.careLevel.name:'-'}}</td>
            <td>{{data.illnessState?data.illnessState.name:'-'}}</td>
            <!-- <td><button (click)="viewSpecimenHistory(data)">查看</button></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>
