<div class="pharmacy">
  <!-- 头部 start -->
  <div class="pharmacy-header">
   <div class="pharmacy-logo">
<!--      <img
        [src]="tool.logoUrl"
        class="pharmacy-logo__img"
        [alt]="tool.logoTitle"
      />
      <h1 class="pharmacy-logo__name">{{tool.logoTitle}}</h1> -->
			<h2 class="pharmacy-name__title">
			  <span>标本间</span>
			  <!-- <span class="currentDate">{{ time | date: "yyyy年MM月dd日" }}</span> -->
			</h2>
    </div>
    <div class="pharmacy-name">
      <div class="pharmacy-name__total">
				<div class="pharmacy-title">标本条码：</div>
				<nz-input-group nzSize="large">
					<input type="text" id="Binput" (ngModelChange)="specimenCodeChange($event)" [(ngModel)]="barCode" nz-input placeholder="请输入条码" />
				</nz-input-group>
				<!-- <ng-template #suffixButton>
					<button nz-button nzType="primary" nzSize="large" nzSearch (click)="searchSpecimen()">搜索</button>
				</ng-template> -->
      </div>
			<div>
				<div class="error-class">{{searchMsg}}</div>
			</div>
			<button class="right-btn" nz-button nzType="primary" (click)="specimenCheck()">标本核对</button>
    </div>
		<div class="right">
		  <div class="userInfo dropdown">
		    <div class="user" (mouseenter)="showDropdown = true" (mouseleave)="showDropdown = false">
		      <img src="../../assets/images/icon_keshi.png" alt="">
		      <span><ng-container *ngIf="loginUser.dept">{{deptDisplay == 2 ? loginUser.dept.deptalias : loginUser.dept.dept}}-</ng-container>{{loginUser.name}}</span>
		      <i class="icon_transport transport-xiala1 ml8"></i>
		    </div>
		    <div class="dropdown-content r8" [hidden]="!showDropdown" (mouseenter)="showDropdown = true" (mouseleave)="showDropdown = false">
		      <div class="dropdownItem" (click)="setSpecimen()">切换科室</div>
					<div class="dropdownItem" (click)="distributionRecord()">配送记录</div>
					<div class="dropdownItem" (click)="toMain()">回到系统管理</div>
		      <div class="dropdownItem" (click)="logOut()">退出</div>
		    </div>
		  </div>
		</div>
