<div class="header">
  <div class="display_flex align-items_center">
    <div class="dept">{{deptDisplay == 2 ? deptDTO.deptalias : deptDTO.dept}}</div>
    <div class="yyTime">
      <span class="label">检查时间：</span>
      <nz-date-picker [(ngModel)]="searchData.dateRange" [nzAllowClear]="false"></nz-date-picker>
    </div>
    <div class="searchItem">
      <span class="label">患者：</span>
      <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzPlaceHolder="请选择患者" [(ngModel)]="searchData.id" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeInp('patient', $event)" (nzOpenChange)="openChangePatient($event)">
        <ng-container *ngFor="let option of patientList">
          <nz-option *ngIf="!isLoading" [nzLabel]="option.patientName + '(' + (option.bedNum || '') + ')' + '-' + option.residenceNo" [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="searchItem">
      <div class="patient">
        <label nz-checkbox [(ngModel)]="searchData.noneGdid">未建单检查</label>
      </div>
    </div>
    <div class="searchItem">
        <div class="patient">
          <label nz-checkbox [(ngModel)]="searchData.noneTripType">未标记患者</label>
        </div>
        <div class="patient">
          <label nz-checkbox [(ngModel)]="searchData.noneEndDept">未标记检查科室</label>
          <span class="circle red" title="未标记检查科室"></span>
          <span class="circle red" style="right: -21px;" title="未标记检查科室"></span>
        </div>
        <div class="patient">
          <label nz-checkbox [(ngModel)]="searchData.noneYY">无预约时间检查</label>
          <span class="circle red" title="无预约时间检查"></span>
        </div>
    </div>
  </div>
  <div class="display_flex align-items_center">
    <div class="display_flex flex-direction_column">
      <button nz-button class="btn default" (click)='reset()'>重置</button>
      <button nz-button class="btn default mt8" (click)='getList()'>搜索</button>
    </div>
    <button nz-button nzType="default" class="ml8" (click)='goBack()'>返回</button>
    <div class="info">
      <div>患者:{{listOfData.length}}</div>
      <div class="infoNum">检查项:{{inspectTotalCount}}</div>
    </div>
  </div>
</div>
<div class="table">
  <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1">
    <thead>
      <tr class="thead">
        <th nzWidth="12%">患者信息</th>
        <th nzWidth="12%">护理信息</th>
        <th nzWidth="12%">陪检方式</th>
        <th nzWidth="22%">注意事项</th>
        <th nzWidth="30%">检查项目</th>
        <th nzWidth="12%">操作</th>
      </tr>
    </thead>
    <tbody>
      <tr *ngFor="let data of listOfData">
        <td>
          <span class="patient">
            <ng-container *ngIf="!data.tripType">
              <span class="circle red" title="未标记患者"></span>
            </ng-container>
            <span>{{data.patientName}}</span>
          </span>
          <br>
          <ng-container *ngIf="data.patientType && data.patientType.value == 'I'">住：{{data.patientCode}}（{{data.bedNum}}）</ng-container><ng-container *ngIf="data.patientType && data.patientType.value == 'O'">门诊：{{data.patientCode}}</ng-container><ng-container *ngIf="data.patientType && data.patientType.value == 'E'">急：{{data.patientCode}}</ng-container>
          <br>
          <ng-container *ngIf="data.age !== undefined">{{data.age}}岁</ng-container>-{{data.gender?.name}}
        </td>
        <td>
          <ng-container *ngIf="configs.updatePatientIllness == 1;else elseIllnessStateTpl">
            <nz-radio-group [(ngModel)]="data.illnessStateCopy" (ngModelChange)="changeIllnessState($event, data.id)">
              <label nz-radio class="display_block" [nzValue]="item.id" *ngFor="let item of illnessStateList">{{item.name}}</label>
            </nz-radio-group>
          </ng-container>
          <ng-template #elseIllnessStateTpl>
            {{data.careLevel?.name}}<br>{{data.illnessState?.name}}
          </ng-template>
        </td>
        <td>
          <nz-radio-group [(ngModel)]="data.tripType" (ngModelChange)="changeTripType($event, data.id)">
            <label nz-radio class="display_block" [nzValue]="item.id" *ngFor="let item of workOrderInspectScoreList">{{item.inspectMode}}</label>
          </nz-radio-group>
        </td>
        <td class="text_align_left">
          <div class="remarkText">
            <span class="remarkTextInner" (click)="editRemark({data: data, inspect: inspect})"><span [ngStyle]="{ color: data.remark ? '#333' : '#999'}">{{data.remark || '请点击填写注意事项！'}}</span><span style="margin-top: 2px;" class="icon_transport transport-weibiaoti2010104 remarkTextEdit"></span></span>
          </div>
        </td>
        <td>
          <div *ngFor="let inspect of data.inspects" class="display_flex align-items_center" style="padding-left: 30px;">
            <span class="patient">
              <ng-container *ngIf="!inspect.execDept;else elseTpl">
                <span class="circle red" title="未标记检查科室"></span>
                <span class="circle red" style="left: -21px;" title="未标记检查科室"></span>
              </ng-container>
              <ng-template #elseTpl>
                <ng-container *ngIf="!inspect.yyTime">
                  <span class="circle red" title="无预约时间检查"></span>
                </ng-container>
              </ng-template>
              <span [title]="inspect.remark" *ngIf="inspect.remark"><i class="icon_transport transport-chaoshi"></i><span *ngIf="inspect.upAppointmentTime!= undefined && inspect.upAppointmentTime==1" class="red-sign">*</span>{{(inspect.yyEndTime || "") + " " + (inspect.execDept ? (deptDisplay == 2 ? inspect.execDept.deptalias : inspect.execDept.dept) : '') + " 进行 " + (inspect.inspectName + '-' + inspect.inspectCode || "检查")}} <span class="inspectState" *ngIf="inspect.gdId" (click)="detail($event, inspect.gdId)">{{inspect.inspectState?.name}}</span></span>
              <span *ngIf="!inspect.remark"><span *ngIf="inspect.upAppointmentTime!= undefined && inspect.upAppointmentTime==1" class="red-sign">*</span>{{(inspect.yyEndTime || "") + " " + (inspect.execDept ? (deptDisplay == 2 ? inspect.execDept.deptalias : inspect.execDept.dept) : '') + " 进行 " + (inspect.inspectName?inspect.inspectName:'' + '-' + inspect.inspectCode || "检查")}} <span class="inspectState" *ngIf="inspect.gdId" (click)="detail($event, inspect.gdId)">{{inspect.inspectState?.name}}</span></span>
            </span>
            <span *ngIf="!inspect.gdId" class="icon_transport transport-weibiaoti2010104" (click)="editInspect({data: data, inspect: inspect})"></span>
            <span *ngIf="!inspect.gdId" class="icon_transport transport-shanchu1" (click)="showDelModal({data: data, inspect: inspect}, '您确认要删除吗？','删除','delInspect')"></span>
          </div>
        </td>
        <td>
          <div class="coop">
            <span (click)="showDelModal(data, '您确认要清空标记吗？','清空标记','clearSign')">清空标记</span>
            <span (click)="addInspect(data)">增加检查项目</span>
          </div>
        </td>
      </tr>
    </tbody>
  </nz-table>
</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>

<!-- 遮罩 -->
<app-mask *ngIf="maskFlag"></app-mask>

<!-- 修改检查 -->
<app-edit-inspect-info [extra1]="coopData.inspect && coopData.inspect.inspectCheckType && coopData.inspect.inspectCheckType.extra1" [execDeptList]="coopData.inspect && coopData.inspect.inspectCheckType && coopData.inspect.inspectCheckType.deptList" [execDeptId]="coopData.inspect && coopData.inspect.execDeptId" [remarkText]="coopData.inspect && coopData.inspect.remark" [date]="coopData.inspect && coopData.inspect.yyTime" [endCheckTime]="coopData.inspect.endCheckTime" [inspectAndPatientTransportConfig]="configs" *ngIf="isShowSelectDate" (submitFormHand)="submitSelectDate($event)" (cancelFlagHand)="cancelSelectDate($event)"></app-edit-inspect-info>

<!-- 修改注意事项 -->
<app-select-remark [inspect]="coopData.data" *ngIf="isShowSelectRemark" (submitFormHand)="submitSelectRemark($event)" (cancelFlagHand)="cancelSelectRemark($event)"></app-select-remark>

<!-- 追加检查项目 -->
<app-add-inspect-three-modal *ngIf="isShowAddInspect" [patientDTO]="patientDTO" [deptDisplay]="deptDisplay" [inspectAndPatientTransportConfig]="configs" (closeModelHs)="closeAddInspectModel($event)" (confirmModelHs)="confirmAddInspectModel($event)"></app-add-inspect-three-modal>

<!-- 查看详情 -->
<router-outlet></router-outlet>
