<div class="modal display_flex justify-content_flex-center align-items_center">
  <div class="modalBody" style="width: 1200px;">
    <div class="title">科室内打包信息<i class="icon_transport transport-guanbi" (click)="hideModal()"></i></div>
    <div class="list-template w100">
      <div class="list-template__content">
        <div class="list-template__top" nz-row>
          <div nz-col nzXl='24' class="list-template__searchBox">
            <div class="list-template__searchItem">
              <span class="label">状态</span>：
              <nz-select class="formItem" nzAllowClear [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择状态" [(ngModel)]="searchCriteria.status" (ngModelChange)="selectStatus($event)">
                <nz-option *ngFor="let option of specimentPackageTypeList" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
              </nz-select>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="content">
      <nz-table class="hospitalTable" [nzData]="packageList" nzSize="middle" [nzShowPagination]="false"
        [nzLoading]="hsLoading" [nzScroll]="{ y: '500px' }">
        <thead>
          <tr class="thead">
            <th nzWidth="13%">包号</th>
            <th nzWidth="6%">打包人</th>
            <th nzWidth="14%">打包时间</th>
            <th nzWidth="6%">标本数</th>
            <th nzWidth="6%">收取人</th>
            <th nzWidth="14%">收取时间</th>
            <th nzWidth="6%">送达人</th>
            <th nzWidth="14%">送达时间</th>
            <th nzWidth="6%">状态</th>
            <th nzWidth="15%">操作</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let data of packageList;let i = index;">
            <td class="underline" (click)="viewSpe(data)">{{ data.packCode }}</td>
            <td>{{ data.packUserDTO?.name }}</td>
            <td>{{ data.packTime | date: 'yyyy-MM-dd HH:mm'}}</td>
            <td>{{ data.specimenNum }}</td>
            <td>{{ data.receiveUserDTO?.name }}</td>
            <td>{{ data.receiveTime | date: 'yyyy-MM-dd HH:mm'}}</td>
            <td>{{ data.deliveryUserDTO?.name }}</td>
            <td>{{ data.deliveryTime | date: 'yyyy-MM-dd HH:mm'}}</td>
            <td>{{ data.status?.name }}</td>
            <td>
              <div class="coop">
                <span (click)="printPackageByConfig(data)" *ngIf="data.status.value !== '0'">补打</span>
                <span (click)="toSpecimenPackage(data)" *ngIf="data.status.value === '0' || data.status.value === '1'">修改</span>
                <span (click)="showDelModal(data, '您确认要删除吗？', '删除', 'del')" *ngIf="data.status.value === '0' || data.status.value === '1'">删除</span>
              </div>
            </td>
          </tr>
        </tbody>
      </nz-table>

      <div class="pagination">
        <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 cancel know" nz-button nzType="default" (click)="hideModal()">取消</button>
    </div>
  </div>
</div>

<!-- 模态框 -->
<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
(confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>

<!-- 操作成功/失败提示框 -->
<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
  [info]="promptInfo">
</app-prompt-modal>

<!-- 打印的内容 -->
<div id="print-section-package" hidden>
  <!-- 80mm*80mm -->
  <div style="overflow: hidden;padding: 2mm;font-size: 4mm;width: 75mm;height: 75mm;" *ngIf="configs.spePackageCodeSize == 1">
    <div style="display: flex;">
      <img [src]="base64" style="width: 23mm;height: 23mm;margin-right: 3mm;">
      <div style="flex: 1;">
        <div>包号：{{package.packCode}}</div>
        <div style="margin-top: 3mm;">打包人：{{package.packUserDTO?.name}}</div>
        <div style="margin-top: 3mm;">标本总数：{{package.specimenNum}}</div>
      </div>
    </div>
    <div style="margin-top: 3mm;">打包时间：{{package.packTime | date: 'yyyy-MM-dd HH:mm'}}</div>
    <div style="margin-top: 3mm;">打包科室：{{package.packDeptDTO?.dept}}</div>
    <div style="margin-top: 3mm;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">终点科室：{{package.targetDeptDTO?.dept}}</div>
    <div style="display: flex;flex-wrap: wrap;" *ngIf="configs.spePrintTubeType == 1">
      <div style="width: 33.33%;margin-top: 3mm;" *ngFor="let item of typeSpecimentList | slice:0:9">{{item.name}}：{{item.size}}</div>
    </div>
  </div>
  <!-- 70mm*50mm -->
  <div style="overflow: hidden;padding: 2mm;font-size: 4mm;width: 65mm;height: 45mm;" *ngIf="configs.spePackageCodeSize == 2">
    <div style="display: flex;">
      <img [src]="base64" style="width: 23mm;height: 23mm;margin-right: 3mm;">
      <div style="flex: 1;">
        <div>包号:{{package.packCode}}</div>
        <div>{{package.packDeptDTO?.dept}}</div>
        <div>{{package.packTime | date: 'yyyy-MM-dd HH:mm'}}</div>
        <div>{{package.specimenNum}};{{package.packUserDTO?.name}}</div>
      </div>
    </div>
    <div style="display: flex;flex-wrap: wrap;" *ngIf="configs.spePrintTubeType == 1">
      <div *ngFor="let item of typeSpecimentList">{{item.name}}:{{item.size}}</div>
    </div>
  </div>
</div>

<!-- 查看标本 -->
<app-view-specimen *ngIf="showModal" [speId]="speId" (closeModelHs)="closeModel($event)"></app-view-specimen>

<button ngxPrint printSectionId="print-section-package" #printBtnPackage hidden [printStyle]="{ '@page': { margin: '0 !important' }, 'body': { margin: '0 !important' } }">打印</button>