<!--    <div class="userInfo">
      <div class="wel">欢迎您：</div>
      <div class="user">
        <img src="../../assets/images/icon_keshi.png" alt="" />
        <span *ngIf="deptDisplay">{{
          deptDisplay == 2 ? loginUser.dept.deptalias : loginUser.dept.dept
        }}</span>
      </div>
      <div class="userInfo-wrap">
        <div class="logOut" (click)="setSpecimen()">切换科室</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>手术间标本</strong>
				<span *ngIf="otherData1">{{otherData1.pathologyFormNum}}申请单 {{otherData1.specimenNum}}标本</span>
        <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('surgeryDept')">
            <i nz-icon nzType="search"></i>
            <span>搜索</span>
          </div>
        </div>
      </div>
      <!-- 搜索框 end -->
      <!-- 列表 start -->
      <div #osComponentRef1 class="pharmacy-main__selectionWrap">
        <div *ngIf="!loading1" style="height: 100%">
          <div
            class="pharmacy-main__selection noPointer"
            *ngFor="let item of printPharmacyList"
						(click)="viewDetail(item,1)"
          >
            <div class="pharmacy-main__selectionInfo">
              <div class="pharmacy-main__selectionItem">
                <span title="住院号" class="weight">
									<span class="sign-red" *ngIf="item.pathologyFormType==1">速</span>
									<span *ngIf="item.pathologyFormType==0">普</span>
									<span *ngIf="item.pathologyFormType==2">细</span>
									{{item.applyCode || '无'}}
								</span>
                <span title="姓名" class="weight text-right">{{item.patientDTO.patientName || '无'}}</span>
              </div>
              <div class="pharmacy-main__selectionItem">
                <span class="text-left" [title]="item.takePart">部位：{{item.takePart || '无'}}</span>
                <span class="text-right" title="标本数">标本数：{{item.specimenNum || '无'}}</span>
              </div>
              <div class="pharmacy-main__selectionItem">
                <span title="手术间">手术间：{{item.surgeryDeptDTO.dept || '无'}}</span>
                <span class="text-right" title="离体时间">离体时间：{{item.inVitroTime?(item.inVitroTime|date:'yyyy-MM-dd HH:mm:ss'):'无'}}</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>
      </div>
      <!-- 列表 end -->
    </div>

    <!-- 标本间标本 start -->
    <div class="pharmacy-main__list pharmacy-main__waitDelivery">
      <!-- 标题 start -->
      <div class="pharmacy-main__title">
        <strong>标本间标本</strong>
				<span *ngIf="otherData2">{{otherData2.pathologyFormNum}}申请单 {{otherData2.specimenNum}}标本</span>
        <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('specimenDept')">
            <i nz-icon nzType="search"></i>
            <span>搜索</span>
          </div>
        </div>
      </div>
      <!-- 搜索框 end -->
      <!-- 列表 start -->
      <div #osComponentRef2 class="pharmacy-main__selectionWrap">
        <div *ngIf="!loading2" style="height: 100%">
          <div
            class="pharmacy-main__selection"
            *ngFor="let item of waitPharmacyList; let i = index"
						(click)="viewDetail(item,2)"
          >
            <div class="pharmacy-main__selectionInfo">
              <div class="pharmacy-main__selectionItem">
                <span title="住院号" class="weight">
									<span class="sign-red" *ngIf="item.pathologyFormType==1">速</span>
									<span *ngIf="item.pathologyFormType==0">普</span>
									<span *ngIf="item.pathologyFormType==2">细</span>
									{{item.applyCode || '无'}}
            		</span>
                <span title="姓名" class="weight text-right">{{item.patientDTO.patientName || '无'}}</span>
              </div>
              <div class="pharmacy-main__selectionItem">
                <span class="text-left" [title]="item.takePart">部位：{{item.takePart || '无'}}</span>
                <span class="text-right" title="标本数">标本数：{{item.specimenNum || '无'}}</span>
              </div>
              <div class="pharmacy-main__selectionItem">
                <span title="离体时间">离体时间：{{item.inVitroTime?(item.inVitroTime|date:'yyyy-MM-dd HH:mm:ss'):'无'}}</span>
								<span class="text-right" title="固定时间">固定时间：{{item.fixationTime?(item.fixationTime|date:'yyyy-MM-dd HH:mm:ss'):'无'}}</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>
      </div>
      <!-- 列表 end -->
    </div>

    <!-- 今日离科标本 start -->
    <div class="pharmacy-main__list pharmacy-main__delivery">
      <!-- 标题 start -->
      <div class="pharmacy-main__title">
        <strong>今日离科标本</strong>
				<span *ngIf="otherData3">{{otherData3.pathologyFormNum}}申请单 {{otherData3.specimenNum}}标本</span>
        <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('leavedDept')">
            <i nz-icon nzType="search"></i>
            <span>搜索</span>
          </div>
        </div>
      </div>
      <!-- 搜索框 end -->
      <!-- 列表 start -->
      <div #osComponentRef3 class="pharmacy-main__selectionWrap">
        <div *ngIf="!loading3" style="height: 100%">
          <div
            class="pharmacy-main__selection"
            *ngFor="let item of pharmacyList; let i = index"
						(click)="viewDetail(item,3)"
          >
            <div class="pharmacy-main__selectionInfo">
              <div class="pharmacy-main__selectionItem">
                <span title="住院号" class="weight">
            			<span class="sign-red" *ngIf="item.pathologyFormType==1">速</span>
            			<span *ngIf="item.pathologyFormType==0">普</span>
									<span *ngIf="item.pathologyFormType==2">细</span>
									{{item.applyCode || '无'}}
            		</span>
                <span title="姓名" class="weight text-right">{{item.patientDTO.patientName || '无'}}</span>
              </div>
              <div class="pharmacy-main__selectionItem">
                <span class="text-left" [title]="item.takePart">部位：{{item.takePart || '无'}}</span>
                <span class="text-right" title="标本数">标本数：{{item.specimenNum || '无'}}</span>
              </div>
              <div class="pharmacy-main__selectionItem">
                <span title="离体时间">离体时间：{{item.inVitroTime?(item.inVitroTime|date:'yyyy-MM-dd HH:mm:ss'):'无'}}</span>
            		<span class="text-right" title="固定时间">固定时间：{{item.fixationTime?(item.fixationTime|date:'yyyy-MM-dd HH:mm:ss'):'无'}}</span>
              </div>
							<div class="pharmacy-main__selectionItem">
							  <span title="配送人">配送人：{{item.deliveryUserDTO?item.deliveryUserDTO.name:'无'}}</span>
								<span class="text-right" title="离科时间">离科时间：{{item.leaveDeptTime?(item.leaveDeptTime|date:'yyyy-MM-dd HH:mm:ss'):'无'}}</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>
      </div>
      <!-- 列表 end -->
    </div>
  </div>
  <!-- 主体部分 end -->
  <router-outlet></router-outlet>
