<div class="modal display_flex justify-content_flex-center align-items_center" *ngIf="show">
  <div class="modalBody" style="width: 1200px;">
    <div class="title" *ngIf="(type === 'drugsJpbag' || type === 'drugsWestern' || type === 'drugsReturn' || type === 'drugsPoison' || type === 'drugsHerbal');else elseTpl">{{configs.drugsModel === 1 ? '药品详情' : '药包详情'}}<i class="icon_transport transport-guanbi" (click)="hideModal()"></i></div>
    <ng-template #elseTpl>
      <div class="title">业务数据查看<i class="icon_transport transport-guanbi" (click)="hideModal()"></i></div>
    </ng-template>
    <div class="drugsBag" *ngIf="configs.drugsModel === 1 && (type === 'drugsJpbag' || type === 'drugsWestern' || type === 'drugsReturn' || type === 'drugsPoison' || type === 'drugsHerbal')">
      <div>单号：{{drugsBag.packid}}</div>
      <div>申请科室：{{drugsBag.target ? drugsBag.target.dept : ''}}</div>
      <div>发药科室：{{drugsBag.launch ? drugsBag.launch.dept : ''}}</div>
      <div>打印时间：{{drugsBag.creatTime}}</div>
    </div>
    <div class="content">
      <!-- 血制品 -->
      <nz-table *ngIf="type === 'blood'" class="hospitalTable" [nzData]="bloodList" nzSize="middle" [nzShowPagination]="false"
        [nzLoading]="hsLoading" >
        <thead>
          <tr class="thead">
            <th nzWidth="5%">序号</th>
            <th nzWidth="13%">患者姓名</th>
            <th nzWidth="11%">患者ID</th>
            <th nzWidth="11%">血液类型</th>
            <th nzWidth="14%">血袋号</th>
            <th nzWidth="11%">取血人</th>
            <th nzWidth="12%">取血时间</th>
            <th nzWidth="11%">接收人</th>
            <th nzWidth="12%">接收时间</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let data of bloodList;let i = index;">
            <td>{{i+1}}</td>
            <td><span>{{ data.patientName }}<span *ngIf="data.bedNum">({{ data.bedNum }})</span></span></td>
            <td>{{ data.patientNo||'' }}</td>
            <td>{{ data.type ? data.type.name : "" }}</td>
            <td>{{ data.bloodCode||'' }}</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>
          </tr>
        </tbody>
      </nz-table>
      <!-- 新药品-一单一码 -->
      <nz-table *ngIf="configs.showDrugsBagDetails === 1 && configs.drugsModel === 1 && (type === 'drugsJpbag' || type === 'drugsWestern' || type === 'drugsReturn' || type === 'drugsPoison' || type === 'drugsHerbal')" class="hospitalTable" [nzData]="drugsBugSingleList" nzSize="middle" [nzShowPagination]="false"
        [nzLoading]="hsLoading" >
        <thead>
          <tr class="thead">
            <th nzWidth="5%">序号</th>
            <th nzWidth="65%">药品名称+规格</th>
            <th nzWidth="10%">数量</th>
						<th nzWidth="20%" *ngIf="configs.showPatientInfo==1">患者信息</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let data of drugsBugSingleList;let i = index;">
            <td>{{i+1}}</td>
            <td>{{ data.drugsInfo }} {{ data.model }}</td>
            <td>{{ data.drugsNum }}</td>
						<td nz-tooltip [nzTooltipTitle]="data.patientNames" *ngIf="configs.showPatientInfo==1">
							{{ data.patientNames }}
						</td>
          </tr>
        </tbody>
      </nz-table>
      <!-- 新药品-一单多码 -->
      <nz-table *ngIf="configs.drugsModel === 2 && (type === 'drugsJpbag' || type === 'drugsWestern' || type === 'drugsReturn' || type === 'drugsPoison' || type === 'drugsHerbal')" class="hospitalTable" [nzData]="drugsBugMultipleList" nzSize="middle" [nzShowPagination]="false"
        [nzLoading]="hsLoading" >
        <thead>
          <tr class="thead">
            <th nzWidth="5%">序号</th>
            <th nzWidth="12%">单号</th>
            <th nzWidth="14%">发药科室|打印时间</th>
						<th nzWidth="8%" *ngIf="configs.showPatientInfo==1">患者信息</th>
            <th nzWidth="8%" *ngIf="configs.showDrugsBagTypeCount==1">种类数</th>
            <th nzWidth="8%" *ngIf="configs.showDrugsBagTypeCount==1">总数</th>
            <th nzWidth="10%">收取人/交接人</th>
            <!-- <th nzWidth="10%">收取交接人</th> -->
            <th nzWidth="12%">收取时间</th>
            <th nzWidth="10%">送达人/交接人</th>
            <!-- <th nzWidth="10%">送达交接人</th> -->
            <th nzWidth="12%">送达时间</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let data of drugsBugMultipleList;let i = index;" (click)="viewDetail(type, data.id)" [ngStyle]="{ 'cursor': configs.showDrugsBagDetails == 1 ? 'pointer' : '' }">
            <td>{{i+1}}</td>
						<td [ngStyle]="{ 'text-decoration': configs.showDrugsBagDetails == 1 ? 'underline' : '' }">{{ data.packid }}</td>
            <td>{{ data.launch?.dept }}<br>{{ data.creatTime }}</td>
						<td nz-tooltip [nzTooltipTitle]="data.patientNames" *ngIf="configs.showPatientInfo==1">
							{{ data.patientNames }}
						</td>
            <td *ngIf="configs.showDrugsBagTypeCount==1">{{ data.drugsTypeCount }}</td>
            <td *ngIf="configs.showDrugsBagTypeCount==1">{{ data.drugsCount }}</td>
            <td>
							<ng-container *ngIf="data.startLog">
								<div>{{data.startLog.username}}</div>
								<div>{{data.startLog.handoverName}}</div>
							</ng-container>
						</td>
            <!-- <td><ng-container *ngIf="data.startLog"></ng-container></td> -->
            <td><ng-container *ngIf="data.startLog">{{data.startLog.operationTime | date:'yyyy-MM-dd HH:mm'}}</ng-container></td>
            <td>
							<ng-container *ngIf="data.endLog">
								<div>{{data.endLog.username}}</div>
								<div>{{data.endLog.handoverName}}</div>
							</ng-container>
						</td>
            <!-- <td><ng-container *ngIf="data.endLog"></ng-container></td> -->
            <td><ng-container *ngIf="data.endLog">{{data.endLog.operationTime | date:'yyyy-MM-dd HH:mm'}}</ng-container></td>
          </tr>
        </tbody>
      </nz-table>
      <!-- 标本 -->
      <div class="list-template w100" *ngIf="type === 'specimen'">
        <div class="list-template__content">
          <div class="list-template__top" nz-row *ngIf="type === 'specimen'">
            <div nz-col nzXl='24' class="list-template__searchBox">
              <div class="list-template__searchItem">
                <span class="label">标本类型</span>：
                <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch
                  nzPlaceHolder="请选择标本类型" [(ngModel)]="searchCriteria.stype" (ngModelChange)="selectStype($event)">
                  <nz-option *ngFor="let option of specimentTypeList" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
                </nz-select>
              </div>
              <div class="list-template__searchItem">
                <span class="label">检验项目</span>：
                <nz-select style="width: 210px;" class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch
                  nzPlaceHolder="请选择检验项目" [(ngModel)]="searchCriteria.specimenDesc" (ngModelChange)="selectDesc($event)">
                  <nz-option *ngFor="let option of specimenDescList" [nzLabel]="option.nameNum" [nzValue]="option.id"></nz-option>
                </nz-select>
              </div>
							<div class="list-template__searchItem">
							  <span class="label">实际收取</span>：
								<label nz-checkbox [(ngModel)]="searchCriteria.practical" (ngModelChange)="practicalChange($event)"></label>
							</div>
            </div>
          </div>
        </div>
      </div>
      <nz-table *ngIf="type === 'specimen'" class="hospitalTable" [nzData]="specimenList" nzSize="middle" [nzShowPagination]="false"
        [nzLoading]="hsLoading">
        <thead>
          <tr class="thead">
            <th nzWidth="4%">序号</th>
            <th >申请科室</th>
            <th >患者姓名</th>
            <th >标本编码</th>
            <th >检验项目</th>
						<th >核收信息</th>
            <th >标本类型</th>
            <th >状态</th>
            <th >收取时间</th>
            <th >收取人</th>
            <th >中转时间</th>
            <th >送达时间</th>
            <th >送达人</th>
            <th >终点科室</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let data of specimenList;let i = index;">
            <td>
							<span class="sign" *ngIf="orderId != data.gdIdSend && orderId != data.gdid"></span>
						{{ (pageIndex - 1) * pageSize + i + 1 }}</td>
            <td>{{ data.sickRoom ? data.sickRoom.dept : "-" }}</td>
            <td>{{ data.patientName}}<span *ngIf="data.bedNum">({{data.bedNum}})</span><br>{{data.residenceNo || data.patientNo}}</td>
            <td class="underline" (click)="viewSpecimenHistory(data)">{{ data.scode || "-" }}</td>
            <td>{{ data.specimenDesc || "-" }}</td>
						<td>
							<div>{{ data.checkCollectUserDTO ? data.checkCollectUserDTO.name : "" }}</div>
							<div>{{ data.checkCollectTime|date:'yyyy-MM-dd HH:mm:ss' || "" }}</div>
						</td>
            <td>{{ data.stype ? data.stype.name : "-" }}<span *ngIf="data.tubeType">,</span>{{data.tubeType && data.tubeType.name}}</td>
            <td>{{ data.speState ? data.speState.name : "-" }}</td>
            <td>{{ data.arriveTime || "-" }}</td>
            <td>{{ data.receiverName || "-" }}</td>
            <td>{{ data.transTime || '-' }}</td>
            <td>{{ data.sendTime || '-' }}</td>
            <td>{{ data.delivererName || "-" }}</td>
            <td>
              {{ data.checkDept ? data.checkDept.dept : "-" }}
              <img *ngIf="data.urgent == 1" src="../../assets/images/icon_ji.png" alt="" class="ji" />
            </td>
          </tr>
        </tbody>
      </nz-table>
      <!-- 科室检查率统计 -->
      <nz-table *ngIf="type === 'deptInspectionRateStatistics' || type === 'deptInspectionStatistics'" class="hospitalTable" [nzData]="inspectionRateStatisticsList" nzSize="middle" [nzShowPagination]="false"
        [nzLoading]="hsLoading" >
        <thead>
          <tr class="thead">
            <th nzWidth="4%">序号</th>
            <th nzWidth="12%">患者姓名（床号）</th>
            <th nzWidth="12%">检查项目</th>
            <th nzWidth="12%">预约时间</th>
            <th nzWidth="12%">叫号信息</th>
            <th nzWidth="12%">检查科室</th>
            <th nzWidth="12%">检查状态</th>
            <th nzWidth="12%">陪检人</th>
            <th nzWidth="12%">是否临时急查</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let data of inspectionRateStatisticsList;let i = index;">
            <td>{{ (pageIndex - 1) * pageSize + i + 1 }}</td>
            <td>{{ data.patientName }}<span *ngIf="data.patientBedNum">({{data.patientBedNum}})</span></td>
            <td>{{ data.inspectName}}</td>
            <td>{{ data.yyTime}}</td>
            <td>{{ data.reservationNumber}}</td>
            <td>{{ data.execDept ? data.execDept.dept : '' }}</td>
            <td>{{ data.inspectState?data.inspectState.name:''}}</td>
            <td>{{ data.workerName}}</td>
            <td>{{ data.priority == 1 ? '是' : '否'}}</td>
          </tr>
        </tbody>
      </nz-table>

      <!-- 被服洗涤批次管理-查看视图-查看异常 -->
      <nz-table *ngIf="type === 'washingException'" class="hospitalTable" [nzData]="washingExceptionList" nzSize="middle" [nzShowPagination]="false"
        [nzLoading]="hsLoading" >
        <thead>
          <tr class="thead">
            <th nzWidth="5%">序号</th>
            <th nzWidth="13%">关联科室</th>
            <th nzWidth="11%">被服种类</th>
            <th nzWidth="5%">调整数量</th>
            <th nzWidth="20%">调整原因</th>
            <th nzWidth="20%">备注</th>
            <th nzWidth="15%">时间</th>
            <th nzWidth="11%">操作人</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let data of washingExceptionList;let i = index;">
            <td>{{i+1}}</td>
            <td>{{ data.clothesDeptDTO?.dept }}</td>
            <td>{{ data.clothesType?.name }}</td>
            <td>{{ data.changeNum }}</td>
            <td>{{ data.clothesExceptionRe?.name }}</td>
            <td>{{ data.remarks }}</td>
            <td>{{ data.changeTime | date:"yyyy-MM-dd HH:mm:ss" }}</td>
            <td>{{ data.changerDTO?.name }}</td>
          </tr>
        </tbody>
      </nz-table>

      <div class="pagination" *ngIf="type !== 'blood' && type !== 'drugsJpbag' && type !== 'drugsWestern' && type !== 'drugsReturn' && type !== 'drugsPoison' && type !== 'drugsHerbal'">
        <ng-template #totalTemplate let-total> 共 {{ total }} 条 </ng-template>
        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="total"
          [(nzPageSize)]="pageSize" (nzPageIndexChange)="getList()"
          (nzPageSizeChange)="getList()" [nzShowTotal]="totalTemplate">
        </nz-pagination>
      </div>
    </div>
    <div class="display_flex justify-content_flex-center bottom-btn">
      <button class="btn know" nz-button nzType="primary" (click)="hideModal()">知道了</button>
    </div>
  </div>
</div>

<!-- 业务数据-二级信息查看 -->
<app-businessData-detail-info-modal
  *ngIf="businessDataModalShow"
  [show]="businessDataModalShow"
  [type]="businessDataModalType"
  [infoId]="infoId"
  (closeModelHs)="closeModelBlood($event)"
></app-businessData-detail-info-modal>

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