<div class="list-template">
  <div class="list-template__content">
    <div class="list-template__top" nz-row>
      <div nz-col nzXl='16' class="list-template__searchBox">
				<div class="list-template__searchItem">
				  <span class="label">申请科室：</span>
				  <nz-select
				    [nzDropdownMatchSelectWidth]="false"
				    class="formItem"
				    nzServerSearch
				    nzShowSearch
				    nzAllowClear
				    nzPlaceHolder="请选择申请科室"
				    [(ngModel)]="searchCriteria.applyDept"
				    (nzOnSearch)="changeInp($event)"
				    (nzOpenChange)="changeSearch($event)"
				  >
				    <ng-container *ngFor="let data of deptList">
				      <nz-option
				        *ngIf="!isLoading"
				        nzLabel="{{ data.dept }}"
				        nzValue="{{ data.id }}"
				      ></nz-option>
				    </ng-container>
				    <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
				      <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
				    </nz-option>
				  </nz-select>
				</div>
        <div class="list-template__searchItem">
          <span class="label">血袋号：</span>
          <input nz-input class="formItem" placeholder="请输入血袋号" [(ngModel)]="searchCriteria.bloodCode" />
        </div>
        <div class="list-template__searchItem">
          <span class="label">发血时间：</span>
          <nz-range-picker [(ngModel)]="searchCriteria.dateRange"></nz-range-picker>
        </div>
        <div class="list-template__searchItem">
          <span class="label">状态：</span>
          <nz-select
            [nzDropdownMatchSelectWidth]="false"
            class="formItem"
            nzServerSearch
            nzShowSearch
            nzAllowClear
            nzPlaceHolder="请选择状态"
            [(ngModel)]="searchCriteria.state"
            (nzOpenChange)="changeSearch1($event)"
          >
            <ng-container *ngFor="let data of types">
              <nz-option
                *ngIf="!isLoading1"
                nzLabel="{{ data.name }}"
                nzValue="{{ data.id }}"
              ></nz-option>
            </ng-container>
            <nz-option *ngIf="isLoading1" nzDisabled nzCustomContent>
              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
            </nz-option>
          </nz-select>
        </div>
				<div class="list-template__searchItem">
				  <span class="label">取血人：</span>
				  <nz-select
				    [nzDropdownMatchSelectWidth]="false"
				    class="formItem"
				    nzServerSearch
				    nzShowSearch
				    nzAllowClear
				    nzPlaceHolder="请选择取血人："
				    [(ngModel)]="searchCriteria.arriver"
				    (nzOnSearch)="changeInp2($event, 'search')"
				    (nzOpenChange)="changeSearch2($event)"
				  >
				    <ng-container *ngFor="let data of userSearch">
				      <nz-option
				        *ngIf="!isLoading"
				        nzLabel="{{ data.name }}"
				        nzValue="{{ data.id }}"
				      ></nz-option>
				    </ng-container>
				    <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
				      <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
				    </nz-option>
				  </nz-select>
				</div>
      </div>
      <div nz-col nzXl="8" class="list-template__btns">
        <button nz-button class="btn default" (click)='reset()'>重置</button>
        <button nz-button class="btn default ml8" (click)='getList(1)'>搜索</button>
				<button nz-button class="btn default ml8" (click)='addForm()'>新增</button>
				<button nz-button class="btn default ml8" (click)='batchSend()'>批量发送</button>
				<button nz-button class="btn default ml8" (click)='autoCreate()'>自动生成</button>
			</div>
    </div>
    <div class="list-template__bottom">
      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
        [nzLoading]="loading1">
        <thead>
          <tr class="thead">
						<th nzWidth="5%" nzShowCheckbox [(nzChecked)]="isAllDisplayDataChecked"
						  (nzCheckedChange)="checkAll($event)"></th>
            <!-- <th nzWidth="2%">#</th> -->
						<th nzWidth="8%">血袋标识</th>
						<th nzWidth="8%">血液信息</th>
						<th nzWidth="8%">患者信息</th>
						<th nzWidth="8%">发血号</th>
						<th nzWidth="8%">申请使用科室</th>
						<th nzWidth="8%">发血科室</th>
						<th nzWidth="8%">状态</th>
						<th nzWidth="8%">发血信息</th>
						<th nzWidth="8%">取血信息</th>
						<th nzWidth="8%">送达信息</th>
						<th nzWidth="8%">接收信息</th>
            <th nzWidth="8%">操作</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let data of listOfData;let i = index">
            <!-- <td>{{i+(pageIndex-1) * pageSize + 1}}</td> -->
						<td nzShowCheckbox [(nzChecked)]="mapOfCheckedId[data.id]" 
						(nzCheckedChange)="refreshStatus()" 
						[nzDisabled]="data.state.value==1 || data.state.value==2 || 
						data.state.value==4 || data.state.value=='cx'"
						></td>
            <td>
							<div>{{ data.bloodCode }}</div>
							<div>{{ data.productCode }}</div>
						</td>
						<td>
							<div>{{ data.type ? data.type.name : "无" }}、{{data.volume}}{{data.unit}}</div>
							<div>{{ data.aboType }}、{{ data.rhType }}</div>
						</td>
						<td>
							<div>{{ data.patientName }}<span *ngIf="data.bedNum">({{ data.bedNum }})</span></div>
							<div>{{ data.patientNo }}</div>
						</td>
						<td>{{ data.dataCode || '无'}}</td>
						<td>
							<div>{{ data.applyDeptDTO ? data.applyDeptDTO.dept :'无' }}</div>
							<div>{{ data.useDeptDTO ? data.useDeptDTO.dept :'无' }}</div>
						</td>
						<td>{{ data.sendDeptDTO ? data.sendDeptDTO.dept :'无'}}</td>
						<td>{{ data.state?.name}}</td>
						<td>
							<div>{{ data.printDate | date:"yyyy-MM-dd HH:mm:ss" }}</div>
							<div>{{ data.bleedUserDTO ? data.bleedUserDTO.name: '无'}}</div>
						</td>
						<td>
							<div>{{ data.arriveTime | date:"yyyy-MM-dd HH:mm:ss" }}</div>
							<div>{{ data.arriverDTO ? data.arriverDTO.name: '无' }}</div>
						</td>
						<td>
							<div>{{ data.deliveryTime | date:"yyyy-MM-dd HH:mm:ss" }}</div>
							<div>{{ data.deliveryUserDTO ? data.deliveryUserDTO.name: '无'}}</div>
						</td>
						<td>
							<div>{{ data.receiveTime | date:"yyyy-MM-dd HH:mm:ss" }}</div>
							<div>{{ data.receiverDTO ? data.receiverDTO.name: '无' }}</div>
						</td>
            <td><button (click)="viewBloodHistory(data)">查看日志</button></td>
          </tr>
        </tbody>
      </nz-table>
      <div class="list-template__pagination">
        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize"
          (nzPageIndexChange)="getList(0)" (nzPageSizeChange)="getList(0)">
        </nz-pagination>
      </div>
    </div>
  </div>
