<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">
          <nz-form-label class="label" nzRequired>交接方式</nz-form-label>
          <nz-select class="w320px" nzPlaceHolder="请选择交接方式" [(ngModel)]="handoverMode">
            <nz-option *ngFor="let handoverMode of handoverModes" [nzLabel]="handoverMode.name" [nzValue]="handoverMode.id"></nz-option>
          </nz-select>
        </div>
        <!-- 核对方式 -->
        <div class="display_flex align-items_center mb8">
          <nz-form-label class="label" nzRequired>核对方式</nz-form-label>
          <!-- <nz-checkbox-group class="w320px" [(ngModel)]="checkModes"></nz-checkbox-group> -->
          <nz-radio-group [(ngModel)]="radioCheckModesValue">
            <label style="display: block;" nz-radio [nzValue]="item.value" *ngFor="let item of checkModes">{{ item.label }}</label>
          </nz-radio-group>
        </div>
        <!-- 签到方式 -->
        <div class="display_flex align-items_center mb8">
          <nz-form-label class="label">签到方式</nz-form-label>
          <nz-checkbox-group class="w320px" [(ngModel)]="checkInModes"></nz-checkbox-group>
        </div>
        <!-- 自动关单 -->
        <div class="display_flex align-items_center mb8">
          <nz-form-label class="label">自动关单</nz-form-label>
          <nz-checkbox-group class="w320px" [(ngModel)]="automaticCustomsOrders"></nz-checkbox-group>
        </div>
        <!-- 是否支持按钮送达交接 -->
        <div class="display_flex align-items_center mb8">
          <nz-form-label class="label">是否支持按钮送达交接</nz-form-label>
          <nz-checkbox-group class="w320px" [(ngModel)]="delivery"></nz-checkbox-group>
        </div>
        <!-- 是否支持领取证 -->
        <div class="display_flex align-items_center mb8">
          <nz-form-label class="label">是否支持领取证</nz-form-label>
          <nz-checkbox-group [(ngModel)]="certificates" (ngModelChange)="changeCertificates($event)"></nz-checkbox-group>
          <nz-select class="w320px" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzAllowClear nzPlaceHolder="请选择领取证号类型" [(ngModel)]="certificate" *ngIf="certificates[0].checked">
            <ng-container *ngFor="let data of certificateList">
              <nz-option *ngIf="!dLoading" [nzLabel]="data.name" [nzValue]="data.id"></nz-option>
            </ng-container>
            <nz-option *ngIf="dLoading" 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)]="cancelBloods" (ngModelChange)="changeCancelBloods($event)"></nz-checkbox-group>
          <nz-checkbox-group [(ngModel)]="cancelBloodHandovers" *ngIf="cancelBloods[0].checked"></nz-checkbox-group>
        </div>
				<!-- 待送达合并工单 -->
				<div class="display_flex align-items_center mb8">
				  <nz-form-label class="label">待送达合并工单</nz-form-label>
				  <nz-checkbox-group class="w320px" [(ngModel)]="sendingMergeOrder"></nz-checkbox-group>
				</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-checkbox-group [(ngModel)]="autoDepts" *ngIf="autoCreateOrders[0].checked"></nz-checkbox-group>
        </div>
        <div class="display_flex align-items_center mb8" *ngIf="autoCreateOrders[0].checked">
          <nz-form-label class="label" style="visibility: hidden;">自动建单</nz-form-label><!-- 暂时占位 -->
          <nz-checkbox-group [(ngModel)]="autoCreateOrders" (ngModelChange)="changeAutoCreateOrders($event)" style="visibility: hidden;"></nz-checkbox-group><!-- 暂时占位 -->
          <nz-checkbox-group [(ngModel)]="autoDeptLimits" (ngModelChange)="changeAutoDeptLimits($event)"></nz-checkbox-group>
          <nz-select class="w320px" [nzMode]="'multiple'" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzAllowClear nzPlaceHolder="请选择起点科室" nzServerSearch
            (nzOnSearch)="searchDeptList($event)" (nzOpenChange)="getDeptList($event)" [(ngModel)]="limitDeptIds" *ngIf="autoDeptLimits[0].checked">
            <ng-container *ngFor="let data of deptList">
              <nz-option *ngIf="!dLoading" nzLabel="{{data.dept}}" nzValue="{{data.id}}"></nz-option>
            </ng-container>
            <nz-option *ngIf="dLoading" 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)]="autoSendUsers"></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>
