<!-- 标本接收 -->
<div class="pathology-box display_flex align-items_center justify-content_flex-center" *ngIf="fixationModal">
	<div class="pathology-content">
		<div class="title">
		<!-- <i class="icon_transport transport-guanbi" (click)="hideSpecimenModal()"></i></div> -->
		<div class="content">
			<div class="content-item">
				<!-- <div class="center">提示：申请单含<span class="red">{{codeData.specimenNum}}</span>只标本，已扫<span class="red">{{codeData.pathologySpecimenDTOList.length}}</span>只<span *ngIf="codeData.pathologySpecimenDTOList.length < codeData.specimenNum">，请继续扫描标本。</span></div> -->
				<div class="disp-fl">
					<div class="disp-title">
						<div *ngIf="dataType=='receive'" class="title-weight">标本接收</div>
						<div *ngIf="dataType=='pack'" class="title-weight">标本打包</div>
						<div *ngIf="dataType?dataType=='receive' : businessType == 'connect'">
							接收申请单数: <span class="weight">{{otherData.pathologyFormNum}}</span>  &nbsp;
							接收标本数: <span class="weight">{{otherData.specimenNum}}</span>  
						</div>
						<div *ngIf="dataType?dataType=='pack' : businessType == 'packaging'">
							打包申请单数: <span class="weight">{{otherData.pathologyFormNum}}</span>  &nbsp;
							打包标本数: <span class="weight">{{otherData.specimenNum}}</span>  
						</div>
					</div>
					
					<div *ngIf="dataType!='pathologyPack' && businessType!='packagLook'">
						<input nz-input id="specimen" [placeholder]="placeholder" [(ngModel)]="specimenCode" (ngModelChange)="codeChange($event)"/>
					</div>
					<div class="error-class">{{errorMsg}}</div>
				</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]="codeData" nzSize="middle" [nzShowPagination]="false"
								[nzLoading]="tableLoading">
								<thead>
									<tr class="thead">
										<th>申请单号 | 申请科室</th>
										<th>患者姓名 | 住院号</th>
										<th>标本数</th>
										<th>部位</th>
										<th>标本名称</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let data of codeData let index = index">
										<td>
											<div>{{ data.applyCode}}</div>
											<div>{{ data.patientDTO.department.dept}}</div>
										</td>
										<td>
											<div>{{ data.patientDTO.patientName}}</div>
											<div>{{ data.patientDTO.residenceNo}}</div>
										</td>
										<td>{{ data.specimenNum}}</td>
										<td>{{ data.takePart}}</td>
										<td>
											<div *ngFor="let item of data.pathologySpecimenDTOList">
												<span *ngIf="item.partSource && item.partSource.value!=1">{{item.partSource?item.partSource.name:''}}</span>{{item.specimenName}}
											</div>
										</td>
									</tr>
								</tbody>
							</nz-table>
							<div class="list-template__pagination">
							  <nz-pagination [(nzPageIndex)]="pageReceptionIndex" [(nzTotal)]="listReceptionLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
							    (nzPageIndexChange)="pageChange()" (nzPageSizeChange)="pageChange()">
							  </nz-pagination>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="display_flex justify-content_flex-center bottom-btn">
			<button class="btn btn-right" *ngIf="dataType?dataType=='receive' : businessType == 'connect'" [disabled]="codeData.length==0" nz-button nzType="primary" (click)="submitFixationForm()" [nzLoading]="btnLoading">交接完成</button>
			<button class="btn btn-right" *ngIf="dataType?dataType=='pack' : businessType == 'packaging'" [disabled]="codeData.length==0" nz-button nzType="primary" (click)="submitScanForm()" [nzLoading]="btnLoading">扫描完成</button>
			<button class="btn btn-right" *ngIf="dataType=='pathologyPack'" nz-button nzType="primary" [disabled]="codeData.length==0" (click)="connectAccomplish()" [nzLoading]="btnMultiLoading">交接完成</button>
			<button class="btn cancel" *ngIf="dataType=='pathologyPack'" nz-button nzType="default" (click)="hideSpecimenModal()">取消</button>
			<button class="btn cancel" *ngIf="dataType?dataType=='pack' : businessType == 'packaging'" nz-button nzType="default" (click)="hideSpecimenModal()">取消</button>
			<button class="btn btn-right" *ngIf="businessType=='packagLook'" nz-button nzType="primary" (click)="hideSpecimenModal()">知道了</button>
		</div>
	</div>
</div>
</div>