</div>
<!-- 血制品历史记录查看 -->
<app-blood-history-prompt-modal
  *ngIf="historyPromptModalShow"
  [show]="historyPromptModalShow"
  [bloodId]="bloodId"
  (closeModelHs)="closeModelHistory($event)"
></app-blood-history-prompt-modal>

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

<!-- 新增/编辑模态框 -->
<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="addModal">
  <div class="modalBody">
    <div class="title">{{add?"新增":view?"查看":"编辑"}}<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
    </div>
    <div class="content">
      <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
				<div class="df">
					<nz-form-item>
						<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="applyDept">申请科室</nz-form-label>
						<nz-form-control nzErrorTip="请选择申请科室!">
							<nz-input-group>
								<nz-select [nzDisabled]="view" class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
									(nzOnSearch)="changeInp($event)" (nzOpenChange)="changeSearch($event)" (ngModelChange)="onDeptChange($event)" nzAllowClear nzPlaceHolder="请选择申请科室" formControlName="applyDept">
									<ng-container *ngFor="let option of deptList">
										<nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
									</ng-container>
									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
										<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
									</nz-option>
								</nz-select>
							</nz-input-group>
						</nz-form-control>
					</nz-form-item>
					
					<nz-form-item>
						<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="sendDept">发血科室</nz-form-label>
						<nz-form-control nzErrorTip="请选择发血科室!">
							<nz-input-group>
								<nz-select [nzDisabled]="view" class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
									(nzOnSearch)="changeInp($event)" (nzOpenChange)="changeSearch($event)" nzAllowClear nzPlaceHolder="请选择发血科室" formControlName="sendDept">
									<ng-container *ngFor="let option of deptList">
										<nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
									</ng-container>
									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
										<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
									</nz-option>
								</nz-select>
							</nz-input-group>
						</nz-form-control>
					</nz-form-item>
					
					<nz-form-item>
						<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="useDept">使用科室</nz-form-label>
						<nz-form-control nzErrorTip="请选择使用科室!">
							<nz-input-group>
								<nz-select [nzDisabled]="view" class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
									(nzOnSearch)="changeInp($event)" (nzOpenChange)="changeSearch($event)" nzAllowClear nzPlaceHolder="请选择使用科室" formControlName="useDept">
									<ng-container *ngFor="let option of deptList">
										<nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
									</ng-container>
									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
										<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
									</nz-option>
								</nz-select>
							</nz-input-group>
						</nz-form-control>
					</nz-form-item>
				</div>
				
				<div class="df"> 
					<nz-form-item>
					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="type">血液类型</nz-form-label>
					  <nz-form-control nzErrorTip="请选择血液类型!">
					    <nz-input-group>
								<nz-select class="formItem" [nzDisabled]="view" [nzDropdownMatchSelectWidth]="false" nzShowSearch
								   nzAllowClear nzPlaceHolder="请选择血液类型" formControlName="type">
									<ng-container *ngFor="let option of bloodTypeList">
									  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
									</ng-container>
								</nz-select>
					    </nz-input-group>
					  </nz-form-control>
					</nz-form-item>
					
					<nz-form-item>
					  <nz-form-label [nzSm]="7" [nzXs]="24" nzRequired nzFor="volume">血量</nz-form-label>
					  <nz-form-control nzErrorTip="请选择血量!">
					    <nz-input-group>
								<input nz-input class="formItem" formControlName="volume" placeholder="请输入血量" nzSize="default" />
					    </nz-input-group>
					  </nz-form-control>
					</nz-form-item>
					
					<nz-form-item>
					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="unit">单位</nz-form-label>
					  <nz-form-control nzErrorTip="请选择单位!">
					    <nz-input-group>
								<nz-select class="formItem" [nzDisabled]="view" (ngModelChange)="onUnitChange($event)" [nzDropdownMatchSelectWidth]="false" nzShowSearch
								   nzAllowClear nzPlaceHolder="请选择单位" formControlName="unit">
									<ng-container *ngFor="let option of unitList">
									  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
									</ng-container>
								</nz-select>
					    </nz-input-group>
					  </nz-form-control>
					</nz-form-item>
				</div>
				
      	<div class="df">
					<nz-form-item>
					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="aboType">ABO血型</nz-form-label>
					  <nz-form-control nzErrorTip="请选择ABO血型!">
					    <nz-input-group>
								<nz-select class="formItem" [nzDisabled]="view" (ngModelChange)="onAboChange($event)" (ngModelChange)="onPatientChange($event)" [nzDropdownMatchSelectWidth]="false" nzShowSearch
								   nzAllowClear nzPlaceHolder="请选择ABO血型" formControlName="aboType">
									<ng-container *ngFor="let option of aboList">
									  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
									</ng-container>
								</nz-select>
					    </nz-input-group>
					  </nz-form-control>
					</nz-form-item>
					
					<nz-form-item>
					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="rhType">RH血型</nz-form-label>
					  <nz-form-control nzErrorTip="请选择RH血型!">
					    <nz-input-group>
								<nz-select class="formItem" [nzDisabled]="view" (ngModelChange)="onRhChange($event)" [nzDropdownMatchSelectWidth]="false" nzShowSearch
								   nzAllowClear nzPlaceHolder="请选择RH血型" formControlName="rhType">
									<ng-container *ngFor="let option of rhList">
									  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
									</ng-container>
								</nz-select>
					    </nz-input-group>
					  </nz-form-control>
					</nz-form-item>
					
						<nz-form-item>
						  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="patientId">患者</nz-form-label>
						  <nz-form-control nzErrorTip="请选择患者!">
						    <nz-input-group>
									<nz-select class="formItem" [nzDisabled]="view" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
									  (nzOnSearch)="changePatient($event, 1)" (ngModelChange)="onPatientChange($event)" nzAllowClear nzPlaceHolder="请选择患者" formControlName="patientId">
										<ng-container *ngFor="let option of patientList">
										  <nz-option *ngIf="!isLoading" [nzLabel]="option.patientName" [nzValue]="option.id"></nz-option>
										</ng-container>
										<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
										  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
										</nz-option>
									</nz-select>
						    </nz-input-group>
						  </nz-form-control>
						</nz-form-item>
				</div>
				
				<div class="df">
					<nz-form-item>
					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="bleedUser">发血人</nz-form-label>
					  <nz-form-control nzErrorTip="请选择发血人!">
					    <nz-input-group>
								<nz-select class="formItem" [nzDisabled]="view" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
								  (nzOnSearch)="changeUser($event)" nzAllowClear nzPlaceHolder="请选择发血人" formControlName="bleedUser">
									<ng-container *ngFor="let option of userList">
									  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
									</ng-container>
									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
									  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
									</nz-option>
								</nz-select>
					    </nz-input-group>
					  </nz-form-control>
					</nz-form-item>
					
					<nz-form-item>
					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="overDate">过期时间</nz-form-label>
					  <nz-form-control nzErrorTip="请选择过期时间!">
					    <nz-input-group>
					      <nz-date-picker
					    		nzShowTime
					    		nzFormat="yyyy-MM-dd HH:mm:ss"
					    		nzPlaceHolder="请选择过期时间"
					    		formControlName="overDate"
					    		(ngModelChange)="onStartChange($event)"
					    	></nz-date-picker>
					    </nz-input-group>
					  </nz-form-control>
					</nz-form-item>
					
					<nz-form-item>
					  <nz-form-label [nzSm]="7" [nzXs]="24" nzFor="state">默认状态</nz-form-label>
					  <nz-form-control nzErrorTip="请选择默认状态!">
					    <nz-input-group>
								<input nz-input disabled class="formItem" formControlName="state" placeholder="请输入默认状态" nzSize="default" />
					    </nz-input-group>
					  </nz-form-control>
					</nz-form-item>
				</div>
				<div class="df">
					<nz-form-item>
					  <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="sendMsg">是否同步发送消息</nz-form-label>
					  <nz-form-control nzErrorTip="请选择是否同步发送消息!">
					    <nz-input-group>
								<nz-radio-group [nzDisabled]="view" formControlName="sendMsg">
									<label nz-radio nzValue="1">是</label>
									<label nz-radio nzValue="0">否</label>
								</nz-radio-group>
					    </nz-input-group>
					  </nz-form-control>
					</nz-form-item>
				</div>
      </form>
    </div>
    <div class="display_flex justify-content_flex-center">
      <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">确认</button>
      <button class="btn cancel" nz-button nzType="default" (click)="hideModal()">取消</button>
    </div>
  </div>