</div>

<!-- 科室切换提示框 -->
<app-hs-prompt-modal
  [changeShow]="changeShow"
  [closeTime]="closeTime"
  [closeTimeFlag]="closeTimeFlag"
  [show]="hsPromptModalShow"
  (closeModelHs)="closeModelHs($event)"
  (clearModelHs)="clearModelHs($event)"
  deptType="nurse"
> 
  <!-- 返回系统按钮 -->
  <!-- 右侧悬浮框 -->
   <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-history-prompt-modal
  *ngIf="logPromptModalShow"
  [show]="logPromptModalShow"
  [scode]="scode"
  (closeModelHs)="closeModelLog($event)"
></app-history-prompt-modal> -->

<!-- 标本列表查看 -->
<!-- <app-spe-prompt-modal
  *ngIf="spePromptModalShow"
  [show]="spePromptModalShow"
  [checkDeptId]="checkDeptId"
  [pharmacySearchKey]="pharmacySearchKey"
  [printDate]="printDate"
  (closeModelHs)="closeModelSpe($event)"
></app-spe-prompt-modal> -->

<!-- 工单列表查看 -->
<!-- <app-order-prompt-modal
  *ngIf="orderPromptModalShow"
  [show]="orderPromptModalShow"
  [workId]="workId"
  (closeModelHs)="closeModelOrder($event)"
></app-order-prompt-modal> -->

