<div class="content priority">
  <div class="contentInner">
    <div class="list-template" id="wechatTable">
      <div class="list-template__content">
        <div class="list-template__bottom">
          <div class="list-template__top" nz-row>
            <div nz-col nzXl='17' class="list-template__searchBox">
            </div>
            <div nz-col nzXl="7" class="list-template__btns">
              <button nz-button class="btn default" (click)="addWechatModal()">新增</button>
            </div>
          </div>
          <nz-table class="list-template__nzTable" [nzData]="dataList" nzSize="middle" [nzShowPagination]="false"
            [nzLoading]="loading1">
            <thead>
              <tr class="thead">
                <th nzWidth="20%">科室</th>
                <th nzWidth="16%">检验项目</th>
                <th nzWidth="16%">标本类型</th>
                <th nzWidth="16%">试管类型</th>
                <th nzWidth="16%">标记类型</th>
                <th nzWidth="16%">操作</th>
              </tr>
            </thead>
            <tbody>
              <tr *ngFor="let data of dataList;let i = index">
                <td>{{data.startDeptDTO?.dept}}</td>
                <td>{{data.checkItem}}</td>
                <td>{{data.stype?.name}}</td>
                <td>{{data.tubeType?.name}}</td>
                <td>{{data.urgent == 1 ? '标记加急' : ''}}</td>
                <td>
                  <div class="coop">
                    <span (click)="showDelModal(data,'您确认要删除吗？','删除','del')">删除</span>
                    <span (click)="editWechat(data)">编辑</span>
                  </div>
                </td>
              </tr>
            </tbody>
          </nz-table>
        </div>
      </div>
    </div>
  </div>
</div>

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

<!-- 删除模态框 -->
<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
(confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>

<!-- 新增/编辑模态框 -->
<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modalWechat">
  <div class="modalBody">
    <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hideWechatModal()"></i></div>
    <div class="content">
      <form nz-form [formGroup]="validateForm" class="addForm">
        <nz-form-item>
          <nz-form-label [nzSpan]="6" nzRequired nzFor="stype">标本类型</nz-form-label>
          <nz-form-control [nzSpan]="18" nzErrorTip="请选择标本类型!">
            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="stype" nzPlaceHolder="请选择标本类型" nzServerSearch>
              <ng-container *ngFor="let data of typeList">
                <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>
          </nz-form-control>
        </nz-form-item>
        <nz-form-item>
          <nz-form-label [nzSpan]="6" nzRequired nzFor="checkItem">检验项目</nz-form-label>
          <nz-form-control [nzSpan]="18" nzErrorTip="请输入检验项目!">
            <nz-input-group>
              <input formControlName="checkItem" nz-input placeholder="请输入检验项目">
            </nz-input-group>
          </nz-form-control>
        </nz-form-item>
        <nz-form-item>
          <nz-form-label [nzSpan]="6" nzFor="startDept"><span class="visibility_hidden">囧</span>申请科室</nz-form-label>
          <nz-form-control [nzSpan]="18" nzErrorTip="请选择申请科室!">
            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="startDept" nzPlaceHolder="请选择申请科室" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeDeptInp($event)" (nzOpenChange)="openChangeDept($event)" (ngModelChange)="setIsSelecting(true)">
              <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-form-control>
        </nz-form-item>
        <nz-form-item>
          <nz-form-label [nzSpan]="6" nzFor="tubeType"><span class="visibility_hidden">囧</span>试管类型</nz-form-label>
          <nz-form-control [nzSpan]="18" nzErrorTip="请选择试管类型!">
            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="tubeType" nzPlaceHolder="请选择试管类型" nzServerSearch>
              <nz-option *ngFor="let data of tubeTypeList" [nzLabel]="data.name" [nzValue]="data.id"></nz-option>
            </nz-select>
          </nz-form-control>
        </nz-form-item>
        <nz-form-item>
          <nz-form-label [nzSpan]="6" nzRequired nzFor="urgent">标记类型</nz-form-label>
          <nz-form-control [nzSpan]="18" nzErrorTip="请选择标记类型!">
            <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="urgent" nzPlaceHolder="请选择标记类型" nzServerSearch>
              <nz-option nzLabel="标记加急" [nzValue]="1"></nz-option>
            </nz-select>
          </nz-form-control>
        </nz-form-item>
      </form>
    </div>
    <div class=" display_flex justify-content_flex-center">
      <button nzType="primary" nz-button (click)="submitWechatForm()" [nzLoading]="btnLoading">确认</button>
      <button class="btn cancel" nz-button nzType="default" (click)="hideWechatModal()">取消</button>
    </div>
  </div>
</div>
