<!-- <page-header-wrapper [title]="''"></page-header-wrapper>
<nz-card>
  <div nz-row nzGutter="8">
    <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()">查询</button>
      <button nz-button (click)="resetSF()">重置</button>
      <button nz-button (click)="export()" acl [acl-ability]="['TAX_INVOICE_REPORT-export']">导出</button>
      <button nz-button nzType="link" (click)="expandToggle()">
        {{ !_$expand ? '展开' : '收起' }}
        <i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
      </button>
    </div>
  </div>
</nz-card> -->
<nz-card class="table-box">
  <div class="tab_header">
    <label class="page_title"> <label class="driver">|</label> 发票上传</label>
    <nz-tabset [nzTabBarExtraContent]="extraTemplate">
      <nz-tab *ngFor="let tab of tabs" [nzTitle]="tab.name" (nzSelect)="selectChange(tab)"> </nz-tab>
    </nz-tabset>
  </div>

  <!-- 数据列表 -->
  <st #st [scroll]="{ x: '1200px',y:scrollY }" [data]="service.$api_getInvoiceReport_page" [columns]="columns"
    [req]="{ params: reqParams }" [page]="{  }" [loading]="service.http.loading">
    <ng-template st-row="uploadSts" let-item let-index="index">
      <!-- <a (click)="viewAuditResult(item)" *ngIf="item?.billStatus === '2'">{{item?.billStatusLabel}}</a> -->
      <span *ngIf="item?.uploadSts == '1'">待上传</span>
      <span *ngIf="item?.uploadSts == '3'">已上传</span>
      <span *ngIf="item?.uploadSts == '2'">上传中</span>
      <span *ngIf="item?.uploadSts == '4'" style="color: red">上传异常</span>
      <!-- <span  *ngIf="item?.uploadSts == '4'" style="color: red;" (click)="unnormal(item)">上传异常</span> -->
    </ng-template>
    <ng-template st-row="invoiceType" let-item let-index="index">
      <span>增值税专用发票</span>
    </ng-template>
    <ng-template st-row="sts" let-item let-index="index">
      <span *ngIf="item.sts === '1'">有效</span>
      <span *ngIf="item.sts === '2'">作废</span>
    </ng-template>
    <ng-template st-row="orderAmount" let-item let-index="index">
      <div class="text-right">{{ item?.orderAmount | currency }}</div>
    </ng-template>
  </st>
</nz-card>

<ng-template #extraTemplate>
  <div class="d-flex align-items-center mr-sm">
    <div class="mr-md">
      已选择
      <strong class="text-red">{{ selectedRows.length }}</strong> 条数据
    </div>
    <button nz-button nzDanger [nzLoading]="isLoading && st.loading" acl [acl-ability]="['TAX-ORDERREPORT-search']"
      (click)="openDrawer()">筛选</button>
    <button nz-button nzDanger acl [acl-ability]="['TAX_INVOICE_REPORT-export']"> 导出</button>
    <button nz-button *ngIf="selectedIndex && selectedIndex !== '2'" nz-dropdown [nzDropdownMenu]="menu"
      nzPlacement="bottomLeft">
      更多<i nz-icon nzType="down" nzTheme="outline"></i></button>
    <nz-dropdown-menu #menu="nzDropdownMenu">
      <ul nz-menu>
        <li nz-menu-item *ngIf="selectedIndex === '1' || selectedIndex === '4'" (click)="upload()" acl
          [acl-ability]="['TAX_INVOICE_REPORT-upload']">
          上传
        </li>
        <li nz-menu-item *ngIf="selectedIndex === '3'" (click)="recall()" acl
          [acl-ability]="['TAX_INVOICE_REPORT-recall']">
          撤回
        </li>
      </ul>
    </nz-dropdown-menu>
  </div>
</ng-template>