<!-- 关联标本/手术室 -->
<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="relevanceModal">
	<div class="modalBody">
		<div class="title">关联科室</div>
		<overlay-scrollbars #osComponentRef1 class="content">
		 <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
			<nz-form-item>
				<nz-form-label nzRequired nzFor="specimen" [nzSm]="5" [nzXs]="24">关联标本间</nz-form-label>
				<nz-form-control nzErrorTip="请选择标本间!" [nzSm]="19" [nzXs]="24">
					<nz-input-group>
						<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择标本间" formControlName="specimen">
							<ng-container *ngFor="let option of specimenData">
								<nz-option [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
							</ng-container>
						</nz-select>
					</nz-input-group>
				</nz-form-control>
			</nz-form-item>
			
			<nz-form-item>
				<nz-form-label nzRequired nzFor="operation" [nzSm]="5" [nzXs]="24">关联手术间</nz-form-label>
				<nz-form-control nzErrorTip="请选择手术间!" [nzSm]="19" [nzXs]="24">
					<nz-input-group>
						<nz-select class="formItem" nzMode="multiple" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择请选择手术间" formControlName="operation">
							<ng-container *ngFor="let option of operationData">
								<nz-option [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
							</ng-container>
						</nz-select>
					</nz-input-group>
				</nz-form-control>
			</nz-form-item>
			
			<nz-form-item>
				<nz-form-label nzRequired nzFor="generate">标本是否直接生成配送单</nz-form-label>
				<nz-form-control nzErrorTip="请选择!">
					<nz-radio-group formControlName="generate">
						<label nz-radio [nzValue]="1">是</label>
						<label nz-radio [nzValue]="0">否</label>
					</nz-radio-group>
				</nz-form-control>
			</nz-form-item>
			
			<nz-form-item>
				<nz-form-label nzRequired nzFor="showFrozen">标本是否显示速冻</nz-form-label>
				<nz-form-control nzErrorTip="请选择!">
					<nz-radio-group formControlName="showFrozen">
						<label nz-radio [nzValue]="1">是</label>
						<label nz-radio [nzValue]="0">否</label>
					</nz-radio-group>
				</nz-form-control>
			</nz-form-item>
		 </form>
		</overlay-scrollbars>
		<div class="display_flex justify-content_flex-center">
			<button class="btn" nz-button nzType="primary" (click)="submitForm()" [nzLoading]="btnLoading">确定</button>
			<button class="btn mar-left" nz-button nzType="primary" nzGhost (click)="hideModal()">
			  取消
			</button>
		</div>
	</div>
</div>


<!-- 标本接收 -->
<div class="pathology-box display_flex align-items_center justify-content_flex-center" *ngIf="fixationModal">
	<div class="pathology-content width-80">
		<div class="title">标本接收及固定
		<i class="icon_transport transport-guanbi" (click)="hideSpecimenModal()"></i></div>
		<div class="content">
			<div class="content-item boder-right">
				<nz-form-item class="form-title-box">
					<div class="form-title">申请单类型：{{codeData.pathologyFormType==1?'术中快速病理检查申请单':'病理检查申请单'}}</div>
					<div class="form-title"><span class="font-weight-500">状态：</span>{{codeData.status?codeData.status.name:'-'}}</div>
				</nz-form-item>
				<nz-form-item class="form-title-box">
					<div class="form-title"><span class="font-weight-500">申请单号：</span>{{codeData.applyCode}}</div>
					<div class="form-title over-class"><span class="font-weight-500">申请科室：</span>{{codeData.patientDTO.department.dept}}</div>
				</nz-form-item>
				<nz-form-item class="form-title-box">
					<div class="form-title">手术间：{{codeData.surgeryDeptDTO.dept}}</div>
					<div class="form-title">取材医生：{{codeData.surgeryDoctorDTO?codeData.surgeryDoctorDTO.name : '-'}}</div>
				</nz-form-item>
				<nz-form-item class="form-title-box">
					<div class="form-title mar-ri-20"><span class="font-weight-500">患者信息：</span>{{codeData.patientDTO.patientName}} ({{codeData.patientDTO.bedNum}}床)</div>
					<div class="form-title mar-ri-20"><span class="font-weight-500">年龄：</span>{{codeData.patientDTO.age||'-'}}</div>
					<div class="form-title mar-ri-20"><span class="font-weight-500">性别：</span>{{codeData.patientDTO.gender?codeData.patientDTO.gender.name:'-'}}</div>
					<div class="form-title mar-ri-20"><span class="font-weight-500">住院号：</span>{{codeData.patientDTO.patientCode}}</div>
				</nz-form-item>
				<div class="form-title-box">
					<div class="form-title"><span class="font-weight-500">检验项目：</span>{{project||'无'}}</div>
				</div>
				<div class="form-list">
					<div class="form-title font-weight-500">诊断：</div>
					<div class="indent">
						{{codeData.diagnose||'无'}}
					</div>
				</div>
				
				<div class="form-list">
					<div class="form-title font-weight-500">病历摘要：</div>
					<div class="indent">{{codeData.medicalRecords||'无'}}</div>
				</div>
				<div class="form-list">
					<div class="form-title font-weight-500">手术方案：</div>
					<div class="indent">{{codeData.surgicalPlan||'无'}}</div>
				</div>
				<div class="form-list">
					<div class="form-title font-weight-500">术中所见：</div>
					<div class="indent">{{codeData.intraoperativeFindings||'无'}}</div>
				</div>
				<div class="form-title-box">
					<div class="form-title"><span class="font-weight-500">标本类型：</span>{{codeData.specimenType?codeData.specimenType.name:'无'}}</div>
					<div class="form-title"><span class="font-weight-500">标本数量：</span>{{codeData.specimenNum?codeData.specimenNum:'无'}}</div>
				</div>
				<div class="form-title-box">
					<div class="form-title"><span class="font-weight-500">部位：</span>{{codeData.takePart||'无'}}</div>
				</div>
			</div>
			
			<div class="content-item">
				<!-- <div class="center">提示：本申请单内共有<span class="red">{{totalNum}}</span>只标本固定，已固定<span class="red">{{fixationNum}}</span>份还需固定<span class="red">{{specimenNum}}</span>份</div> -->
				<div class="center">提示：本申请单内共有<span class="red">{{codeData.specimenNum}}</span>只标本</div>
				<div class="disp-fl">
					<div class="width-120">标本条码：</div>
					<input nz-input id="specimen" [(ngModel)]="specimenCode" (ngModelChange)="codeChange($event)"/>
				</div>
				<div class="error-fix">{{fixationError}}</div>
				<div class="list-template">
				  <div class="list-template__content">
						<div class="list-template__bottom" style="padding: 0 !important;">
							<nz-table class="list-template__nzTable" [nzData]="codeDataSpecimenList" nzSize="middle" [nzShowPagination]="false"
								[nzLoading]="tableLoading">
								<thead>
									<tr class="thead">
										<th nzWidth="10%">序号</th>
										<th>条码号</th>
										<th>标本名称</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let data of codeDataSpecimenList let index = index">
										<td>{{index+1}}</td>
										<td>{{ data.specimenCode}}</td>
										<td>
											<span *ngIf="data.partSource && data.partSource.value!=1">{{data.partSource?data.partSource.name:''}}</span>{{data.specimenName}}
										</td>
									</tr>
								</tbody>
							</nz-table>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="display_flex justify-content_flex-center bottom-btn">
			<!-- <button class="btn btn-right" [disabled]="codeData.specimenNum != codeDataSpecimenList.length" nz-button nzType="primary" (click)="submitFixationForm()" [nzLoading]="btnLoading">确定</button> -->
			<button class="btn btn-right" nz-button nzType="primary" (click)="submitFixationForm()" [nzLoading]="btnLoading">确定</button>
			<button class="btn cancel" nz-button nzType="default" (click)="hideSpecimenModal()">取消</button>
		</div>
	</div>
</div>

<!-- 操作成功/失败提示框 -->
<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
  [info]="promptInfo" (closeModel)="closeModel()"></app-prompt-modal>
	
<!-- 标本固定信息 -->
<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="verificationMoadl">
	<div class="modalBody no-width">
		<div class="title">{{!ifFixType?'标本固定信息':'标本接受收信息'}}<i class="icon_transport transport-guanbi" (click)="hideVerificationModal()"></i>
		</div>
		<div class="content">
			<form nz-form [formGroup]="validateVerificationForm" class="addForm" (ngSubmit)="submitVerificationForm()">
				<nz-form-item *ngIf="!ifFixType">
				  <nz-form-label nzRequired [nzSpan]="6" nzFor="fixationTime">固定时间</nz-form-label>
				<!--  <nz-form-control [nzSpan]="18" nzErrorTip="请选择固定时间!">
				    <nz-input-group>
							<nz-date-picker formControlName="fixationTime" 
							[nzShowTime]="{ nzFormat: 'yyyy-MM-dd HH:mm:ss' }" nzFormat="yyyy-MM-dd HH:mm:ss"
							(ngModelChange)="formChangeDate($event)"></nz-date-picker>
						</nz-input-group>
				  </nz-form-control> -->
					<nz-form-control style="display: flex;align-items: center;" [nzSpan]="18" nzErrorTip="请选择固定时间!">
					  <nz-input-group style="display: flex;gap: 10px">
							<nz-date-picker formControlName="fixationDate" (ngModelChange)="fixationDateChange($event)"></nz-date-picker>
							
							<nz-time-picker formControlName="fixationTimes" nzFormat="HH:mm" (ngModelChange)="fixationTimeChange($event)"></nz-time-picker>
						</nz-input-group>
					</nz-form-control>
				</nz-form-item>
				<nz-form-item>
				  <nz-form-label nzRequired [nzSpan]="6" nzFor="jobNumber">医生工号</nz-form-label>
					<nz-form-control [nzSpan]="18" nzErrorTip="请输入医生工号!">
						<input nz-input (keydown.enter)="onEnterPress()" (ngModelChange)="numberChange($event,1)" formControlName="jobNumber" placeholder="请输入医生工号" nzSize="default" />
					</nz-form-control>
				</nz-form-item>
				<nz-form-item>
				  <nz-form-label nzRequired [nzSpan]="6" nzFor="name">医生姓名</nz-form-label>
					<nz-form-control [nzSpan]="18" nzErrorTip="请输入医生姓名!">
						<input nz-input disabled formControlName="name" placeholder="请输入医生姓名" nzSize="default" />
					</nz-form-control>
				</nz-form-item>
<!-- 				<nz-form-item>
				  <nz-form-label nzRequired [nzSpan]="6" nzFor="nurseJobNumber">护士工号</nz-form-label>
					<nz-form-control [nzSpan]="18" nzErrorTip="请输入护士工号!">
						<input nz-input (ngModelChange)="numberChange($event,2)" formControlName="nurseJobNumber" placeholder="请输入护士工号" nzSize="default" />
					</nz-form-control>
				</nz-form-item>
				<nz-form-item>
				  <nz-form-label nzRequired [nzSpan]="6" nzFor="nurseName">护士姓名</nz-form-label>
					<nz-form-control [nzSpan]="18" nzErrorTip="请输入护士姓名!">
						<input nz-input disabled formControlName="nurseName" placeholder="请输入护士姓名" nzSize="default" />
					</nz-form-control>
				</nz-form-item> -->
				<nz-form-item *ngIf="!ifFixType">
				  <nz-form-label nzRequired [nzSpan]="6" nzFor="fixative">固定液类型</nz-form-label>
				  <nz-form-control [nzSpan]="18" nzErrorTip="请选择固定液类型!">
				    <nz-input-group>
							<nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzPlaceHolder="请选择固定液类型" formControlName="fixative">
							  <ng-container *ngFor="let option of fixativeData">
							    <nz-option [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
							  </ng-container>
							</nz-select>
						</nz-input-group>
				  </nz-form-control>
				</nz-form-item>
			</form>
		</div>
		<div class="display_flex justify-content_flex-center bottom-btn">
			<button class="btn btn-right" nz-button nzType="primary" (click)="submitVerificationForm()" [nzLoading]="btnInfoLoading">确定</button>
			<button class="btn cancel" nz-button nzType="default" (click)="hideVerificationModal()">取消</button>
		</div>
	</div>
</div>

<!-- 标本查看详情-->
<div class="pathology-box display_flex align-items_center justify-content_flex-center" *ngIf="detailMoadl">
	<div class="pathology-content">
		<div class="title">查看详情
		<i class="icon_transport transport-guanbi" (click)="closeDetailMoadl()"></i></div>
		<div class="content">
			<div class="content-item boder-right">
				<nz-form-item class="form-title-box">
					<div class="form-title">申请单类型：{{detailsData.pathologyFormType==1?'术中快速病理检查申请单' : detailsData.pathologyFormType==2 ? '病理细胞学申请单' : '病理检查申请单'}}</div>
					<div class="form-title"><span class="font-weight-500">状态：</span>{{detailsData.status?detailsData.status.name:'-'}}</div>
				</nz-form-item>
				<nz-form-item class="form-title-box">
					<div class="form-title"><span class="font-weight-500">申请单号：</span>{{detailsData.applyCode}}</div>
					<div class="form-title over-class"><span class="font-weight-500">申请科室：</span>{{detailsData.patientDTO.department.dept}}</div>
				</nz-form-item>
				<nz-form-item class="form-title-box">
					<div class="form-title">手术间：{{detailsData.surgeryDeptDTO.dept}}</div>
					<div class="form-title">取材医生：{{detailsData.surgeryDoctorDTO?detailsData.surgeryDoctorDTO.name : '-'}}</div>
				</nz-form-item>
				<nz-form-item class="form-title-box">
					<div class="form-title"><span class="font-weight-500">患者信息：</span>{{detailsData.patientDTO.patientName}} ({{detailsData.patientDTO.bedNum}}床)</div>
					<div class="form-title"><span class="font-weight-500">年龄：</span>{{detailsData.patientDTO.age||'-'}}</div>
					<div class="form-title"><span class="font-weight-500">性别：</span>{{detailsData.patientDTO.gender?detailsData.patientDTO.gender.name:'-'}}</div>
					<div class="form-title"><span class="font-weight-500">住院号：</span>{{detailsData.patientDTO.patientCode}}</div>
				</nz-form-item>
				
				<div class="form-title-box">
					<div class="form-title"><span class="font-weight-500">检验项目：</span>{{project||'无'}}</div>
				</div>
				
				<div class="form-list">
					<div class="form-title font-weight-500">诊断：</div>
					<div class="indent">
						{{detailsData.diagnose||'无'}}
					</div>
				</div>
				
				<div class="form-list">
					<div class="form-title font-weight-500">病历摘要：</div>
					<div class="indent">{{detailsData.medicalRecords||'无'}}</div>
				</div>
				<div class="form-list">
					<div class="form-title font-weight-500">手术方案：</div>
					<div class="indent">{{detailsData.surgicalPlan||'无'}}</div>
				</div>
				<div class="form-list">
					<div class="form-title font-weight-500">术中所见：</div>
					<div class="indent">{{detailsData.intraoperativeFindings||'无'}}</div>
				</div>

				<div class="form-title-box">
					<div class="form-title"><span class="font-weight-500">标本类型：</span>{{detailsData.specimenType.name||'无'}}</div>
					<div class="form-title"><span class="font-weight-500">标本数量：</span>{{detailsData.specimenNum||'无'}}</div>
				</div>
				
				<div class="form-title-box">
					<div class="form-title"><span class="font-weight-500">部位：</span>{{detailsData.takePart||'无'}}</div>
					<!-- <div class="form-title"><span class="font-weight-500">离体时间：</span>{{detailsData.inVitroTime?(detailsData.inVitroTime|date:'yyyy-MM-dd HH:mm:ss'):'无'}}</div> -->
					<!-- <div class="form-title"><span class="font-weight-500">固定时间：</span>{{detailsData.fixationTime?(detailsData.fixationTime|date:'yyyy-MM-dd HH:mm:ss'):'无'}}</div> -->
				</div>
				
				<div class="form-list">
					<div class="form-title font-weight-500">标本：</div>
					<div class="form-title specimen-list">
						<div *ngFor="let item of specimenList" class="specimen-item-class" (click)="specimenView(item)">
							<span *ngIf="item.partSource && item.partSource.value!=1">{{item.partSource?item.partSource.name:''}}</span>{{item.specimenName}}({{item.specimenCode}})
						</div>
					</div>
				</div>

			</div>
			
			<div class="content-item-right">
				<div class="step-title">病理闭环</div>
				<nz-steps [nzCurrent]="stepLength" nzDirection="vertical" nzSize="small">
					<ng-container *ngFor="let item of pathologyLogs; let index = index">
							<nz-step
								[nzDescription]="tpl"
							>
							</nz-step>
							<ng-template #tpl>
								<div *ngIf="index==pathologyLogs.length-1" class="step-size">
									<div style="color: #49B856;" *ngIf="item.doctorDTO"> {{item.operationType?item.operationType.name:''}} {{item.doctorDTO?item.doctorDTO.name:''}} {{item.nurseDTO?item.nurseDTO.name:''}} </div>
									<div style="color: #49B856;" *ngIf="!item.doctorDTO">{{item.operationType?item.operationType.name:''}}  {{item.handoverUserDto?item.handoverUserDto.name:''}}</div>
									<div style="color:#333;">{{item.createTime|date:'yyyy-MM-dd HH:mm:ss'}} {{item.operationUserDto?item.operationUserDto.name:''}}</div>
								</div>
								<div *ngIf="index!=pathologyLogs.length-1" class="step-size">
									<div *ngIf="item.doctorDTO">{{item.operationType?item.operationType.name:''}}  {{item.doctorDTO?item.doctorDTO.name:''}} {{item.nurseDTO?item.nurseDTO.name:''}}</div>
									<div *ngIf="!item.doctorDTO">{{item.operationType?item.operationType.name:''}}  {{item.handoverUserDto?item.handoverUserDto.name:''}}</div>
									<div>{{item.createTime|date:'yyyy-MM-dd HH:mm:ss'}} {{item.operationUserDto?item.operationUserDto.name:''}}</div>
								</div>
							</ng-template>
						</ng-container>
				</nz-steps>
			</div>
		</div>
		<div class="display_flex justify-content_flex-center bottom-btn">
			<button class="btn btn-right" nz-button nzType="primary" (click)="closeDetailMoadl()">知道了</button>
			<!-- <button class="btn cancel" nz-button nzType="default" (click)="closeDetailMoadl()">取消</button> -->
		</div>
	</div>
</div>

<!-- 查看标本 -->
<div class="look">
	<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="specimenViewDialog">
		<div class="modalBody modalBody-ga">
			<div class="title">查看标本<i class="icon_transport transport-guanbi" (click)="closeSpecimenModal()"></i>
			</div>
			<overlay-scrollbars #osComponentRef1 class="content">
				<div class="list-template__bottom">
					<nz-table class="list-template__nzTable" [nzData]="viewData" nzSize="middle" [nzShowPagination]="false"
					  [nzLoading]="loading1">
					  <thead>
					    <tr class="thead">
								<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 viewData">
								<td>{{ data.specimenName }}</td>
								<td>{{ data.system ? data.system.name : '-' }}</td>
								<td>{{ data.organ ? data.organ.name : '-' }}</td>
					      <td>{{ data.specimenCode }}</td>
					      <td>{{ data.remark ? data.remark : '无' }}</td>
								<td>{{ data.inVitroTime ? (data.inVitroTime|date:'yyyy-MM-dd HH:mm:ss') : '-' }}</td>
								<td>{{ data.inVitroOperator ? data.inVitroOperator.name : '-' }}</td>
								<td>{{ data.fixationTime ? (data.fixationTime|date:'yyyy-MM-dd HH:mm:ss') : '-' }}</td>
								<td>{{ data.fixationOperator ? data.fixationOperator.name : '-' }}</td>
					    </tr>
					  </tbody>
					</nz-table>
				</div>
			</overlay-scrollbars>
			<div class="display_flex justify-content_flex-center">
				<button class="btn" nz-button nzType="primary" (click)="closeSpecimenModal()">知道了</button>
			</div>
		</div>
	</div>
</div>

<div class="mask-style" *ngIf="isSpinning">
	<nz-spin nzSimple class="spin-style"></nz-spin>
</div>