<div class="modal display_flex justify-content_flex-center align-items_center" *ngIf="show">
  <div class="modalBody">
    <div class="title">批量关联科室<span class="red">（没有楼栋的科室无法查询到）</span><i class="icon_transport transport-guanbi" (click)="hideModal()"></i></div>
    <div class="list-template content">
      <div class="list-template__content">
        <div class="list-template__top" nz-row>
          <div nz-col nzXl='19' class="list-template__searchBox">
            <div class="list-template__searchItem">
              <span class="label">科室名称</span>：
              <input nz-input class="formItem" placeholder="请输入科室名称" [(ngModel)]="searchDto.dept" />
            </div>
            <div class="list-template__searchItem">
              <span class="label">科室类型</span>：
              <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch
                nzAllowClear nzPlaceHolder="请选择科室类型" [(ngModel)]="searchDto.deptTypeId">
                <ng-container *ngFor="let option of deptTypeList">
                  <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)="changeInp('search', 'building', $event)" nzAllowClear nzPlaceHolder="请选择楼栋" [(ngModel)]="searchDto.buildId">
                <ng-container *ngFor="let option of buildingSearchList">
                  <nz-option *ngIf="!isLoading" [nzLabel]="option.buildingName" [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 nz-col nzLg="5" class="list-template__btns">
            <button nz-button class="btn default mr8" (click)='search()'>搜索</button>
            <button nz-button class="btn default mr8" (click)='reset()'>重置</button>
          </div>
        </div>
        <div class="list-template__bottom">
          <nz-table class="hospitalTable" [nzData]="historySpecimenList" nzSize="middle" [nzShowPagination]="false"
            [nzLoading]="hsLoading" [nzScroll]="{ y: '506px' }">
            <thead>
              <tr class="thead">
                <th nzWidth="5%" nzShowCheckbox [(nzChecked)]="isAllDisplayDataChecked" (nzCheckedChange)="checkAll($event)"></th>
                <th nzWidth="19%">科室名称</th>
                <th nzWidth="19%">父级科室</th>
                <th nzWidth="18%">科室编码</th>
                <th nzWidth="13%">科室类型</th>
                <th nzWidth="13%">楼栋</th>
                <th nzWidth="13%">楼层</th>
              </tr>
            </thead>
            <tbody>
              <tr *ngFor="let data of historySpecimenList;let i = index;" (click)="selectedListData(data)">
                <td nzShowCheckbox [(nzChecked)]="mapOfCheckedId[data.id]" (nzCheckedChange)="refreshStatus()"></td>
                <td>{{ data.dept }}</td>
                <td>{{ data.parent?.dept }}</td>
                <td>{{ data.pcode }}</td>
                <td>{{ data.type?.name }}</td>
                <td>{{ data.building?.buildingName }}</td>
                <td>{{ data.floor?.floorName }}</td>
              </tr>
            </tbody>
          </nz-table>
          <div class="list-template__pagination">
            <nz-pagination [(nzPageIndex)]="historySpecimenPageIndex" [(nzTotal)]="historySpecimenListLength"
              [(nzPageSize)]="historySpecimenPageSize" (nzPageIndexChange)="getList()"
              (nzPageSizeChange)="getList()" nzShowSizeChanger [nzPageSizeOptions]="[10,100]">
            </nz-pagination>
          </div>
        </div>
      </div>
    </div>
    <div class="display_flex justify-content_flex-center">
      <button class="btn know" [nzLoading]="btnLoading" nz-button nzType="primary" (click)="submitForm()">
        确认关联
      </button>
      <button class="btn know" nz-button nzType="primary" nzGhost (click)="hideModal()">
        取消
      </button>
    </div>
  </div>
</div>