<!-- 多支标本提示 -->
<div class="multi add display_flex align-items_center justify-content_flex-center" *ngIf="multiModal">
	<div class="pathology-content">
		<div class="title">多支标本提示
		<i class="icon_transport transport-guanbi" (click)="hideMultiModal()"></i></div>
		<div class="content border">
			<div class="content-item">
				<div class="center">提示：{{scanCodeData.patientName}}的申请单含<span>{{codeMultiData.length}}</span>支标本，您已扫描<span>{{muArr.length}}</span>支</div>
				<div class="disp-fl df-center">
					<div>
						<input nz-input id="multiSpecimen" placeholder="可扫描物理标本条码及包码" [(ngModel)]="specimenMultiCode" (ngModelChange)="codeMultiChange($event)"/>
					</div>
					<div class="error-class">{{errorMultiMsg}}</div>
				</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]="codeMultiData" nzSize="middle" [nzShowPagination]="false"
								[nzLoading]="tableLoading">
								<thead>
									<tr class="thead">
										<th>序号</th>
										<th>条码号</th>
										<th>标本名称</th>
										<th *ngIf="dataType=='receive'">已接收 | 未接收</th>
										<th *ngIf="dataType=='pack'">已扫描 | 未扫描</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let data of codeMultiData 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>
										<td *ngIf="dataType=='receive'">
											<div *ngIf="data.isScan==1">已接收</div>
											<div *ngIf="data.isScan==0" class="red">未接收</div>
										</td>
										<td *ngIf="dataType=='pack'">
											<div *ngIf="data.isScan==1">已扫描</div>
											<div *ngIf="data.isScan==0" class="red">未扫描</div>
										</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" *ngIf="dataType=='receive'" nz-button nzType="primary" (click)="submitMultiForm()" [nzLoading]="btnMultiLoading">确认接收</button>
			<button class="btn btn-right" *ngIf="dataType=='pack'" nz-button nzType="primary" (click)="submitMultiScanForm()" [nzLoading]="btnMultiLoading">扫描完成</button>
			<button class="btn cancel" nz-button nzType="default" (click)="hideMultiModal()">取消</button>
		</div>
	</div>
</div>



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

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

<!-- 人员交接 -->
<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="connectModal">
	<div class="modalBody">
		<div class="title">人员交接<i class="icon_transport transport-guanbi" (click)="hideConnectModal()"></i>
		</div>
		<div class="content">
		 <div class="title-class">
			 <div>配送人应送达：单据{{mustReceived.pathologyFormNum}}张、
			 标本{{mustReceived.specimenNum}}、速冻标本{{mustReceived.rapidityNum}}</div>
			 <div>本次共接收单据
			 <span [ngClass]="{'red': currReceived.pathologyFormNum < mustReceived.pathologyFormNum}">
				 {{currReceived.pathologyFormNum}}
			 </span>张、
			 标本<span [ngClass]="{'red': currReceived.specimenNum<mustReceived.specimenNum}">{{currReceived.specimenNum}}</span>、速冻标本
			 <span [ngClass]="{'red': currReceived.rapidityNum<mustReceived.rapidityNum}">{{currReceived.rapidityNum}}</span>
			 </div>
			</div>
		 <form nz-form [formGroup]="validateConnectForm" class="addForm" (ngSubmit)="submitConnectForm()">
			<nz-form-item>
				<nz-form-label nzRequired nzFor="receptionNumber">接收人工号</nz-form-label>
				<nz-form-control nzErrorTip="请输入接收人工号!">
					<input nz-input (ngModelChange)="receptionChange($event)" formControlName="receptionNumber" placeholder="请输入接收人工号" nzSize="default" />
				</nz-form-control>
			</nz-form-item>
			<nz-form-item class="form-name">
				<nz-form-label style="margin-left: 12px;">接收人姓名</nz-form-label>
				<!-- <nz-form-control nzErrorTip="请输入接收人工号!"> -->
					<div class="job-class">{{receptionName}}</div>
				<!-- </nz-form-control> -->
			</nz-form-item>
			<nz-form-item>
				<nz-form-label nzRequired nzFor="dispatchingNumber">配送人工号</nz-form-label>
				<nz-form-control nzErrorTip="请输入配送人工号!">
					<input nz-input (ngModelChange)="dispatchingChange($event)" formControlName="dispatchingNumber" placeholder="请输入配送人工号" nzSize="default" />
				</nz-form-control>
			</nz-form-item>
			<nz-form-item class="form-name">
				<nz-form-label style="margin-left: 12px;">配送人姓名</nz-form-label>
				<!-- <nz-form-control nzErrorTip="请输入配送人工号!"> -->
					<div class="job-class">{{dispatchingName}}</div>
				<!-- </nz-form-control> -->
			</nz-form-item>
		 </form>
		</div>
		<div class="display_flex justify-content_flex-center">
			<button class="btn" nz-button nzType="primary" (click)="submitConnectForm()" [nzLoading]="btnConnectLoading">确定</button>
			<button class="btn cancel" nz-button nzType="default" (click)="hideConnectModal()">取消</button>
		</div>
	</div>
