<div class="hospitalConfig" *ngIf="!isLoading">
  <overlay-scrollbars #osComponentRef1 class="main">
    <h2>院区系统配置</h2>
    <form nz-form [formGroup]="validateForm" class="forms">
      <div class="form">
        <nz-form-item
          class="formItem"
          *ngFor="let config of hospitalConfigList"
        >
          <ng-container [ngSwitch]="config.key">
            <ng-container *ngSwitchCase="'autoCreateUserRoleId'">
              <nz-form-label
                [nzSpan]="24"
                [nzFor]="config.key"
                nzRequired
                class="label"
                >{{ config.desc }}</nz-form-label
              >
              <nz-form-control
                [nzSpan]="24"
                [nzErrorTip]="'请选择' + config.desc + '!'"
              >
                <nz-select
                  [formControlName]="config.key"
                  [nzPlaceHolder]="'请选择' + config.desc"
                  nzShowSearch
                  nzServerSearch
                >
                  <ng-container *ngFor="let o of roleList">
                    <nz-option
                      *ngIf="true"
                      [nzValue]="o.id"
                      [nzLabel]="o.role"
                    ></nz-option>
                  </ng-container>
                  <nz-option *ngIf="false" nzDisabled nzCustomContent>
                    <i nz-icon nzType="loading" class="loading-icon"></i>
                    正在加载中...
                  </nz-option>
                </nz-select>
              </nz-form-control>
            </ng-container>
            <ng-container *ngSwitchCase="'autoCreateUserDeptId'">
              <nz-form-label
                [nzSpan]="24"
                [nzFor]="config.key"
                nzRequired
                class="label"
                >{{ config.desc }}</nz-form-label
              >
              <nz-form-control
                [nzSpan]="24"
                [nzErrorTip]="'请选择' + config.desc + '!'"
              >
                <nz-select
                  [formControlName]="config.key"
                  [nzPlaceHolder]="'请选择' + config.desc"
                  nzShowSearch
                  nzServerSearch
                  (nzOnSearch)="onSearch($event)"
                >
                  <ng-container *ngFor="let o of deptList">
                    <nz-option
                      *ngIf="!searchLoading"
                      [nzValue]="o.id"
                      [nzLabel]="o.dept"
                    ></nz-option>
                  </ng-container>
                  <nz-option *ngIf="searchLoading" nzDisabled nzCustomContent>
                    <i nz-icon nzType="loading" class="loading-icon"></i>
                    正在加载中...
                  </nz-option>
                </nz-select>
              </nz-form-control>
            </ng-container>
            <ng-container *ngSwitchCase="'autoCreateUserGroupId'">
              <nz-form-label
                [nzSpan]="24"
                [nzFor]="config.key"
                nzRequired
                class="label"
                >{{ config.desc }}</nz-form-label
              >
              <nz-form-control
                [nzSpan]="24"
                [nzErrorTip]="'请选择' + config.desc + '!'"
              >
                <nz-select
                  [formControlName]="config.key"
                  [nzPlaceHolder]="'请选择' + config.desc"
                  nzShowSearch
                  nzServerSearch
                >
                  <ng-container *ngFor="let o of groupList">
                    <nz-option
                      *ngIf="true"
                      [nzValue]="o.id"
                      [nzLabel]="o.groupName"
                    ></nz-option>
                  </ng-container>
                  <nz-option *ngIf="false" nzDisabled nzCustomContent>
                    <i nz-icon nzType="loading" class="loading-icon"></i>
                    正在加载中...
                  </nz-option>
                </nz-select>
              </nz-form-control>
            </ng-container>
            <ng-container *ngSwitchCase="'phone_num_port'">
              <nz-form-label [nzSpan]="24" [nzFor]="config.key" class="label">
                {{ config.desc }}</nz-form-label
              >
              <nz-form-control
                [nzSpan]="24"
                [nzErrorTip]="'请选择' + config.desc + '!'"
              >
                <div class="phone">
                  <input
                    [formControlName]="config.key"
                    nz-input
                    [placeholder]="'请选择' + config.desc"
                  />
                  <input nz-input [value]="config.value2" disabled />
                </div>
              </nz-form-control>
            </ng-container>
            <ng-container *ngSwitchCase="'phone_num_port1'">
              <nz-form-label [nzSpan]="24" [nzFor]="config.key" class="label">
                {{ config.desc }}</nz-form-label
              >
              <nz-form-control
                [nzSpan]="24"
                [nzErrorTip]="'请选择' + config.desc + '!'"
              >
                <div class="phone">
                  <input
                    [formControlName]="config.key"
                    nz-input
                    [placeholder]="'请选择' + config.desc"
                  />
                  <input nz-input [value]="config.value2" disabled />
                </div>
              </nz-form-control>
            </ng-container>
            <ng-container *ngSwitchCase="'phone_num_port2'">
              <nz-form-label [nzSpan]="24" [nzFor]="config.key" class="label">
                {{ config.desc }}</nz-form-label
              >
              <nz-form-control
                [nzSpan]="24"
                [nzErrorTip]="'请选择' + config.desc + '!'"
              >
                <div class="phone">
                  <input
                    [formControlName]="config.key"
                    nz-input
                    [placeholder]="'请选择' + config.desc"
                  />
                  <input nz-input [value]="config.value2" disabled />
                </div>
              </nz-form-control>
            </ng-container>
            <ng-container *ngSwitchCase="'phone_num_port3'">
              <nz-form-label [nzSpan]="24" [nzFor]="config.key" class="label">
                {{ config.desc }}</nz-form-label
              >
              <nz-form-control
                [nzSpan]="24"
                [nzErrorTip]="'请选择' + config.desc + '!'"
              >
                <div class="phone">
                  <input
                    [formControlName]="config.key"
                    nz-input
                    [placeholder]="'请选择' + config.desc"
                  />
                  <input nz-input [value]="config.value2" disabled />
                </div>
              </nz-form-control>
            </ng-container>
            <ng-container *ngSwitchCase="'rebackPatientTypeId'">
              <nz-form-label
                [nzSpan]="24"
                [nzFor]="config.key"
                nzRequired
                class="label"
                >{{ config.desc }}</nz-form-label
              >
              <nz-form-control
                [nzSpan]="24"
                [nzErrorTip]="'请选择' + config.desc + '!'"
              >
                <nz-select
                  [formControlName]="config.key"
                  [nzPlaceHolder]="'请选择' + config.desc"
                  nzShowSearch
                  nzServerSearch
                >
                  <ng-container *ngFor="let o of taskTypeList">
                    <nz-option
                      *ngIf="true"
                      [nzValue]="o.id"
                      [nzLabel]="o.taskName"
                    ></nz-option>
                  </ng-container>
                  <nz-option *ngIf="false" nzDisabled nzCustomContent>
                    <i nz-icon nzType="loading" class="loading-icon"></i>
                    正在加载中...
                  </nz-option>
                </nz-select>
              </nz-form-control>
            </ng-container>
            <ng-container *ngSwitchCase="'transDeptTypeId'">
              <nz-form-label
                [nzSpan]="24"
                [nzFor]="config.key"
                nzRequired
                class="label"
                >{{ config.desc }}</nz-form-label
              >
              <nz-form-control
                [nzSpan]="24"
                [nzErrorTip]="'请选择' + config.desc + '!'"
              >
                <nz-select
                  [formControlName]="config.key"
                  [nzPlaceHolder]="'请选择' + config.desc"
                  nzShowSearch
                  nzServerSearch
                >
                  <ng-container *ngFor="let o of taskTypeList">
                    <nz-option
                      *ngIf="true"
                      [nzValue]="o.id"
                      [nzLabel]="o.taskName"
                    ></nz-option>
                  </ng-container>
                  <nz-option *ngIf="false" nzDisabled nzCustomContent>
                    <i nz-icon nzType="loading" class="loading-icon"></i>
                    正在加载中...
                  </nz-option>
                </nz-select>
              </nz-form-control>
            </ng-container>
            <ng-container *ngSwitchCase="'rushNoticeShift'">
              <nz-form-label [nzSpan]="24" [nzFor]="config.key" class="label">{{
                config.desc
              }}</nz-form-label>
              <nz-form-control
                [nzSpan]="24"
                [nzErrorTip]="'请选择' + config.desc + '!'"
              >
                <nz-checkbox-group [formControlName]="config.key">
                </nz-checkbox-group>
              </nz-form-control>
            </ng-container>
            <ng-container *ngSwitchCase="'repairSpecimenStatus'">
              <nz-form-label
                [nzSpan]="24"
                [nzFor]="config.key"
                class="label"
                [nzRequired]="config.required"
                >是否执行标本验证机制</nz-form-label
              >
              <nz-form-control
                [nzSpan]="24"
                [nzErrorTip]="'请选择是否执行标本验证机制!'"
              >
                <nz-radio-group
                  [formControlName]="config.key"
                  (ngModelChange)="changeRepairSpecimenStatus($event)"
                >
                  <label nz-radio nzValue="1">是</label>
                  <label nz-radio nzValue="0">否</label>
                </nz-radio-group>
              </nz-form-control>
            </ng-container>
            <ng-container *ngSwitchCase="'repairSpecimenStatusMinute'">
              <ng-container *ngIf="config.show">
                <nz-form-label
                  [nzSpan]="24"
                  [nzFor]="config.key"
                  class="label"
                  [nzRequired]="config.required"
                  >验证时间</nz-form-label
                >
                <nz-form-control [nzSpan]="24" [nzErrorTip]="'请填写验证时间!'">
                  <nz-input-number
                    [formControlName]="config.key"
                    [nzFormatter]="formatterDollar"
                    [nzMin]="0"
                    [nzStep]="1"
                    [nzSize]="'small'"
                  >
                  </nz-input-number>
                  分钟
                </nz-form-control>
              </ng-container>
            </ng-container>
            <ng-container *ngSwitchCase="'repairSpecimenStatusCheckDeptIds'">
              <ng-container *ngIf="config.show">
                <nz-form-label
                  [nzSpan]="24"
                  [nzFor]="config.key"
                  class="label"
                  [nzRequired]="config.required"
                  >验证检验科室范围</nz-form-label
                >
                <nz-form-control
                  [nzSpan]="24"
                  [nzErrorTip]="'请选择验证检验科室范围!'"
                >
                  <nz-select
                    nzMode="multiple"
                    [nzDropdownMatchSelectWidth]="false"
                    nzShowSearch
                    nzAllowClear
                    nzPlaceHolder="请选择验证检验科室范围"
                    nzServerSearch
                    [formControlName]="config.key"
                    (nzOnSearch)="onSearchInspectionDepartmentScope($event)"
                  >
                    <ng-container *ngFor="let o of deptList2">
                      <nz-option
                        *ngIf="!searchLoading"
                        [nzLabel]="o.dept"
                        [nzValue]="o.id"
                      ></nz-option>
                    </ng-container>
                    <nz-option *ngIf="searchLoading" nzDisabled nzCustomContent>
                      <i nz-icon nzType="loading" class="loading-icon"></i>
                      搜索中...
                    </nz-option>
                  </nz-select>
                </nz-form-control>
              </ng-container>
            </ng-container>
            <ng-container *ngSwitchCase="'allowNucleicAcidPrinting'">
              <nz-form-label
                [nzSpan]="24"
                [nzFor]="config.key"
                class="label"
                [nzRequired]="config.required"
                >是否允许核酸打印</nz-form-label
              >
              <nz-form-control
                [nzSpan]="24"
                [nzErrorTip]="'请选择是否允许核酸打印!'"
              >
                <nz-radio-group
                  [formControlName]="config.key"
                  (ngModelChange)="changeAllowNucleicAcidPrinting($event)"
                >
                  <label nz-radio nzValue="1">是</label>
                  <label nz-radio nzValue="0">否</label>
                </nz-radio-group>
              </nz-form-control>
            </ng-container>
            <ng-container *ngSwitchCase="'nucleicAcidPrintingTaskType'">
              <ng-container *ngIf="config.show">
                <nz-form-label
                  [nzSpan]="24"
                  [nzFor]="config.key"
                  class="label"
                  [nzRequired]="config.required"
                  >核酸打印任务类型</nz-form-label
                >
                <nz-form-control
                  [nzSpan]="24"
                  [nzErrorTip]="'请选择核酸打印任务类型!'"
                >
                  <nz-select
                    [nzDropdownMatchSelectWidth]="false"
                    nzShowSearch
                    nzAllowClear
                    nzPlaceHolder="请选择核酸打印任务类型"
                    nzServerSearch
                    [formControlName]="config.key"
                    (nzOnSearch)="onSearchNucleicAcidPrintingTaskType($event)"
                  >
                    <ng-container *ngFor="let o of allTaskTypeList">
                      <nz-option
                        *ngIf="!searchLoading"
                        [nzLabel]="o.taskName"
                        [nzValue]="o.id"
                      ></nz-option>
                    </ng-container>
                    <nz-option *ngIf="searchLoading" nzDisabled nzCustomContent>
                      <i nz-icon nzType="loading" class="loading-icon"></i>
                      搜索中...
                    </nz-option>
                  </nz-select>
                </nz-form-control>
              </ng-container>
            </ng-container>
            <ng-container *ngSwitchCase="'hos_itsmIncident'">
              <ng-container *ngIf="isHosItsmIncident">
                <nz-form-label
                  [nzSpan]="24"
                  [nzFor]="config.key"
                  class="label"
                  [nzRequired]="config.required"
                  >{{config.desc}}</nz-form-label
                >
                <nz-form-control
                  [nzSpan]="24"
                  [nzErrorTip]="'请选择!'"
                >
                  <nz-radio-group
                    [formControlName]="config.key"
                  >
                    <label nz-radio nzValue="1">是</label>
                    <label nz-radio nzValue="0">否</label>
                  </nz-radio-group>
                </nz-form-control>
              </ng-container>
            </ng-container>
            <ng-container *ngSwitchCase="'nurseSendOrder'">
              <nz-form-label
                [nzSpan]="24"
                [nzFor]="config.key"
                class="label"
                [nzRequired]="config.required"
                >{{config.desc}}</nz-form-label
              >
              <nz-form-control
                [nzSpan]="24"
                [nzErrorTip]="'请选择!'"
              >
                <nz-radio-group
                  [formControlName]="config.key"
                >
                  <label nz-radio nzValue="1">是</label>
                  <label nz-radio nzValue="0">否</label>
                </nz-radio-group>
              </nz-form-control>
            </ng-container>
            <ng-container *ngSwitchCase="'dispatchUserList'">
              <nz-form-label [nzSpan]="24" [nzFor]="config.key" nzRequired class="label">{{ config.desc }}</nz-form-label>
              <nz-form-control [nzSpan]="24" [nzErrorTip]="'请选择' + config.desc + '!'">
                <nz-select [formControlName]="config.key" [nzPlaceHolder]="'请选择' + config.desc" nzShowSearch>
                  <ng-container *ngFor="let o of dispatchUserList">
                    <nz-option *ngIf="true" nzValue="{{o.id}}" nzLabel="{{o.name}}"></nz-option>
                  </ng-container>
                  <nz-option *ngIf="false" nzDisabled nzCustomContent>
                    <i nz-icon nzType="loading" class="loading-icon"></i>
                    正在加载中...
                  </nz-option>
                </nz-select>
              </nz-form-control>
            </ng-container>
            <ng-container *ngSwitchDefault>
              <nz-form-label
                [nzSpan]="24"
                [nzFor]="config.key"
                [nzRequired]="config.required"
                class="label"
              >
                {{ config.desc }}</nz-form-label
              >
              <nz-form-control
                [nzSpan]="24"
                [nzErrorTip]="'请选择' + config.desc + '!'"
              >
                <input
                  [formControlName]="config.key"
                  nz-input
                  [placeholder]="'请选择' + config.desc"
                />
              </nz-form-control>
            </ng-container>
          </ng-container>
        </nz-form-item>
      </div>
    </form>
  </overlay-scrollbars>
  <div class="submit">
    <button
      [disabled]="!coopBtns.edit"
      nz-button
      nzType="primary"
      class="save"
      (click)="submitForm()"
      [nzLoading]="saveLoading"
    >
      保存
    </button>
  </div>
</div>
<div class="hospitalConfig" *ngIf="isLoading">
  <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>