</div>

<!-- 批量发送 -->
<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="batchModal">
  <div class="modalBody collect">
    <div class="title">{{infoContent}}<i class="icon_transport transport-guanbi" (click)="hideMsgModal()"></i>
    </div>
    <div class="content">
      <form nz-form [formGroup]="validateMsgForm" class="addForm" (ngSubmit)="submitMsgForm()">
					<nz-form-item>
					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="sendMsgType">消息发送类型</nz-form-label>
					  <nz-form-control nzErrorTip="请选择消息发送类型!">
					    <nz-input-group>
								<nz-radio-group [nzDisabled]="view" formControlName="sendMsgType" (ngModelChange)="msgTypeChange($event)">
									<label nz-radio nzValue="createMsg">建单消息</label>
									<label nz-radio nzValue="createAndSignMsg">建单并签到消息</label>
								</nz-radio-group>
					    </nz-input-group>
					  </nz-form-control>
					</nz-form-item>
					
					<nz-form-item *ngIf="validateMsgForm.value.sendMsgType=='createAndSignMsg'">
					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="arriver">取血人</nz-form-label>
					  <nz-form-control nzErrorTip="请选择取血人!">
					    <nz-input-group>
								<nz-select class="formItem" [nzDisabled]="view" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
									(nzOnSearch)="changeInp2($event, 'search')"
									(nzOpenChange)="changeSearch2($event)"
									nzAllowClear nzPlaceHolder="请选择取血人" formControlName="arriver">
									<ng-container *ngFor="let option of userSearch">
									  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
									</ng-container>
									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
									  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
									</nz-option>
								</nz-select>
					    </nz-input-group>
					  </nz-form-control>
					</nz-form-item>
				
      </form>
    </div>
    <div class="display_flex justify-content_flex-center">
      <button nzType="primary" nz-button (click)="submitMsgForm()" [nzLoading]="btnLoading">确认</button>
      <button class="btn cancel" nz-button nzType="default" (click)="hideMsgModal()">取消</button>
    </div>
  </div>
