<div class="pharmacy">
  <!-- 头部 start -->
  <div class="pharmacy-header">
    <div class="pharmacy-logo">
      <img
        [src]="tool.logoUrl"
        class="pharmacy-logo__img"
        [alt]="tool.logoTitle"
      />
      <h1 class="pharmacy-logo__name">{{tool.logoTitle}}</h1>
    </div>
    <div class="pharmacy-name">
      <h2 class="pharmacy-name__title">
        <span>标本视图</span>
        <span class="currentDate">{{ time | date: "yyyy年MM月dd日" }}</span>
      </h2>
      <div class="pharmacy-name__total">
        <div>
          <!-- 今日药单量：<strong>{{ todayTotal }}</strong> -->
        </div>
        <div>
          <!-- 今日已完成：<strong>{{ todayComplete }}</strong> -->
        </div>
      </div>
    </div>
    <div class="userInfo">
      <div class="wel">欢迎您：</div>
      <div class="user">
        <img src="../../assets/images/icon_keshi.png" alt="" />
        <span *ngIf="deptDisplay">{{
          deptDisplay == 2 ? loginUser.dept.deptalias : loginUser.dept.dept
        }}</span>
      </div>
      <div class="userInfo-wrap">
        <div class="logOut" (click)="changeKsNow()">切换科室</div>
        <div class="logOut" (click)="logOut()">退出</div>
      </div>
    </div>
  </div>
  <!-- 头部 end -->
  <!-- 主体部分 start -->
  <div class="pharmacy-main">
    <!-- 代收急查标本（标本信息） start -->
    <div class="pharmacy-main__list pharmacy-main__print">
      <!-- 标题 start -->
      <div class="pharmacy-main__title">
        <strong>代收急查标本（标本信息）</strong>
        <span class="autoUpdate">{{ logTime }}秒</span>
      </div>
      <!-- 标题 end -->
      <!-- 搜索框 start -->
      <div class="pharmacy-main__search">
        <div class="pharmacy-main__searchInput">
          <input
            nz-input
            placeholder="请输入关键字"
            [(ngModel)]="printPharmacySearchKey"
          />
          <div class="pharmacy-main__searchText" (click)="searchKeyHandle('delegation')">
            <i nz-icon nzType="search"></i>
            <span>搜索</span>
          </div>
        </div>
      </div>
      <!-- 搜索框 end -->
      <!-- 列表 start -->
      <overlay-scrollbars #osComponentRef1 class="pharmacy-main__selectionWrap">
        <div *ngIf="!loading1" style="height: 100%">
          <div
            class="pharmacy-main__selection noPointer"
            *ngFor="let item of printPharmacyList"
          >
            <div class="pharmacy-main__selectionInfo">
              <div class="pharmacy-main__selectionItem">
                <span title="检验项目">{{item.specimen_desc || '无'}}</span>
                <span></span>
              </div>
              <div class="pharmacy-main__selectionItem">
                <span title="标本编码">{{item.scode || '无'}}</span>
                <span title="标本类型">{{item.stype || '无'}}</span>
              </div>
              <div class="pharmacy-main__selectionItem">
                <span title="患者姓名（床号）">{{item.patientname || '无'}}（{{item.bednum || '无'}}）</span>
                <span title="住院号">{{item.residence_no || '无'}}</span>
              </div>
              <div class="pharmacy-main__selectionItem">
                <span title="起点科室" class="moreContent left">{{item.sick_room || '无'}}</span>
                <span class="icon_transport transport-arrow-right-full"></span>
                <span title="终点科室" class="moreContent">{{item.check_dept || '无'}}</span>
              </div>
              <div class="pharmacy-main__selectionItem">
                <span></span>
                <span title="采集时间">{{item.print_date ? (item.print_date|date:'MM-dd HH:mm') :'无'}}</span>
              </div>
            </div>
          </div>
          <div
            class="pharmacy-main__selection pharmacy-main__selection--noData"
            *ngIf="printPharmacyList.length === 0"
          >
            <img src="./../../assets/images/image_kongbaiye.png" alt="" />
          </div>
          <!-- <div
            (click)="loadMore(1)"
            class="pharmacy-main__selection pharmacy-main__selection--more"
            *ngIf="printPharmacyFlag"
          >
            <div class="pharmacy-main__selectionInfo">
              <i
                nz-icon
                nzType="loading"
                nzTheme="outline"
                class="pharmacy-main__selection--icon"
                *ngIf="printPharmacyLoad"
              ></i
              >查看更多
            </div>
          </div> -->
        </div>
        <div
          *ngIf="loading1"
          style="height: calc(100vh - 212px); min-height: 556px"
        >
          <div
            class="loadingFull display_flex justify-content_flex-center align-items_center"
          >
            <div class="loadingFullInner">
              <img src="../../../assets/images/loading.gif" alt="" />
              <div>加载中...</div>
            </div>
          </div>
        </div>
      </overlay-scrollbars>
      <!-- 列表 end -->
    </div>
    <!-- 代收急查标本（标本信息） end -->
    <!-- 已收取（工单信息） start -->
    <div class="pharmacy-main__list pharmacy-main__waitDelivery">
      <!-- 标题 start -->
      <div class="pharmacy-main__title">
        <strong>已收取（工单信息）</strong>
        <span class="autoUpdate">{{ logTime }}秒</span>
      </div>
      <!-- 标题 end -->
      <!-- 搜索框 start -->
      <div class="pharmacy-main__search">
        <div class="pharmacy-main__searchInput">
          <input
            nz-input
            placeholder="请输入关键字"
            [(ngModel)]="waitPharmacySearchKey"
          />
          <div class="pharmacy-main__searchText" (click)="searchKeyHandle('take')">
            <i nz-icon nzType="search"></i>
            <span>搜索</span>
          </div>
        </div>
      </div>
      <!-- 搜索框 end -->
      <!-- 列表 start -->
      <overlay-scrollbars #osComponentRef2 class="pharmacy-main__selectionWrap">
        <div *ngIf="!loading2" style="height: 100%">
          <div
            (click)="showOrderList(item)"
            class="pharmacy-main__selection"
            *ngFor="let item of waitPharmacyList; let i = index"
          >
            <div class="pharmacy-main__selectionInfo">
              <div class="pharmacy-main__selectionItem">
                <span title="执行人姓名">{{item.userName || '无'}}</span>
                <span title="工单数量">{{item.orderNum || '无'}}</span>
              </div>
            </div>
          </div>
          <div
            class="pharmacy-main__selection pharmacy-main__selection--noData"
            *ngIf="waitPharmacyList.length === 0"
          >
            <img src="./../../assets/images/image_kongbaiye.png" alt="" />
          </div>
          <!-- <div
            (click)="loadMore(2)"
            class="pharmacy-main__selection pharmacy-main__selection--more"
            *ngIf="waitPharmacyFlag"
          >
            <div class="pharmacy-main__selectionInfo">
              <i
                nz-icon
                nzType="loading"
                nzTheme="outline"
                class="pharmacy-main__selection--icon"
                *ngIf="waitPharmacyLoad"
              ></i
              >查看更多
            </div>
          </div> -->
        </div>
        <div
          *ngIf="loading2"
          style="height: calc(100vh - 212px); min-height: 556px"
        >
          <div
            class="loadingFull display_flex justify-content_flex-center align-items_center"
          >
            <div class="loadingFullInner">
              <img src="../../../assets/images/loading.gif" alt="" />
              <div>加载中...</div>
            </div>
          </div>
        </div>
      </overlay-scrollbars>
      <!-- 列表 end -->
    </div>
    <!-- 已收取（工单信息） end -->
    <!-- 中转标本（标本统计信息） start -->
    <div class="pharmacy-main__list pharmacy-main__delivery">
      <!-- 标题 start -->
      <div class="pharmacy-main__title">
        <strong>中转标本（标本统计信息）</strong>
        <span class="autoUpdate">{{ logTime }}秒</span>
      </div>
      <!-- 标题 end -->
      <!-- 搜索框 start -->
      <div class="pharmacy-main__search">
        <div class="pharmacy-main__searchInput">
          <input
            nz-input
            placeholder="请输入关键字"
            [(ngModel)]="pharmacySearchKey"
          />
          <div class="pharmacy-main__searchText" (click)="searchKeyHandle('trans')">
            <i nz-icon nzType="search"></i>
            <span>搜索</span>
          </div>
        </div>
      </div>
      <!-- 搜索框 end -->
      <!-- 列表 start -->
      <overlay-scrollbars #osComponentRef3 class="pharmacy-main__selectionWrap">
        <div *ngIf="!loading3" style="height: 100%">
          <div
            (click)="showSpeList(item)"
            class="pharmacy-main__selection"
            *ngFor="let item of pharmacyList; let i = index"
          >
            <div class="pharmacy-main__selectionInfo">
              <div class="pharmacy-main__selectionItem">
                <span title="检验科室名称" class="moreContent left">{{item.check_dept || '无'}}</span>
                <span title="配送标本数量">{{item.count || '无'}}</span>
              </div>
            </div>
          </div>
          <div
            class="pharmacy-main__selection pharmacy-main__selection--noData"
            *ngIf="pharmacyList.length === 0"
          >
            <img src="./../../assets/images/image_kongbaiye.png" alt="" />
          </div>
          <!-- <div
            (click)="loadMore(3)"
            class="pharmacy-main__selection pharmacy-main__selection--more"
            *ngIf="pharmacyFlag"
          >
            <div class="pharmacy-main__selectionInfo">
              <i
                nz-icon
                nzType="loading"
                nzTheme="outline"
                class="pharmacy-main__selection--icon"
                *ngIf="pharmacyLoad"
              ></i
              >查看更多
            </div>
          </div> -->
        </div>
        <div
          *ngIf="loading3"
          style="height: calc(100vh - 212px); min-height: 556px"
        >
          <div
            class="loadingFull display_flex justify-content_flex-center align-items_center"
          >
            <div class="loadingFullInner">
              <img src="../../../assets/images/loading.gif" alt="" />
              <div>加载中...</div>
            </div>
          </div>
        </div>
      </overlay-scrollbars>
      <!-- 列表 end -->
    </div>
    <!-- 中转标本（标本统计信息） end -->
    <!-- 中转配送中（工单信息） start -->
    <div class="pharmacy-main__list pharmacy-main__delivery">
      <!-- 标题 start -->
      <div class="pharmacy-main__title">
        <strong>中转配送中（工单信息）</strong>
        <span class="autoUpdate">{{ logTime }}秒</span>
      </div>
      <!-- 标题 end -->
      <!-- 搜索框 start -->
      <div class="pharmacy-main__search">
        <div class="pharmacy-main__searchInput">
          <input
            nz-input
            placeholder="请输入关键字"
            [(ngModel)]="distributionSearchKey"
          />
          <div class="pharmacy-main__searchText" (click)="searchKeyHandle('trans_send')">
            <i nz-icon nzType="search"></i>
            <span>搜索</span>
          </div>
        </div>
      </div>
      <!-- 搜索框 end -->
      <!-- 列表 start -->
      <overlay-scrollbars #osComponentRef4 class="pharmacy-main__selectionWrap">
        <div *ngIf="!loading4" style="height: 100%">
          <div
            (click)="goToOrderDetail(item)"
            class="pharmacy-main__selection"
            *ngFor="let item of distributionList; let i = index"
          >
            <div class="pharmacy-main__selectionInfo">
              <div class="pharmacy-main__selectionItem">
                <span title="配送科室" class="moreContent left">{{item.deptList || '无'}}</span>
                <span></span>
              </div>
              <div class="pharmacy-main__selectionItem">
                <span title="单号">{{item.gdcode || '无'}}</span>
                <span title="执行人">{{item.userName || '无'}}</span>
              </div>
              <div class="pharmacy-main__selectionItem">
                <span title="建单时间">{{item.starttime ? (item.starttime|date:'MM-dd HH:mm') :'无'}}</span>
                <span title="标本总数">{{item.count === undefined ? '无' : item.count}}</span>
              </div>
            </div>
          </div>
          <div
            class="pharmacy-main__selection pharmacy-main__selection--noData"
            *ngIf="distributionList.length === 0"
          >
            <img src="./../../assets/images/image_kongbaiye.png" alt="" />
          </div>
          <!-- <div
            (click)="loadMore(4)"
            class="pharmacy-main__selection pharmacy-main__selection--more"
            *ngIf="distributionFlag"
          >
            <div class="pharmacy-main__selectionInfo">
              <i
                nz-icon
                nzType="loading"
                nzTheme="outline"
                class="pharmacy-main__selection--icon"
                *ngIf="distributionLoad"
              ></i
              >查看更多
            </div>
          </div> -->
        </div>
        <div
          *ngIf="loading4"
          style="height: calc(100vh - 212px); min-height: 556px"
        >
          <div
            class="loadingFull display_flex justify-content_flex-center align-items_center"
          >
            <div class="loadingFullInner">
              <img src="../../../assets/images/loading.gif" alt="" />
              <div>加载中...</div>
            </div>
          </div>
        </div>
      </overlay-scrollbars>
      <!-- 列表 end -->
    </div>
    <!-- 中转配送中（工单信息） end -->
    <!-- 异常标本（标本信息） start -->
    <div class="pharmacy-main__list pharmacy-main__delivery">
      <!-- 标题 start -->
      <div class="pharmacy-main__title">
        <strong>异常标本（标本信息）</strong>
        <span class="autoUpdate">{{ logTime }}秒</span>
      </div>
      <!-- 标题 end -->
      <!-- 搜索框 start -->
      <div class="pharmacy-main__search">
        <div class="pharmacy-main__searchInput">
          <input
            nz-input
            placeholder="请输入关键字"
            [(ngModel)]="completedSearchKey"
          />
          <div class="pharmacy-main__searchText" (click)="searchKeyHandle('error')">
            <i nz-icon nzType="search"></i>
            <span>搜索</span>
          </div>
        </div>
      </div>
      <!-- 搜索框 end -->
      <!-- 列表 start -->
      <overlay-scrollbars #osComponentRef5 class="pharmacy-main__selectionWrap">
        <div *ngIf="!loading5" style="height: 100%">
          <div
            (click)="showLogs(item)"
            class="pharmacy-main__selection"
            *ngFor="let item of completedList; let i = index"
          >
            <div class="pharmacy-main__selectionInfo">
              <div class="pharmacy-main__selectionItem">
                <span title="检验项目">{{item.specimen_desc || '无'}}</span>
                <span></span>
              </div>
              <div class="pharmacy-main__selectionItem">
                <span title="标本编码">{{item.scode || '无'}}</span>
                <span title="标本类型">{{item.stype || '无'}}</span>
              </div>
              <div class="pharmacy-main__selectionItem">
                <span title="患者姓名（床号）">{{item.patientname || '无'}}（{{item.bednum || '无'}}）</span>
                <span title="住院号">{{item.residence_no || '无'}}</span>
              </div>
              <div class="pharmacy-main__selectionItem">
                <span title="起点科室" class="moreContent left">{{item.sick_room || '无'}}</span>
                <span class="icon_transport transport-arrow-right-full"></span>
                <span title="终点科室" class="moreContent">{{item.check_dept || '无'}}</span>
              </div>
              <div class="pharmacy-main__selectionItem">
                <span title="收取时间">{{item.arrive_time ? (item.arrive_time|date:'MM-dd HH:mm') : '无'}}</span>
                <span title="收取人">{{item.receiver || '无'}}</span>
              </div>
              <div class="pharmacy-main__selectionItem">
                <span></span>
                <span title="中转时间">{{item.trans_time ? (item.trans_time|date:'MM-dd HH:mm') : '无'}}</span>
              </div>
            </div>
          </div>
          <div
            class="pharmacy-main__selection pharmacy-main__selection--noData"
            *ngIf="completedList.length === 0"
          >
            <img src="./../../assets/images/image_kongbaiye.png" alt="" />
          </div>
          <!-- <div
            (click)="loadMore(5)"
            class="pharmacy-main__selection pharmacy-main__selection--more"
            *ngIf="completedFlag"
          >
            <div class="pharmacy-main__selectionInfo">
              <i
                nz-icon
                nzType="loading"
                nzTheme="outline"
                class="pharmacy-main__selection--icon"
                *ngIf="completedLoad"
              ></i
              >查看更多
            </div>
          </div> -->
        </div>
        <div
          *ngIf="loading5"
          style="height: calc(100vh - 212px); min-height: 556px"
        >
          <div
            class="loadingFull display_flex justify-content_flex-center align-items_center"
          >
            <div class="loadingFullInner">
              <img src="../../../assets/images/loading.gif" alt="" />
              <div>加载中...</div>
            </div>
          </div>
        </div>
      </overlay-scrollbars>
      <!-- 列表 end -->
    </div>
    <!-- 异常标本（标本信息） end -->
  </div>
  <!-- 主体部分 end -->
  <router-outlet></router-outlet>
