<!--
 * @Author: your name
 * @Date: 2021-12-24 15:38:08
 * @LastEditTime : 2022-04-15 16:42:10
 * @LastEditors  : Shiming
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath     : \\tms-obc-web\\src\\app\\routes\\waybill-management\\components\\abnormal-appear\\abnormal-appear.component.html
-->
<!-- <page-header-wrapper title="异常上报"> </page-header-wrapper>

<nz-card>
  <div nz-row nzGutter="8">
    <ng-container *ngIf="queryFieldCount > 4">
      <div nz-col [nzSpan]="_$expand ? 24 : 18">
        <sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
      </div>
      <div nz-col [nzSpan]="_$expand ? 24 : 6" [class.text-right]="_$expand">
        <button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="isLoading && st.loading"
          (click)="search()" acl [acl-ability]="['WAYBILL-ABNORMAL-search']">查询</button>
        <button nz-button (click)="resetSF()">重置</button>
        <button nz-button nzType="link" (click)="expandToggle()">
          {{ !_$expand ? '展开' : '收起' }}
          <i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
        </button>
      </div>
    </ng-container>
  </div>
</nz-card> -->

<nz-card class="table-box">
  <div class="tab_header">
    <label class="page_title"> <label class="driver">|</label> 异常上报</label>
    <nz-tabset [(nzSelectedIndex)]="selectedIndex" (nzSelectedIndexChange)="selectChange($event)"
      [nzTabBarExtraContent]="extraTemplate">
      <nz-tab [nzTitle]="'待回复(' + tabs?.stayQuantity + ')'"></nz-tab>
      <nz-tab [nzTitle]="'已回复(' + tabs?.receivedQuantity + ')'"> </nz-tab>
    </nz-tabset>
  </div>
  <div>
    <st #st [data]="service.$api_get_listOperatePage" [columns]="columns" [req]="{  params: reqParams }" [page]="{  }"
      [loading]="false" [scroll]="{ x: '2000px' ,y:scrollY }">
      <ng-template st-row="exceptionCertificateFirstFilePath" let-item let-index="index">
        <div class="imgBox">
          <div *ngIf="item?.exceptionCertificateFirstFilePath">
            <app-imagelist style="width: 40px;height: 40px" [imgList]="[item?.exceptionCertificateFirstFilePath]">
            </app-imagelist>
          </div>
          <div *ngIf="item?.exceptionCertificateSecondFilePath">
            <app-imagelist style="width: 40px;height: 40px" [imgList]="[item?.exceptionCertificateSecondFilePath]">
            </app-imagelist>
          </div>
          <div *ngIf="item?.exceptionCertificateThirdFilePath">
            <app-imagelist style="width: 40px;height: 40px" [imgList]="[item?.exceptionCertificateThirdFilePath]">
            </app-imagelist>
          </div>
        </div>
      </ng-template>
    </st>
    <!-- <st #st2 *ngIf="selectedIndex===1" [data]="service.$api_get_listOperatePage" [columns]="columns2"
      [req]="{ params: reqParams2 }" [page]="{ }" [loading]="false" [scroll]="{ x: '2000px',y:scrollY  }">
      <ng-template st-row="exceptionCertificateFirstFilePath" let-item let-index="index">
        <div class="imgBox">
          <div *ngIf="item?.exceptionCertificateFirstFilePath">
            <app-imagelist [imgList]="[item?.exceptionCertificateFirstFilePath]"> </app-imagelist>
          </div>
          <div *ngIf="item?.exceptionCertificateSecondFilePath">
            <app-imagelist [imgList]="[item?.exceptionCertificateSecondFilePath]"> </app-imagelist>
          </div>
          <div *ngIf="item?.exceptionCertificateThirdFilePath">
            <app-imagelist [imgList]="[item?.exceptionCertificateThirdFilePath]"> </app-imagelist>
          </div>
        </div>
      </ng-template>
    </st> -->
  </div>
</nz-card>

<ng-template #extraTemplate>
  <div class="mr-sm">
    <button nz-button nzDanger [nzLoading]="service.http.loading" (click)="openDrawer()" acl
      [acl-ability]="['WAYBILL-ABNORMAL-search']">筛选</button>
  </div>
</ng-template>

<ng-template #detailModal>
  <div nz-row nzGutter="8">
    <div nz-col nzSpan="24" se-container [labelWidth]="110" [col]="1">
      <se label="异常编号" class="mb-sm">
        {{itemInfo.exceptionCode}}
      </se>
      <se label="装货地" class="mb-sm">
        {{itemInfo.loadingAddressArr}}
      </se>
      <se label="卸货地" class="mb-sm">
        {{itemInfo.unloadingAddressArr}}
      </se>
      <se label="异常信息" class="mb-sm">
        {{itemInfo.exceptionContent}}
      </se>
      <se label="异常图片" class="mb-sm">
        <div style="display: flex;">
          <div *ngIf="itemInfo?.exceptionCertificateFirstFilePath" style="cursor: pointer;">
            <app-imagelist [imgList]="[itemInfo?.exceptionCertificateFirstFilePath]"> </app-imagelist>
          </div>
          <div *ngIf="itemInfo?.exceptionCertificateSecondFilePath" style="cursor: pointer;">
            <app-imagelist [imgList]="[itemInfo?.exceptionCertificateSecondFilePath]"> </app-imagelist>
          </div>
          <div *ngIf="itemInfo?.exceptionCertificateThirdFilePath" style="cursor: pointer;">
            <app-imagelist [imgList]="[itemInfo?.exceptionCertificateThirdFilePath]"> </app-imagelist>
          </div>
        </div>
      </se>
      <ng-container *ngIf="itemInfo.replyAppUserName">
        <se label="回复内容" class="mb-sm">
          {{itemInfo.replyContent}}
        </se>
        <se label="回复人" class="mb-sm">
          {{itemInfo.replyAppUserName}}
        </se>
        <se label="回复时间" class="mb-sm">
          {{itemInfo.replyTime}}
        </se>
      </ng-container>

    </div>
  </div>
</ng-template>

<ng-template #replyModal>
  <div nz-row nzGutter="8">
    <div nz-col nzSpan="24" se-container [labelWidth]="110">
      <se [col]="1" label="回复内容" required>
        <textarea nz-input rows="3" placeholder="请填写回复内容" [(ngModel)]="replyContent"
          style="width: 325px; margin-left: 14px"></textarea>
      </se>
    </div>
  </div>
</ng-template>
