<div class="list-template">
  <div class="list-template__content">
    <div class="list-template__top" nz-row>
      <div nz-col nzXl='18' class="list-template__searchBox">
        <div class="list-template__searchItem">
          <span class="label">入库时间</span>：
          <nz-range-picker nzShowTime [(ngModel)]="dateRange" (nzOnCalendarChange)="onCalendarChangeDate($event)"></nz-range-picker>
        </div>
        <div class="list-template__searchItem">
          <span class="label">患者姓名：</span>
          <input nz-input class="formItem" placeholder="请输入患者姓名" [(ngModel)]="searchCriteria.patientName" />
        </div>
        <div class="list-template__searchItem">
          <span class="label">检查单号：</span>
          <input nz-input class="formItem" placeholder="请输入检查单号" [(ngModel)]="searchCriteria.inspectCode" />
        </div>
        <div class="list-template__searchItem">
          <span class="label">配送人员：</span>
          <nz-select [nzDropdownMatchSelectWidth]="false" class="formItem" nzServerSearch nzShowSearch nzAllowClear
            nzPlaceHolder="请选择配送人员" [(ngModel)]="searchCriteria.workerId" (nzOnSearch)="changeInp($event)"
            (nzOpenChange)="changeSearch($event)">
            <ng-container *ngFor="let data of workerSearch">
              <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>
        </div>
        <div class="list-template__searchItem">
          <span class="label">状态：</span>
          <nz-select [nzDropdownMatchSelectWidth]="false" class="formItem" nzServerSearch nzShowSearch nzAllowClear nzPlaceHolder="请选择状态" [(ngModel)]="searchCriteria.inspectState" (nzOpenChange)="changeSearch1($event)">
            <ng-container *ngFor="let data of types">
              <nz-option *ngIf="!isLoading1" [nzLabel]="data.name" [nzValue]="data.id"></nz-option>
            </ng-container>
            <nz-option *ngIf="isLoading1" nzDisabled nzCustomContent>
              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
            </nz-option>
          </nz-select>
        </div>
      </div>
      <div nz-col nzXl="6" class="list-template__btns">
        <button nz-button class="btn default" (click)='getList(1)'>搜索</button>
        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
        <button nz-button *ngIf="coopBtns.add" class="btn default ml8" (click)="addModal()">新增</button>
      </div>
    </div>
    <div class="list-template__checkBoxes">
      <nz-checkbox-group [(ngModel)]="checkOptionsOne" (ngModelChange)="log(checkOptionsOne)"></nz-checkbox-group>
    </div>
    <div class="list-template__bottom">
      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
        [nzLoading]="loading1">
        <thead>
          <tr class="thead">
            <th nzWidth="4%">序号</th>
            <th nzWidth="8%">患者姓名|住院号</th>
            <th nzWidth="10%">申请科室|医生备注</th>
            <th nzWidth="10%">检查科室</th>
            <th nzWidth="14%">检查单号|检查项目</th>
            <th nzWidth="14%">预约时间|入库时间</th>
            <th nzWidth="8%">检查状态</th>
            <th nzWidth="10%">陪检人员</th>
            <th nzWidth="14%">陪检方式|注意事项</th>
            <th nzWidth="10%">操作</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let data of listOfData;let i = index">
            <td>{{i+(pageIndex-1) * pageSize + 1}}</td>
            <td>{{ data.patientName }}({{ data.patientBedNum }})<br>{{ data.residenceNo }}</td>
            <td>{{ data.applyDept?.dept }}<br>{{ data.remark }}</td>
            <td>{{ data.execDept?.dept }}</td>
            <td>{{ data.inspectCode }}<br>{{data.inspectName}}</td>
            <td class="po-re"><span *ngIf="data.upAppointmentTime!= undefined && data.upAppointmentTime==1" class="red-sign">*</span>{{ data.yyEndTime }}<br>{{ data.createTime | date:'yyyy-MM-dd HH:mm:ss' }}</td>
            <td>{{ data.inspectState?.name}}</td>
            <td>{{ data.workerName }}</td>
            <td>{{ data.patientDTO?.tripTypeDTO?.inspectMode }}<br>{{ data.patientDTO?.remark }}</td>
            <td>
              <div class="coop">
                <span *ngIf="coopBtns.lookLog" (click)="showLogs(data)">查看日志</span>
                <span *ngIf="coopBtns.edit" (click)="edit(data)">编辑</span>
              </div>
            </td>
          </tr>
        </tbody>
      </nz-table>
      <div class="list-template__pagination">
        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize"
          (nzPageIndexChange)="getList(0)" (nzPageSizeChange)="getList(0)">
        </nz-pagination>
      </div>
    </div>
  </div>
</div>

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

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

<!-- 新增检查 -->
<app-add-inspect-info *ngIf="isShowAddInspect" [inspectAndPatientTransportConfig]="configs" (closeModelHs)="closeAddInspectModel($event)" (confirmModelHs)="confirmAddInspectModel($event)"></app-add-inspect-info>

<!-- 查看日志 -->
<app-inspect-log-prompt-modal *ngIf="logPromptModalShow" [show]="logPromptModalShow" [id]="inspectId" (closeModelHs)="closeModelLog($event)"></app-inspect-log-prompt-modal>
