<div class="list-template">
  <div class="list-template__content">
    <div class="list-template__top" nz-row>
      <div nz-col nzXl='16' class="list-template__searchBox">
        <div class="list-template__searchItem">
          <span class="label">医废类型：</span>
          <nz-select
            [nzDropdownMatchSelectWidth]="false"
            class="formItem"
            nzServerSearch
            nzShowSearch
            nzAllowClear
            nzPlaceHolder="请选择医废类型"
            [(ngModel)]="searchCriteria.clinicalWasteType"
            (nzOnSearch)="changeInp($event)"
            (nzOpenChange)="changeSearch($event)"
          >
            <ng-container *ngFor="let data of clinicalWasteTypeList">
              <nz-option
                *ngIf="!isLoading"
                nzLabel="{{ data.typeName }}"
                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>
          <input nz-input class="formItem" placeholder="请输入医废序号：" [(ngModel)]="searchCriteria.clinicalWasteSn" />
        </div>
        <div class="list-template__searchItem">
          <span class="label">医废状态：</span>
          <nz-select
            [nzDropdownMatchSelectWidth]="false"
            class="formItem"
            nzServerSearch
            nzShowSearch
            nzAllowClear
            nzPlaceHolder="请选择医废状态"
            [(ngModel)]="searchCriteria.status"
            (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 class="list-template__searchItem">
          <span class="label">收取时间：</span>
          <nz-range-picker nzShowTime [(ngModel)]="searchCriteria.dateRange" (nzOnCalendarChange)="onCalendarChangeDate($event)"></nz-range-picker>
        </div>
      </div>
      <div nz-col nzXl="8" class="list-template__btns">
        <button nz-button class="btn default" (click)='reset()'>重置</button>
        <button nz-button class="btn default ml8" (click)='getList(1)'>搜索</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="5%">#</th>
            <th nzWidth="10%">医废类型</th>
            <th nzWidth="10%">序号</th>
            <th nzWidth="10%">重量（KG）</th>
            <th nzWidth="10%">科室名称</th>
            <th nzWidth="10%">收取人</th>
            <th nzWidth="10%">收取时间</th>
            <th nzWidth="8%">医废状态</th>
            <th nzWidth="10%">备注</th>
            <th nzWidth="7%">总价</th>
            <th nzWidth="10%">操作</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let data of listOfData;let index = index">
            <td>{{index+(pageIndex-1) * pageSize + 1}}</td>
            <td>{{ data.clinicalWasteType ? data.clinicalWasteType.typeName : '' }}</td>
            <td>{{ data.clinicalWasteSn }}</td>
            <td>{{ data.weight }}</td>
            <td>{{ data.dept ? data.dept.dept: '' }}</td>
            <td>{{ data.receivor ? data.receivor.name: '' }}</td>
            <td>{{ data.receiveTime | date:"yyyy-MM-dd HH:mm:ss" }}</td>
            <td>{{ data.status ? data.status.name : '' }}</td>
            <td>{{ data.remark }}</td>
            <td>{{ data.totalPrice }}</td>
            <td>
              <div class="coop">
                <span *ngIf="coopBtns.look" (click)="viewHistory(data)">查看日志</span>
                <span *ngIf="coopBtns.editNum && data.status.value != 4" (click)="showModal(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>
<!-- 矫正重量模态框 -->
<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="modal">
  <div class="modalBody">
    <div class="title">矫正重量<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
    </div>
    <overlay-scrollbars #osComponentRef1 class="content">
      <div style="height: 50px;line-height: 50px;">原重量：{{coopData.weight}}kg</div>
      <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
        <nz-form-item>
          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="weight">矫正重量</nz-form-label>
          <nz-form-control nzErrorTip="请填写矫正重量!">
            <nz-input-number nz-input formControlName="weight" nzPlaceHolder="请填写矫正重量" [nzMin]="0" [nzStep]="0.01" [nzPrecision]="2"></nz-input-number>
            <span class="red">（kg）</span>
          </nz-form-control>
        </nz-form-item>
      </form>
    </overlay-scrollbars>
    <div class="display_flex justify-content_flex-center">
      <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">确认</button>
      <button class="btn cancel" nz-button nzType="default" (click)="hideModal()">取消</button>
    </div>
  </div>
</div>
<!-- 删除模态框 -->
<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading" (confirmDelEvent)="confirmDel()" [content]="content"></app-dialog-delete>
<!-- 操作成功/失败提示框 -->
<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow" [info]="promptInfo"></app-prompt-modal>
<!-- 查看 -->
<app-medical-waste-log-prompt-modal
  *ngIf="historyPromptModalShow"
  [show]="historyPromptModalShow"
  [id]="id"
  (closeModelHs)="closeModelHistory($event)"
></app-medical-waste-log-prompt-modal>
