billCode<!--
 * @Description  : 
 * @Version      : 1.0
 * @Author       : Shiming
 * @Date         : 2022-01-12 10:52:50
 * @LastEditors  : Shiming
 * @LastEditTime : 2022-04-06 11:06:05
 * @FilePath     : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\receipts-audit\\receipts-audit.component.html
 * Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<!-- 搜索表单 -->
<page-header-wrapper [title]="''"> </page-header-wrapper>
<nz-card>
  <div nz-row nzGutter="8">
    <!-- 查询字段小于或等于3个时，不显示伸缩按钮 -->
    <div nz-col nzSpan="24" *ngIf="queryFieldCount <= 4">
      <sf
        #sf
        [schema]="schema"
        [ui]="ui"
        [mode]="'search'"
        [disabled]="!sf?.valid"
        [loading]="false"
        (formSubmit)="st?.load(1)"
        (formReset)="resetSF()"
      ></sf>
    </div>

    <!-- 查询字段大于3个时，根据展开状态调整布局 -->
    <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" [nzLoading]="service.http.loading" (click)="search()" acl [acl-ability]="['ORDER-RECEIPTS-search']"
          >查询</button
        >
        <button nz-button nzType="primary" [disabled]="false" (click)="exprot()">导出</button>
        <button nz-button [disabled]="false" (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>
  <nz-tabset (nzSelectedIndexChange)="selectChange($event)" [nzTabBarExtraContent]="extraTemplate">
    <nz-tab [nzTitle]="'全部(' + tabs?.totalCount + ')'"></nz-tab>
    <nz-tab [nzTitle]="'待审核(' + tabs?.receivedQuantity + ')'"></nz-tab>
    <nz-tab [nzTitle]="'已审核(' + tabs?.stayQuantity + ')'"></nz-tab>
  </nz-tabset>
  <div style="margin-top: 15px">
    <st
      #st
      [bordered]="true"
      [scroll]="{ x: '2000px' }"
      [data]="service.$api_get_billExamine_page"
      [columns]="columns"
      [req]="{  process: beforeReq }"
      [res]="{ reName: { list: 'data.records', total: 'data.total' } , process: afterRes}"
      [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
      [loading]="false"
    >
      <ng-template st-row="freightPrice" let-item let-index="index">
        {{ item.freightPrice | currency }}
      </ng-template>
      <ng-template st-row="loadingLadingBillFilePath" let-item let-index="index">
        <div class="imgBox">
          <div *ngIf="item.loadingLadingBillFilePath">
            <app-imagelist style="width: 40px" [imgList]="[item.loadingLadingBillFilePath]"> </app-imagelist>
          </div>
          <div *ngIf="item.loadingPeopleVehiclesGoodsFilePath">
            <app-imagelist style="width: 40px" [imgList]="[item.loadingPeopleVehiclesGoodsFilePath]"> </app-imagelist>
          </div>
        </div>
      </ng-template>
      <ng-template st-row="unloadingLadingBillFilePath" let-item let-index="index">
        <div class="imgBox">
        <div *ngIf="item.unloadingLadingBillFilePath">
          <app-imagelist style="width: 40px" [imgList]="[item.unloadingLadingBillFilePath]"> </app-imagelist>
        </div>
        <div *ngIf="item.unloadingPeopleVehiclesGoodsFilePath">
          <app-imagelist style="width: 40px" [imgList]="[item.unloadingPeopleVehiclesGoodsFilePath]"> </app-imagelist>
        </div>
        </div>
      </ng-template>
      <ng-template st-row="loadingTime" let-item let-index="index">
        <div *ngIf="item?.loadingTime">装 | {{ item?.loadingTime }}</div>
        <div *ngIf="item?.unloadingTime">卸 | {{ item?.unloadingTime }}</div>
      </ng-template>
      <ng-template st-row="driverName" let-item let-index="index">
        <div> {{ item?.driverName }}{{ item?.driverPhone ? "/" + item?.driverPhone : ''}}{{  item?.carNo ? "/" + item?.carNo : '' }} </div>
      </ng-template>
      <ng-template st-row="payeeName" let-item let-index="index">
        <div> {{ item?.payeeName }}{{item?.payeePhone ? "/" + item?.payeePhone : '' }} </div>
      </ng-template>
      <ng-template st-row="billCode" let-item let-index="index">
        <!-- <div>{{ item.billCode }}</div> -->
        <a *ngIf="item.resourceType == '1'" [routerLink]="'/order-management/vehicle/vehicle-detail/' + item.id">{{ item.billCode }}</a>
        <a *ngIf="item.resourceType == '2'"  [routerLink]="'/order-management/bulk/bulk-detail/' + item.id">{{ item.billCode }}</a>
        <a *ngIf="item.resourceType == '3'"  [routerLink]="'/order-management/vehicle/vehicle-detail/' + item.id">{{ item.billCode }}</a>
        <div>
          <span>{{item?.billStatusLabel}}</span>
        </div>
        <div>
          <span >{{item?.resourceTypeLabel}}{{item?.serviceTypeLabel === item?.resourceTypeLabel ? '':item?.serviceTypeLabel}}</span>
        </div>
      </ng-template>
      <ng-template st-row="goodsName" let-item let-index="index">
        <div>{{ item?.goodsName }}</div>
        <div>
          <span>{{ item?.weight ? item?.weight + '吨/' : '' }}</span>
          <span>{{ item?.volume ? item?.volume + '方/' : '' }}</span>
          <span>{{ item?.goodsNumber ? item?.goodsNumber + '件' : '' }}</span>
        </div>
      </ng-template>
      <ng-template st-row="mybidDetailInfo" let-item let-index="index">
        <div *ngIf="item.mybidDetailInfo.length > 0">
          <p *ngFor="let data of item.mybidDetailInfo">
            {{ data.expenseName }}：{{ data.price | currency }}
            <span *ngIf="data.paymentStatusLabel" style="color: #f59a63">{{ data.paymentStatusLabel }}</span>
          </p>
        </div>
      </ng-template>
    </st>
  </div>
</nz-card>

<ng-template #extraTemplate>
  <div>
    <button nz-button nzType="primary" (click)="sign('1')"  acl  [acl-ability]="['ORDER-RECEIPTS-billAuditPassBatch']"> 批量通过 </button>
    <button nz-button nzType="primary" (click)="sign1('1')"  acl  [acl-ability]="['ORDER-RECEIPTS- electronicBilling']"> 批量生成电子单据 </button>
  </div>
</ng-template>