</div>

<!-- 自动生成模态框 -->
<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="autoCreateModal">
  <div class="modalBody collect">
    <div class="title">自动生成<i class="icon_transport transport-guanbi" (click)="hideAutoModal()"></i>
    </div>
    <div class="content">
      <form nz-form [formGroup]="validateAutoForm" class="addForm" (ngSubmit)="submitAutoForm()">
					<nz-form-item>
						<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="applyDept">申请科室</nz-form-label>
						<nz-form-control nzErrorTip="请选择申请科室!">
							<nz-input-group>
								<nz-select [nzDisabled]="view" class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
									(nzOnSearch)="changeInp($event, 'search')" (nzOpenChange)="changeSearch($event)" (ngModelChange)="onAutoDeptChange($event)" nzAllowClear nzPlaceHolder="请选择申请科室" formControlName="applyDept">
									<ng-container *ngFor="let option of deptList">
										<nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
									</ng-container>
									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
										<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
									</nz-option>
								</nz-select>
							</nz-input-group>
						</nz-form-control>
					</nz-form-item>
					
					<nz-form-item>
						<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="sendDept">发血科室</nz-form-label>
						<nz-form-control nzErrorTip="请选择发血科室!">
							<nz-input-group>
								<nz-select [nzDisabled]="view" class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
									(nzOnSearch)="changeInp($event, 'search')" (nzOpenChange)="changeSearch($event)" nzAllowClear nzPlaceHolder="请选择发血科室" formControlName="sendDept">
									<ng-container *ngFor="let option of deptList">
										<nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
									</ng-container>
									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
										<i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
									</nz-option>
								</nz-select>
							</nz-input-group>
						</nz-form-control>
					</nz-form-item>
					
					<nz-form-item>
					  <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="patientId">患者</nz-form-label>
					  <nz-form-control nzErrorTip="请选择患者!">
					    <nz-input-group>
								<nz-select class="formItem" [nzDisabled]="view" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
								  (nzOnSearch)="changePatient($event, 2)" (ngModelChange)="onPatientChange($event)" nzAllowClear nzPlaceHolder="请选择患者" formControlName="patientId">
									<ng-container *ngFor="let option of patientList">
									  <nz-option *ngIf="!isLoading" [nzLabel]="option.patientName" [nzValue]="option.id"></nz-option>
									</ng-container>
									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
									  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
									</nz-option>
								</nz-select>
					    </nz-input-group>
					  </nz-form-control>
					</nz-form-item>
					
					<nz-form-item>
					  <nz-form-label nzRequired [nzSm]="6" [nzXs]="24" nzFor="amount">生成数量</nz-form-label>
					  <nz-form-control nzErrorTip="请选择生成数量!">
					    <nz-input-group>
								<nz-input-number formControlName="amount" (ngModelChange)="numChange($event)" [nzMin]="1" [nzMax]="50" [nzStep]="1"></nz-input-number>
							</nz-input-group>
					  </nz-form-control>
					</nz-form-item>
					
					<nz-form-item>
					  <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="sendMsgType">消息类型</nz-form-label>
					  <nz-form-control nzErrorTip="请选择消息类型!">
					    <nz-input-group>
								<nz-radio-group [nzDisabled]="view" formControlName="sendMsgType" (ngModelChange)="autoMsgTypeChange($event)">
									<label nz-radio nzValue="noMsg">不发消息</label>
									<label nz-radio nzValue="createMsg">发送建单消息</label>
									<label nz-radio nzValue="createAndSignMsg">发送建单并签到消息</label>
								</nz-radio-group>
							</nz-input-group>
					  </nz-form-control>
					</nz-form-item>
					
					<nz-form-item *ngIf="validateAutoForm.value.sendMsgType=='createAndSignMsg'">
					  <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="arriver">取血人</nz-form-label>
					  <nz-form-control nzErrorTip="请选择取血人!">
					    <nz-input-group>
								<nz-select class="formItem" [nzDisabled]="view" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
									(nzOnSearch)="changeInp2($event, 'search')"
									(nzOpenChange)="changeSearch2($event)"
									nzAllowClear nzPlaceHolder="请选择取血人" formControlName="arriver">
									<ng-container *ngFor="let option of userSearch">
									  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
									</ng-container>
									<nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
									  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
									</nz-option>
								</nz-select>
					    </nz-input-group>
					  </nz-form-control>
					</nz-form-item>
      </form>
    </div>
    <div class="display_flex justify-content_flex-center">
      <button nzType="primary" nz-button (click)="submitAutoForm()" [nzLoading]="btnLoading">生成血制品</button>
      <button class="btn cancel" nz-button nzType="default" (click)="hideAutoModal()">取消</button>
    </div>
  </div>
</div>
