<div class="TaskTypeManagement">
  <div class="taskTypeInfo">
    <div class="top">
      <div class="item" (click)="tabModal('characteristics')" [ngClass]="{'items':tabModalName=='characteristics'}">
        特性配置
      </div>
      <div class="item" (click)="tabModal('automaticOrderCreation')" [ngClass]="{'items':tabModalName=='automaticOrderCreation'}">
        自动建单配置
      </div>
    </div>
    <div class="list" *ngIf="!loading">
      <!-- 特性配置 -->
      <div *ngIf="tabModalName=='characteristics'">
        <!-- 接手术关联任务类型 -->
        <div class="display_flex align-items_center mb8">
          <nz-form-label class="label" nzRequired>接手术关联任务类型</nz-form-label>
          <nz-select class="w320px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
            (nzOnSearch)="changeTasktype($event, 1)" nzPlaceHolder="请选择接手术关联任务类型" [(ngModel)]="tasktypeId">
            <ng-container *ngFor="let option of taskTypes1">
              <nz-option *ngIf="!isLoading" [nzLabel]="option.taskName" [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>
        </div>
        <!-- 苏醒室科室 -->
        <div class="display_flex align-items_center mb8">
          <nz-form-label class="label" nzRequired>苏醒室科室</nz-form-label>
          <nz-select class="w320px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
            (nzOnSearch)="changeRecoveryDepts($event)" nzPlaceHolder="请选择接苏醒室科室" [(ngModel)]="recoveryDeptId">
            <ng-container *ngFor="let option of recoveryDepts">
              <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>
        </div>
        <!-- 送回病房科室 -->
        <div class="display_flex align-items_center mb8">
          <nz-form-label class="label">是否开通送回病房</nz-form-label>
          <nz-checkbox-group [(ngModel)]="autoSendWard" (ngModelChange)="changeAutoSendWard($event)"></nz-checkbox-group>
          <nz-select *ngIf="autoSendWard[0].checked" class="w320px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
            (nzOnSearch)="changeTasktype($event, 1)" nzPlaceHolder="请选择送回病房任务类型" [(ngModel)]="tasktype1Id">
            <ng-container *ngFor="let option of taskTypes1">
              <nz-option *ngIf="!isLoading" [nzLabel]="option.taskName" [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>
        </div>
        <!-- 送回苏醒室科室 -->
        <div class="display_flex align-items_center mb8">
          <nz-form-label class="label">是否开通送回苏醒室</nz-form-label>
          <nz-checkbox-group [(ngModel)]="autoSendAwakeningRoom" (ngModelChange)="changeAutoSendAwakeningRoom($event)"></nz-checkbox-group>
          <nz-select *ngIf="autoSendAwakeningRoom[0].checked" class="w320px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
            (nzOnSearch)="changeTasktype($event, 1)" nzPlaceHolder="请选择送回苏醒室任务类型" [(ngModel)]="tasktype2Id">
            <ng-container *ngFor="let option of taskTypes1">
              <nz-option *ngIf="!isLoading" [nzLabel]="option.taskName" [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>
        </div>
        <!-- 关联手术清洁 -->
        <div class="display_flex align-items_center mb8">
          <nz-form-label class="label">是否开通关联手术清洁建单</nz-form-label>
          <nz-checkbox-group [(ngModel)]="autoRemandClean" (ngModelChange)="changeAutoRemandClean($event)"></nz-checkbox-group>
          <nz-select *ngIf="autoRemandClean[0].checked" class="w320px" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
            (nzOnSearch)="changeTasktype($event, 2)" nzPlaceHolder="请选择送回苏醒室任务类型" [(ngModel)]="cleanTypeId">
            <ng-container *ngFor="let option of taskTypes2">
              <nz-option *ngIf="!isLoading" [nzLabel]="option.taskName" [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>
        </div>
        <!-- 是否开启手术即将开始通知 -->
        <div class="display_flex align-items_center mb8">
          <nz-form-label class="label">是否开启手术即将开始通知</nz-form-label>
          <nz-checkbox-group [(ngModel)]="surgeryBegin"></nz-checkbox-group>
        </div>
				<!-- 是否开启病理申请单 -->
				<div class="display_flex align-items_center mb8">
				  <nz-form-label class="label">是否开启病理申请单</nz-form-label>
				  <nz-checkbox-group [(ngModel)]="isPathologyForm"></nz-checkbox-group>
				</div>
				<!-- 是否根据首台标识 -->
				<div class="display_flex align-items_center mb8">
				  <nz-form-label class="label">是否根据首台标识</nz-form-label>
				  <nz-checkbox-group [(ngModel)]="firstOperation"></nz-checkbox-group>
				</div>
				<!-- 限定时间 -->
				<div class="display_flex align-items_center mb8">
				  <nz-form-label class="label">限定时间</nz-form-label>
					<nz-time-picker [(ngModel)]="firstOperationLimitTime" nzFormat="HH:mm" nzPlaceHolder="限定时间"></nz-time-picker>
				</div>
      </div>
      <!-- 自动建单配置 -->
      <div *ngIf="tabModalName=='automaticOrderCreation'">
        <!-- 自动建单 -->
        <div class="display_flex align-items_center mb8">
          <nz-form-label class="label">自动建单</nz-form-label>
          <nz-checkbox-group [(ngModel)]="autoCreateOrders" (ngModelChange)="changeAutoCreateOrders($event)"></nz-checkbox-group>
          <nz-time-picker [(ngModel)]="autoTime" nzFormat="HH:mm" *ngIf="autoCreateOrders[0].checked"></nz-time-picker>
        </div>
				<!-- 是否开启速冻标本自动建单 -->
				<div class="display_flex align-items_center mb8">
				  <nz-form-label class="label">是否开启速冻标本自动建单</nz-form-label>
				  <nz-checkbox-group [(ngModel)]="isFrozenSpecimen"></nz-checkbox-group>
				</div>
      </div>
      <div class="bottom">
        <button class="login-form-button" nzType="primary" [nzLoading]="btnLoading" nz-button (click)="submitForm()">保存</button>
      </div>
    </div>
    <div class="list" *ngIf="loading">
      <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>
</div>
