<div class="pharmacy">
  <!-- 头部 start -->
  <div class="pharmacy-header">
    <div class="pharmacy-logo display_flex align-items_center justify-content_flex-center flex-direction_column" style="line-height: normal;height:100%;">
      <img [src]="tool.logoUrl" class="pharmacy-logo__img">
      <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" [title]="deptDisplay == 2 ? loginUser.dept.deptalias : loginUser.dept.dept">{{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>药品计费(待配药)({{ printPharmacyTotal }})</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(1)">
            <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
            (click)="showLogs(item)"
            class="pharmacy-main__selection"
            *ngFor="let item of printPharmacyList"
          >
            <div class="pharmacy-main__selectionInfo">
              <div class="pharmacy-main__selectionItem">
                <strong>{{ item.target ? item.target.dept : "" }}</strong>
              </div>
              <div class="pharmacy-main__selectionItem">
                <span>单号：{{ item.packid }}</span>
                <span>
                  <ng-container *ngIf="item.bagTime">{{
                    item.bagTime | date: "HH:mm"
                  }}</ng-container>
                </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>配药中({{ waitPharmacyTotal }})</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(2)">
            <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)="showLogs(item)"
            class="pharmacy-main__selection"
            *ngFor="let item of waitPharmacyList; let i = index"
          >
            <div class="pharmacy-main__selectionInfo">
              <div class="pharmacy-main__selectionItem">
                <strong>{{ item.target ? item.target.dept : "" }}</strong>
              </div>
              <div class="pharmacy-main__selectionItem">
                <span>单号：{{ item.packid }}</span>
                <span>
                  <ng-container *ngIf="item.bagTime">{{
                    item.bagTime | date: "HH:mm"
                  }}</ng-container>
                </span>
              </div>
              <div class="pharmacy-main__selectionItem" *ngIf="item.opLogs&&item.opLogs.length">
                <span>{{item.opLogs[0].operationTime | date:'HH:mm:ss'}} 由 {{item.opLogs[0].username}} 配药</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>核对中({{ pharmacyTotal }})</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(3)">
            <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)="showLogs(item)"
            class="pharmacy-main__selection"
            *ngFor="let item of pharmacyList; let i = index"
          >
            <div class="pharmacy-main__selectionInfo">
              <div class="pharmacy-main__selectionItem">
                <strong>{{ item.target ? item.target.dept : "" }}</strong>
              </div>
              <div class="pharmacy-main__selectionItem">
                <span>单号：{{ item.packid }}</span>
                <span>
                  <ng-container *ngIf="item.bagTime">{{
                    item.bagTime | date: "HH:mm"
                  }}</ng-container>
                </span>
              </div>
              <div class="pharmacy-main__selectionItem" *ngIf="item.opLogs&&item.opLogs.length">
                <span>{{item.opLogs[0].operationTime | date:'HH:mm:ss'}} 由 {{item.opLogs[0].username}} 核对</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>配送中({{ distributionTotal }})</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(4)">
            <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)="showLogs(item)"
            class="pharmacy-main__selection"
            *ngFor="let item of distributionList; let i = index"
          >
            <div class="pharmacy-main__selectionInfo">
              <div class="pharmacy-main__selectionItem">
                <strong>{{ item.target ? item.target.dept : "" }}</strong>
              </div>
              <div class="pharmacy-main__selectionItem">
                <span>单号：{{ item.packid }}</span>
                <span>
                  <ng-container *ngIf="item.bagTime">{{
                    item.bagTime | date: "HH:mm"
                  }}</ng-container>
                </span>
              </div>
              <div class="pharmacy-main__selectionItem" *ngIf="item.opLogs&&item.opLogs.length">
                <span>{{item.opLogs[0].operationTime | date:'HH:mm:ss'}} 由 {{item.opLogs[0].username}} 配送</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>已完成({{ completedTotal }})</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(5)">
            <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">
                <strong>{{ item.target ? item.target.dept : "" }}</strong>
              </div>
              <div class="pharmacy-main__selectionItem">
                <span>单号：{{ item.packid }}</span>
                <span>
                  <ng-container *ngIf="item.bagTime">{{
                    item.bagTime | date: "HH:mm"
                  }}</ng-container>
                </span>
              </div>
              <div class="pharmacy-main__selectionItem" *ngIf="item.opLogs&&item.opLogs.length">
                <span>{{item.opLogs[0].operationTime | date:'HH:mm:ss'}} 由 {{item.opLogs[0].handoverName}} 接收</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 -->
  <!-- 二维码打印 -->
  <div id="report" style="display: none">
    <div style="display: inline-block" *ngFor="let img of codes">
      <img style="width: 200px; height: 200px" [src]="img.base64" alt="" />
      <div
        style="
          text-align: center;
          font-size: 12px;
          width: 200px;
          font-weight: bold;
          color: #0a0a0a;
        "
      >
        {{ img.target }}
      </div>
      <div
        style="
          text-align: center;
          font-size: 12px;
          width: 200px;
          font-weight: bold;
          color: #0a0a0a;
        "
      >
        {{ img.creatTime | date: "MM-dd HH:mm" }}
      </div>
    </div>
  </div>
</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-log-prompt-modal
  *ngIf="logPromptModalShow"
  [show]="logPromptModalShow"
  [drugsBagId]="drugsBagId"
  (closeModelHs)="closeModelLog($event)"
></app-log-prompt-modal>
