<div class="list-template">
  <div class="list-template__content">
    <div class="list-template__top" nz-row>
      <div nz-col nzXl='19' class="list-template__searchBox">
        <div class="list-template__searchItem">
          <span class="label">申请科室</span>：
          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzPlaceHolder="请选择申请科室" [(ngModel)]="searchDto.applyDept" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeInp('department', $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>
        </div>
        <div class="list-template__searchItem">
          <span class="label">收取人</span>：
          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzPlaceHolder="请选择收取人" [(ngModel)]="searchDto.collectionUser" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeInp('patient', $event)" (nzOpenChange)="openChangePatient($event)" (ngModelChange)="setIsSelecting(true)">
            <ng-container *ngFor="let option of deliveryUserList">
              <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [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="list-template__searchItem">
				  <span class="label">创建时间区间</span>：
				  <nz-range-picker nzShowTime [(ngModel)]="dateRange" (nzOnCalendarChange)="onCalendarChangeDate($event)"></nz-range-picker>
				</div>
      </div>
      <div nz-col nzLg="5" class="list-template__btns">
        <button nz-button class="btn default ml8" (click)='search()'>搜索</button>
        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
      </div>
    </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="9%">业务类型</th>
            <th nzWidth="10%">创建时间|单号</th>
            <th nzWidth="13%">申请科室|终点科室</th>
            <th nzWidth="13%">收取信息</th>
            <th nzWidth="13%">中转信息</th>
            <th nzWidth="13%">送达信息</th>
            <th nzWidth="9%">交接数量</th>
						<th nzWidth="8%">业务状态</th>
            <th nzWidth="15%">工单信息</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let data of listOfData;let i = index">
            <td>{{data.businessTaskTypeDTO?.businessName}}</td>
            <td>{{ data.createTime | date: 'yyyy-MM-dd HH:mm'}}<br>{{ data.businessNo }}</td>
            <td>{{ data.applyDeptDTO?.dept }}<br>{{ data.endDeptDTO?.dept }}</td>
            <td>
							<div>{{data.collectionUserDTO?.name}} <span *ngIf="data.collectionUserDTO && data.collectionHandoverUserDTO">|</span> {{data.collectionHandoverUserDTO?.name}}</div>
							<div>{{data.collectionTime | date: 'yyyy-MM-dd HH:mm'}}</div>
						</td>
            <td>
							{{ data.transferTime | date: 'yyyy-MM-dd HH:mm' }}<br>
							{{ data.transferStartTime | date: 'yyyy-MM-dd HH:mm' }}<br>
							{{ data.transferUserDTO?.name }}
						</td>
            <td>{{ data.deliveryUserDTO?.name }} <span *ngIf="data.deliveryUserDTO && data.deliveryHandoverUserDTO">|</span>	 {{ data.deliveryHandoverUserDTO?.name }}<br>{{ data.deliveryTime | date: 'yyyy-MM-dd HH:mm'}}</td>
						<td>{{ data.handoverNum1}}</td>
						<td>{{ data.businessStatus?.name}}</td>
            <td>
							<div *ngIf="data.gdCode">收：<span class="clickable" (click)="detail($event, data.gdId)">{{ data.gdCode }}</span></div>
							<div *ngIf="data.transferGdCode">中转：<span class="clickable" (click)="detail($event, data.transferGdId)">{{ data.transferGdCode }}</span></div>
						</td>
          </tr>
        </tbody>
      </nz-table>
      <div class="list-template__pagination">
        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize" nzShowSizeChanger
          (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-specimen-package-log-prompt-modal
  *ngIf="logPromptModalShow"
  [show]="logPromptModalShow"
  [id]="packId"
  (closeModelHs)="closeModelLog($event)"
></app-specimen-package-log-prompt-modal>

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