<!--
 * @Description  : 
 * @Version      : 1.0
 * @Author       : Shiming
 * @Date         : 2022-03-21 14:19:21
 * @LastEditors  : Shiming
 * @LastEditTime : 2022-03-21 15:03:40
 * @FilePath     : \\tms-obc-web\\src\\app\\routes\\financial-management\\components\\payment-record\\payment-record.component.html
 * Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<page-header-wrapper [title]="'支付记录'">
</page-header-wrapper>

<nz-card class="search-box" nzBordered>
    <div nz-row nzGutter="8">
        <div nz-col [nzXl]="_$expand ? 24 : 18" [nzLg]="24" [nzSm]="24" [nzXs]="24">
            <sf #sf [schema]="searchSchema"
                [ui]="{ '*': { spanLabelFixed: 110,grid: { lg: 8, md: 12, sm: 12, xs: 24,gutter:15 } }}"
                [compact]="true" [button]="'none'"></sf>
        </div>
        <div nz-col [nzXl]="_$expand ? 24 : 6" [nzLg]="24" [nzSm]="24" [nzXs]="24" [class.expend-options]="_$expand"
            class="text-right">
            <button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
            <button nz-button (click)="resetSF()">重置</button>
            <button nz-button (click)="exprot()"> 导出</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="content-box" nzBordered>

    <nz-tabset>
        <nz-tab nzTitle="全部" (nzClick)="changePaymentStatus()"></nz-tab>
        <nz-tab nzTitle="支付中" (nzClick)="changePaymentStatus('4')"></nz-tab>
        <nz-tab nzTitle="已支付" (nzClick)="changePaymentStatus('2')"></nz-tab>
        <nz-tab nzTitle="支付失败" (nzClick)="changePaymentStatus('5')"></nz-tab>
    </nz-tabset>

    <st #st [data]="service.$api_get_order_payment_page" [columns]="columns" [req]="{   process: beforeReq }" [page]="{}"
        [loading]="false" [scroll]="{ x:'1200px' }">
        <ng-template st-row="orderPaymentCode" let-item let-index="index" let-column="column">
            {{ item?.orderPaymentCode }} <br> <a>{{ item?.paymentStatusLabel }}</a>
        </ng-template>
        <ng-template st-row="amountDetails" let-item let-index="index" let-column="column">
            <ng-container *ngFor="let detail of item?.amountDetails">
                {{detail.costName}}:{{ detail.price | currency }}<br />
            </ng-container>
        </ng-template>
        <ng-template st-row="billCode" let-item let-index="index" let-column="column">
            {{ item?.billCode }} <br> {{item?.billStatusLabel }}
        </ng-template>
        <ng-template st-row="wayBillCode" let-item let-index="index" let-column="column">
            {{ item?.wayBillCode }} <br> {{item?.wayBillStatusLabel }}
        </ng-template>
        <ng-template st-row="driverId" let-item let-index="index" let-column="column">
            {{ item?.driverName }} <br> {{ item?.driverTelephone }} {{ item?.driverLicencePlate }}
        </ng-template>
        <ng-template st-row="captainName" let-item let-index="index" let-column="column">
            {{ item?.captainName }} <br> {{ item?.captainTelephone }}
        </ng-template>
    </st>
</nz-card>