<!-- 患者陪检/患者转运 -->
<div class="detail" *ngIf="!maskFlag">
  <div class="title">工单信息<i class="icon_transport transport-guanbi" (click)="close()"></i></div>
  <overlay-scrollbars #osComponentRef1 style="height: 90%; flex: 1">
    <div class="content">
      <div class="top" *ngIf="amplificationShow">
        <div class="num">
          <span class="left">单号：{{orderInfo.gdcode}}</span>
          <span class="right">{{orderInfo.gdState.name}}</span>
        </div>
        <div class="info" nz-row>
          <div nz-col nzSpan="8">工单日期：{{orderInfo.startTime}}</div>
          <div nz-col nzSpan="8">总耗时：{{orderInfo.showTimeNum}}</div>
          <div nz-col nzSpan="8">申请类型：{{orderInfo.taskType.taskName}}<ng-container *ngIf="orderInfo.goodsRemark">-{{orderInfo.goodsRemark}}</ng-container></div>
          <div nz-col nzSpan="8">
            申请科室：{{orderInfo.createDeptDTO?(!showCoop&&deptDisplay==2?orderInfo.createDeptDTO.deptalias:orderInfo.createDeptDTO.dept):'-'}}
          </div>
          <div nz-col nzSpan="8">
            起点科室：{{orderInfo.startDept?(!showCoop&&deptDisplay==2?orderInfo.startDept.deptalias:orderInfo.startDept.dept):'-'}}
          </div>
          <div nz-col nzSpan="8" *ngIf="middleDept.length>0">中间科室：{{middleDept.join('，')}}</div>
          <div nz-col nzSpan="8">目标科室：
            <span *ngFor="let dep of orderInfo.endDepts;let i=index;">
              <span *ngIf="i!=orderInfo.endDepts.length-1">{{!showCoop&&deptDisplay==2?dep.deptalias:dep.dept}},</span>
              <span *ngIf="i==orderInfo.endDepts.length-1">{{!showCoop&&deptDisplay==2?dep.deptalias:dep.dept}}</span>
            </span>
          </div>
          <div nz-col nzSpan="8">陪同情况：{{orderInfo.isAccompany==1?'需要医护陪同':'无需医护陪同'}}</div>
          <div nz-col nzSpan="8">预约时间：{{orderInfo.yyjdTime|date:'MM-dd HH:mm'}}</div>
          <div nz-col nzSpan="8" *ngIf="orderInfo.worker">配送人员信息：{{orderInfo.worker.name}}</div>
          <div nz-col nzSpan="8" *ngIf="orderInfo.taskType.associationType.value==='inspect'">
            是否半程陪检：{{orderInfo.isHalfInspect===1?'是':'否'}}</div>
          <div nz-col nzSpan="8" *ngIf="orderInfo.inspectScore">
            陪检方式：{{orderInfo.inspectScore.inspectMode}}</div>
          <div nz-col nzSpan="8" *ngIf="orderInfo.inspectUsers">
            陪检人员：{{orderInfo.inspectUsers}}</div>
          <div nz-col nzSpan="8" *ngIf="orderInfo.inspectUsersNum">
            陪检人数：{{orderInfo.inspectUsersNum}}</div>
          <div nz-col nzSpan="24" *ngIf="orderInfo.workOrderRemark">
            注意事项：{{orderInfo.workOrderRemark}}</div>
          <div nz-col nzSpan="24" *ngIf="orderInfo.specialCloseReason">
            特殊情况关闭原因：{{orderInfo.specialCloseReason}}
          </div>
        </div>
      </div>
      <div class="center" *ngIf="amplificationShow">
        <div class="box display_flex justify-content_flex-center">
          <div class="steps" *ngFor="let step of logList;let i = index;">
            <div class="step">
              <div class="info">
                <i
                  [ngClass]="{'icon_transport':true, 'transport-icon_liucheng':true,'green':(step.record&&step.record[0]&&step.record[0].operationTime)}"></i>
                <p>{{step.operationName}}</p>
								<p>{{step.record.length>=1 && step.operationName=='申请' ? step.record[0].username : ''}}</p>
                <p>{{step.record.length>=1?(step.record[0].operationTime|date:'MM-dd HH:mm'):''}}</p>
                <p *ngIf="step.record[0]&&step.record[0].dept">
                  <span *ngFor="let dept of step.record">{{!showCoop&&deptDisplay==2?dept.deptalias:dept.dept}},</span>
                </p>
                <p *ngIf="i!=0&&step.record&&step.record.length">耗时{{filterTime(step.record)}}</p>
              </div>
              <div class="line"></div>
            </div>
          </div>
        </div>
      </div>
      <div class="bottom">
        <div class="urgent">
          <div>
            <ng-container *ngIf="amplificationShow&&orderInfo.urgentDetails&&showCoop">
                加急原因：{{orderInfo.urgentDetails.urgentReason}}
              <button *ngIf="orderInfo.urgentDetails.checkStatus.id==329" class=" btn default" nz-button nzType="primary"
                [nzLoading]="urgentLoading" nzGhost (click)="urgent()">确认加急</button>
            </ng-container>
          </div>
          <div class="amplification">
            <button
              nz-button
              nzType="primary"
              class="btn default"
              (click)="amplification()"
            >
              {{ amplificationShow ? "放大" : "还原" }}
            </button>
          </div>
        </div>
        <div class="info">
          <div nz-row class="top">
            <div class="left" nz-col nzSpan="12">
              <p>
                <span class="label">患者姓名</span>
                <span>{{orderInfo.patient.patientName}}</span>
              </p>
              <p *ngIf="orderInfo.patient.residenceNo">
                <span class="label">床位</span>
                <span>{{orderInfo.patient.bedNum}}</span>
              </p>
							<p *ngIf="!orderInfo.patient.residenceNo">
							  <span class="label">就诊卡号</span>
							  <span>{{orderInfo.patient.cardNo}}</span>
							</p>
              <p *ngIf="orderInfo.patient.careLevel">
                <span class="label">{{orderInfo.patient.careLevel.desc}}</span>
                <span>{{orderInfo.patient.careLevel.name}}</span>
              </p>
            </div>
            <div class="right" nz-col nzSpan="12">
              <p *ngIf="orderInfo.patient.residenceNo">
                <span class="label">住院号</span>
                <span>{{orderInfo.patient.residenceNo}}</span>
              </p>
							<p *ngIf="!orderInfo.patient.residenceNo">
							  <span class="label">身份证号</span>
							  <span>{{orderInfo.patient.identityCardNo}}</span>
							</p>
              <p>
                <span class="label">携带设备</span>
                <span>{{orderInfo.goods||'暂无'}}</span>
              </p>
              <p *ngIf="orderInfo.patient.illnessState">
                <span class="label">{{orderInfo.patient.illnessState.desc}}</span>
                <span>{{orderInfo.patient.illnessState.name}}</span>
              </p>
            </div>
          </div>
        </div>
        <ng-container *ngIf="orderInfo.taskType.associationType.value=='inspect'">
          <div class="info" *ngFor="let item of orderInfo.checkList">
            <div nz-row class="top">
              <div nz-col nzSpan="8">
                <p>
                  <span class="label">检查项目：</span>
                  <span>
                    <span>
                      <span>{{item.inspectName||'-'}}</span>
                    </span>
                  </span>
                </p>
              </div>
              <div nz-col nzSpan="8">
                <p>
                  <span class="label">预约时间：</span>
                  <span>{{item.yyEndTime||'-'}}</span>
                </p>
              </div>
              <div nz-col nzSpan="8">
                <p>
                  <span class="label">叫号信息：</span>
                  <span>{{item.reservationNumber||'-'}}</span>
                </p>
              </div>
              <div nz-col nzSpan="8">
                <p>
                  <span class="label">到达时间：</span>
                  <span>{{item.arriveTime||'-'}}</span>
                </p>
              </div>
              <div nz-col nzSpan="8">
                <p>
                  <span class="label">检查科室：</span>
                  <span>{{item.execDept?(!showCoop&&deptDisplay==2?item.execDept.deptalias:item.execDept.dept):'-'}}</span>
                </p>
              </div>
              <div nz-col nzSpan="8">
                <p>
                  <span class="label">是否送达：</span>
                  <span>{{item.arriveTime?'是':'否'}}</span>
                </p>
              </div>
              <div nz-col nzSpan="24">
                <p>
                  <span class="label">医生备注：</span>
                  <span>{{item.remark}}</span>
                </p>
              </div>
            </div>
          </div>
        </ng-container>
      </div>
    </div>
  </overlay-scrollbars>
  <div class="btns display_flex justify-content_flex-center align-items_center">
    <!-- <button *ngIf="showCoop&&orderInfo.gdState.id==69" nz-button nzType="primary" (click)='allotWorker()'>派单</button>
    <button *ngIf="showCoop&&(orderInfo.gdState.id==70||orderInfo.gdState.id==71)" nz-button nzType="primary" nzGhost
      (click)="openRecallModal()">撤回</button>
    <button *ngIf="showCoop&&(orderInfo.gdState.id==69||orderInfo.gdState.id==70||orderInfo.gdState.id==71)" nz-button
      nzType="danger" (click)="openDelModal()">删除</button> -->
    <button class=" btn cancel" nz-button nzType="default" (click)="close()">取消</button>
  </div>