</div>

<!-- 药房端科室切换提示框 -->
<!-- <app-hs-prompt-modal
  [changeShow]="changeShow"
  [closeTime]="closeTime"
  [closeTimeFlag]="closeTimeFlag"
  [show]="hsPromptModalShow"
  (closeModelHs)="closeModelHs($event)"
  (clearModelHs)="clearModelHs($event)"
  deptType="pharmacy"
> -->
  <!-- 返回系统按钮 -->
  <!-- 右侧悬浮框 -->
  <!-- <div id="fixedMenu" class="fixed" *ngIf="mainRole">
    <div class="right">
      <div class="fixedMenu hujiaozhongxin">
        <div class="menuItems">
          <div class="item">快捷菜单</div>
        </div>
      </div>
      <div class="fixedMenu">
        <div class="menuItems">
          <div
            class="others"
            [ngStyle]="{
              height: showLastItems
                ? mainRole
                  ? 35 * 2 + 'px'
                  : 35 * 1 + 'px'
                : 0
            }"
          >
            <div
              [ngClass]="{ item: true, checked: fixedTab == 'back' }"
              *ngIf="mainRole"
              (click)="checkFixedTab('toSystem')"
            >
              返回系统
            </div>
          </div>
        </div>
        <div class="arrow" *ngIf="!showLastItems" (click)="fixedMenuXiala()">
          <i class="icon_transport transport-xiala2-01"></i>
        </div>
        <div class="arrow" *ngIf="showLastItems" (click)="fixedMenuShangla()">
          <i class="icon_transport transport-shangla-"></i>
        </div>
      </div>
    </div>
    <div
      *ngIf="showLastItems && fixedTab != ''"
      (click)="fixedMenuShangla()"
      class="fixedMark"
    ></div>
  </div>
</app-hs-prompt-modal> -->

<!-- 标本历史记录查看 -->
<app-history-prompt-modal
  *ngIf="logPromptModalShow"
  [show]="logPromptModalShow"
  [scode]="scode"
  (closeModelHs)="closeModelLog($event)"
></app-history-prompt-modal>

<!-- 标本列表查看 -->
<app-spe-prompt-modal
  *ngIf="spePromptModalShow"
  [show]="spePromptModalShow"
  [checkDeptId]="checkDeptId"
  [pharmacySearchKey]="pharmacySearchKey"
  [printDate]="printDate"
  (closeModelHs)="closeModelSpe($event)"
></app-spe-prompt-modal>

<!-- 工单列表查看 -->
<app-order-prompt-modal
  *ngIf="orderPromptModalShow"
  [show]="orderPromptModalShow"
  [workId]="workId"
  (closeModelHs)="closeModelOrder($event)"
></app-order-prompt-modal>
