<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.bloodCode" />
        </div>
        <div class="list-template__searchItem">
          <span class="label">发血时间：</span>
          <nz-range-picker [(ngModel)]="searchCriteria.dateRange"></nz-range-picker>
        </div>
        <div class="list-template__searchItem">
          <span class="label">状态：</span>
          <nz-select
            [nzDropdownMatchSelectWidth]="false"
            class="formItem"
            nzServerSearch
            nzShowSearch
            nzAllowClear
            nzPlaceHolder="请选择状态"
            [(ngModel)]="searchCriteria.state"
            (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="2%">#</th>
            <th nzWidth="7%">医嘱号</th>
            <th nzWidth="7%">血袋号</th>
            <th nzWidth="6%">状态</th>
            <th nzWidth="7%">申请科室</th>
            <th nzWidth="7%">血液类型</th>
            <th nzWidth="4%">ABO血型</th>
            <th nzWidth="4%">RH(血型)</th>
            <th nzWidth="7%">血量(单位)</th>
            <th nzWidth="7%">患者姓名（住院号）</th>
            <th nzWidth="7%">发血时间</th>
            <th nzWidth="7%">取血者</th>
            <th nzWidth="7%">取血时间</th>
            <th nzWidth="7%">接收人</th>
            <th nzWidth="7%">接收时间</th>
            <th nzWidth="7%">操作</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let data of listOfData;let i = index">
            <td>{{i+(pageIndex-1) * pageSize + 1}}</td>
            <td>{{ data.applyCode || '无'}}</td>
            <td>{{ data.bloodCode || '无'}}</td>
            <td>{{ data.state?.name }}</td>
            <td>{{ data.applyDeptDTO ? data.applyDeptDTO.dept :'无' }}</td>
            <td>{{ data.type ? data.type.name : "无" }}</td>
            <td>{{ data.aboType || '无' }}</td>
            <td>{{ data.rhType || '无' }}</td>
            <td>{{ data.volume ? (ttconfig_sign_type4 ? data.volume + data.unit : data.volume + 'ML') : '无' }}</td>
            <td>{{ data.patientName }}<span *ngIf="data.hosNum">({{ data.hosNum }})</span></td>
            <td>{{ data.printDate | date:"yyyy-MM-dd HH:mm:ss" }}</td>
            <td>{{ data.arriverDTO ? data.arriverDTO.name: '无' }}</td>
            <td>{{ data.arriveTime | date:"yyyy-MM-dd HH:mm:ss" }}</td>
            <td>{{ data.receiverDTO ? data.receiverDTO.name : '' }}</td>
            <td>{{ data.receiveTime | date:"yyyy-MM-dd HH:mm:ss" }}</td>
            <td><button (click)="viewBloodHistory(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>
<!-- 血制品历史记录查看 -->
<app-blood-history-prompt-modal
  *ngIf="historyPromptModalShow"
  [show]="historyPromptModalShow"
  [bloodId]="bloodId"
  (closeModelHs)="closeModelHistory($event)"
></app-blood-history-prompt-modal>