</div>

<!-- 配送接收 -->
<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="receptionModal">
	<div class="modalBody">
		<div class="title">配送接收<i class="icon_transport transport-guanbi" (click)="hideReceptionModal()"></i>
		</div>
		<div class="content">
		 <div class="title-class">
			 包内含申请单{{otherData.pathologyFormNum}}张、标本{{otherData.specimenNum}}，请确认接收。
			</div>
		 <form nz-form [formGroup]="validateConnectForm" class="addForm" (ngSubmit)="submitReceptionForm()">
			<nz-form-item>
				<nz-form-label nzRequired nzFor="receptionNumber">接收人工号</nz-form-label>
				<nz-form-control nzErrorTip="请输入接收人工号!">
					<input nz-input (ngModelChange)="receptionChange($event)" formControlName="receptionNumber" placeholder="请输入接收人工号" nzSize="default" />
				</nz-form-control>
			</nz-form-item>
			<nz-form-item class="form-name">
				<nz-form-label style="margin-left: 12px;">接收人姓名</nz-form-label>
				<!-- <nz-form-control nzErrorTip="请输入接收人工号!"> -->
					<div class="job-class">{{receptionName}}</div>
				<!-- </nz-form-control> -->
			</nz-form-item>
			<nz-form-item>
				<nz-form-label nzRequired nzFor="dispatchingNumber">配送人工号</nz-form-label>
				<nz-form-control nzErrorTip="请输入配送人工号!">
					<input nz-input (ngModelChange)="dispatchingChange($event)" formControlName="dispatchingNumber" placeholder="请输入配送人工号" nzSize="default" />
				</nz-form-control>
			</nz-form-item>
			<nz-form-item class="form-name">
				<nz-form-label style="margin-left: 12px;">配送人姓名</nz-form-label>
				<!-- <nz-form-control nzErrorTip="请输入配送人工号!"> -->
					<div class="job-class">{{dispatchingName}}</div>
				<!-- </nz-form-control> -->
			</nz-form-item>
		 </form>
		</div>
		<div class="display_flex justify-content_flex-center">
			<button class="btn" nz-button nzType="primary" (click)="submitReceptionForm()" [nzLoading]="btnConnectLoading">确定接收</button>
			<button class="btn cancel" nz-button nzType="default" (click)="hideReceptionModal()">取消</button>
		</div>
	</div>
</div>

<!-- 打包并打印 -->
<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="packModal">
	<div class="modalBody">
		<div class="title">打包并打印<i class="icon_transport transport-guanbi" (click)="hidePackModal()"></i>
		</div>
		<div class="content-modal">
			 本次共扫描单据{{otherData.pathologyFormNum}}张、标本{{otherData.specimenNum}}，是否打包并打印？
		</div>
		<div class="display_flex justify-content_flex-center">
			<button class="btn" nz-button nzType="primary" (click)="submitPackForm()" [nzLoading]="btnPackLoading">打包并打印</button>
			<button class="btn cancel" nz-button nzType="default" (click)="hidePackModal()">取消</button>
		</div>
	</div>
</div>

<!-- 打印 -->
<div id="report" style="display: none;">
	<div class="monad">
		<div style="font-size: 10px;padding: 2px;">
			<!-- <div> -->
				<div style="display: flex;align-items: center;justify-content: center;">
					<img style="width: 100%;height: 60px;" [src]="printData.qrCode" alt="">
				</div>
				<div style="padding: 1px;">
					<div style="display: flex;flex-wrap: nowrap;margin-bottom:3px;">包码:{{printData.packCode}}</div>
					<div style="display: flex;">打包时间:{{printData.packTime|date:'yyyy-MM-dd HH:mm:ss'}}</div>
					<!-- <div style="display: flex;">打包人:{{printData.packUserDTO?printData.packUserDTO.name:'-'}}</div> -->
					<!-- <div style="display: flex;margin-bottom:6px;">申请单数:{{printData.pathologyFormNum}}</div> -->
					<!-- <div style="display: flex;margin-bottom:6px;">标本数:{{printData.specimenNum}}</div> -->
				</div>
			<!-- </div> -->
			<!-- <div style="display: flex;">打包时间:{{printData.packTime|date:'yyyy-MM-dd HH:mm:ss'}}</div> -->
		</div>
	</div>
</div>