<div class="detail" *ngIf="!maskFlag">
  <div class="title">
    查看<i class="icon_transport transport-guanbi" (click)="close()"></i>
  </div>
  <div class="box">
    <div class="tab display_flex">
      <div [ngClass]="{ item: true, flex_1: true, checked: tabType == 1 }" (click)="checkTab(1)">基本信息</div>
      <div [ngClass]="{ item: true, flex_1: true, checked: tabType == 2 }" (click)="checkTab(2)">日志</div>
      <div [ngClass]="{ item: true, flex_1: true, checked: tabType == 3 }" (click)="checkTab(3)">检查项目</div>
      <div [ngClass]="{ item: true, flex_1: true, checked: tabType == 4 }" (click)="checkTab(4)">陪检工单</div>
    </div>

    <!-- 基本信息 -->
    <overlay-scrollbars #osComponentRef1 style="height: 90%; flex: 1" *ngIf="tabType == 1">
      <div class="content orders">
        <div class="top">
          <div class="info" nz-row>
            <div nz-col nzSpan="6">科室名称：{{ orderInfo.deptName }}</div>
            <div nz-col nzSpan="6">患者信息：{{ orderInfo.patientName }}</div>
            <div nz-col nzSpan="6">床号：{{ orderInfo.bedNum }}</div>
            <div nz-col nzSpan="6">年龄：<ng-container *ngIf="orderInfo.age !== undefined">{{ orderInfo.age }}岁</ng-container></div>
          </div>

          <div class="info" nz-row>
            <div nz-col nzSpan="6">护理级别：{{ orderInfo.careLevel?.name }}</div>
            <div nz-col nzSpan="6">危重等级：{{ orderInfo.illnessState?.name }}</div>
            <div nz-col nzSpan="6">出科时间：{{ orderInfo.outDeptTime | date:'yyyy-MM-dd HH:mm' }}</div>
            <div nz-col nzSpan="6">出科陪检人：{{ orderInfo.outDeptUserDTO?.name }}</div>
          </div>

          <div class="info" nz-row>
            <div nz-col nzSpan="6">回科时间：{{ orderInfo.backDeptTime | date:'yyyy-MM-dd HH:mm' }}</div>
            <div nz-col nzSpan="6">回科陪检人：{{ orderInfo.backDeptUserDTO?.name }}</div>
            <div nz-col nzSpan="6">签到科室：{{ orderInfo.signDeptDTO?.dept }}</div>
            <div nz-col nzSpan="6"></div>
          </div>

          <div class="info" nz-row>
            <div nz-col nzSpan="6">签到时间：{{ orderInfo.signTime | date: "yyyy-MM-dd HH:mm" }}</div>
            <div nz-col nzSpan="6">签到人：{{ orderInfo.signUserDTO?.name }}</div>
            <div nz-col nzSpan="6">关联工单数：{{ orderInfo.state && (orderInfo.state.value == 1 || orderInfo.state.value == 2) ? orderInfo.planOrderCount : orderInfo.orderCount }}</div>
            <div nz-col nzSpan="6"></div>
          </div>

          <div class="info" nz-row>
            <div nz-col nzSpan="6">关联检查项目：{{ orderInfo.state && (orderInfo.state.value == 1 || orderInfo.state.value == 2) ? orderInfo.planInspectCount : orderInfo. inspectCount }}</div>
            <div nz-col nzSpan="6">状态：{{ orderInfo.state?.name }}</div>
            <div nz-col nzSpan="6">携带设备：{{ orderInfo.goodsNames }}</div>
            <div nz-col nzSpan="6">陪检方式：{{ orderInfo.tripTypeDTO?.inspectMode }}</div>
          </div>

          <div class="info" nz-row>
            <div nz-col nzSpan="6">预约时间：{{ orderInfo.yyTime | date: "yyyy-MM-dd HH:mm" }}</div>
            <div nz-col nzSpan="6"><ng-container *ngIf="orderInfo.patientType && orderInfo.patientType.value == 'I'">住院号：{{orderInfo.patientCode}}（{{orderInfo.bedNum}}）</ng-container><ng-container *ngIf="orderInfo.patientType && orderInfo.patientType.value == 'O'">门诊号：{{orderInfo.patientCode}}</ng-container><ng-container *ngIf="orderInfo.patientType && orderInfo.patientType.value == 'E'">急诊号：{{orderInfo.patientCode}}</ng-container></div>
            <div nz-col nzSpan="6"></div>
            <div nz-col nzSpan="6"></div>
          </div>
        </div>
      </div>
    </overlay-scrollbars>
    <!-- 日志 -->
    <overlay-scrollbars #osComponentRef2 style="height: 90%;flex:1;" *ngIf="tabType == 2">
      <div class="content jifen">
        <div class="table">
          <nz-table class="integralTable" [nzData]="logList" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1">
            <thead>
              <tr class="thead">
                <th nzWidth="15%">动作</th>
                <th nzWidth="15%">操作时间</th>
                <th nzWidth="10%">操作人</th>
                <th nzWidth="10%">原负责人</th>
                <th nzWidth="10%">接收负责人</th>
                <th nzWidth="40%">备注</th>
              </tr>
            </thead>
            <tbody>
              <tr *ngFor="let item of logList; let i = index">
                <td>{{ item.operationType?.name }}</td>
                <td>{{ item.operationTime | date: 'yyyy-MM-dd HH:mm' }}</td>
                <td>{{ item.username }}</td>
                <td>{{ item.sourceHandoverName }}</td>
                <td>{{ item.handoverName }}</td>
                <td>{{ item.remark }}</td>
              </tr>
            </tbody>
          </nz-table>
        </div>
      </div>
    </overlay-scrollbars>
    <!-- 检查项目 -->
    <overlay-scrollbars #osComponentRef3 style="height: 90%;flex:1;" *ngIf="tabType == 3">
      <div class="content jifen">
        <div class="table">
          <nz-table class="integralTable" [nzData]="inspectList" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1">
            <thead>
              <tr class="thead">
                <th nzWidth="20%">检查单号</th>
                <th nzWidth="20%">检查项目</th>
                <th nzWidth="20%">检查地点</th>
                <th nzWidth="20%">预约时间</th>
                <th nzWidth="20%">状态</th>
              </tr>
            </thead>
            <tbody>
              <tr *ngFor="let item of inspectList; let i = index">
                <td>{{ item.inspectCode }}</td>
                <td>{{ item.inspectName }}</td>
                <td>{{ item.execDept?.dept }}</td>
                <td>{{ item.yyTime | date:"yyyy-MM-dd HH:mm" }}</td>
                <td>{{ item.inspectState?.name }}</td>
              </tr>
            </tbody>
          </nz-table>
        </div>
      </div>
    </overlay-scrollbars>
    <!-- 陪检工单 -->
    <overlay-scrollbars #osComponentRef4 style="height: 90%;flex:1;" *ngIf="tabType == 4">
      <div class="content jifen">
        <div class="table">
          <nz-table class="integralTable" [nzData]="orderList" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1">
            <thead>
              <tr class="thead">
                <th nzWidth="17%">终点科室</th>
                <th nzWidth="17%">任务类型</th>
                <th nzWidth="17%">发起时间</th>
                <th nzWidth="17%">执行人</th>
                <th nzWidth="17%">状态</th>
                <th nzWidth="15%">操作</th>
              </tr>
            </thead>
            <tbody>
              <tr *ngFor="let item of orderList; let i = index">
                <td>{{ item.endDeptsName }}</td>
                <td>{{ item.taskType.taskName }}</td>
                <td>{{ item.startTime | date:'yyyy-MM-dd HH:mm' }}</td>
                <td>{{ item.worker?.name }}</td>
                <td>{{ item.gdState.name }}</td>
                <td>
                  <div class="coop">
                    <span (click)="detail($event, item.id)">查看</span>
                  </div>
                </td>
              </tr>
            </tbody>
          </nz-table>
        </div>
      </div>
    </overlay-scrollbars>
  </div>
  <div class="btns">
    <button class="btn cancel" nz-button nzType="default" (click)="close()">
      关闭
    </button>
  </div>
</div>
<!-- 操作成功/失败提示框 -->
<app-prompt-modal
  *ngIf="promptModalShow"
  [content]="promptContent"
  [success]="ifSuccess"
  [show]="promptModalShow"
  [info]="promptInfo"
  (closeModel)="close()"
>
  <!-- 2.父组件调用子组件时绑定到这个事件属性，并在事件发生时作出回应。(closeModel)="close()" -->
</app-prompt-modal>

<!-- 遮罩 -->
<app-mask *ngIf="maskFlag"></app-mask>

<!-- 查看详情 -->
<router-outlet></router-outlet>