</div>

<!-- 撤回工单 -->
<div class="recallOrder display_flex justify-content_flex-center align-items_center" *ngIf="recallOrderShow">
  <div class="modalBody">
    <div class="title">提示<i class="icon_transport transport-guanbi" (click)="closeRecallOrderModal()"></i></div>
    <div class="content">
      <div class="icon"><i class="icon_transport transport-wenhao"></i></div>
      <div class="defeat">您确认要撤回此工单吗？</div>
    </div>
    <div class="btns display_flex justify-content_flex-center">
      <button nz-button nzType="primary" [nzLoading]='btnLoading' (click)="confirmRec()">确认</button>
      <button nz-button nzType="primary" [nzLoading]='recLoading' nzGhost (click)="recAndDel()">撤回并删除</button>
      <button class=" btn cancel" nz-button nzType="default" (click)="closeRecallOrderModal()">取消</button>
    </div>
  </div>
</div>

<!-- 删除工单 -->
<div class="recallOrder delModel display_flex justify-content_flex-center align-items_center" *ngIf="delOrderShow">
  <div class="modalBody">
    <div class="title">提示<i class="icon_transport transport-guanbi" (click)="closeDelOrderModal()"></i></div>
    <div class="content">
      <div class="icon"><i class="icon_transport transport-wenhao"></i></div>
      <div class="defeat">您确认要删除此工单吗？</div>
    </div>
    <div class="btns display_flex justify-content_flex-center">
      <button nz-button nzType="primary" [nzLoading]='btnLoading' (click)="confirmDel()">确认</button>
      <button class=" btn cancel" nz-button nzType="default" (click)="closeDelOrderModal()">取消</button>
    </div>
  </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>
