<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<!--条件搜索-->

<nz-spin [nzSpinning]="loadingObject.spinning" nzTip="{{loadingObject.msg}}">
    <!--<div class="inner-content">
        <form nz-form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)">
            <div nz-row>

            </div>

            <div nz-row>
                <div nz-col nzSpan="24" class="search-button">
                    <button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>搜索</button>
                    <button nz-button nzType="default" (click)="resetForm()"><i nz-icon nzType="reload" nzTheme="outline"></i>重置</button>
                </div>
            </div>
        </form>
    </div>-->

    <div class="inner-content">
        <div *ngIf="roleType == 5 && adminFlag == 0" style="width: 100%;text-align: center;">
            <nz-row [nzGutter]="16">
                <nz-col [nzSpan]="24">
                    <nz-statistic [nzValue]="'￥' + accountObject['amounts']" [nzTitle]="'账户余额'"></nz-statistic>
                </nz-col>
            </nz-row>
        </div>
        <span>共计 {{dataObject.total?dataObject.total:0}} 条数据</span>
        <div class="operating-button">
<!--            <button nz-button nzType="primary" class="right-btn" >充值金额</button>-->
        </div>

        <!--数组表格 -->
        <nz-table #basicTable
                  [nzData]="dataObject.list"
                  [nzTotal]="dataObject.total"
                  [nzFrontPagination]="false"
                  [nzLoading]="tableLoading"
                  [nzPageIndex]="whereObject.pageNum"
                  (nzPageIndexChange)="requestData($event)"
                  [nzScroll]="{ x: '1100px'}">
            <thead>
            <tr>
                <th nzWidth="60px">序号</th>
                <th nzWidth="110px">商户名称</th>
                <th nzWidth="110px">交易类型</th>
                <th nzWidth="110px">交易来源</th>
                <th nzWidth="110px">交易余额</th>
                <th nzWidth="110px">参与营销</th>
                <th nzWidth="110px">营销方式</th>
                <th nzWidth="110px">营销金额</th>
                <th nzWidth="130px">营销交易金额</th>
                <th nzWidth="130px">总交易金额</th>
                <th nzWidth="110px">变更前余额</th>
                <th nzWidth="110px">变更后余额</th>
                <th nzWidth="110px">操作人</th>
                <th nzWidth="160px">生成时间</th>
<!--                <th nzWidth="160px" nzRight="0px">操作</th>-->
            </tr>
            </thead>
            <tbody>
            <tr *ngFor="let data of basicTable.data;let i = index">
                <td>{{i+1}}</td>
                <td>{{data.merName}}</td>
                <td>{{data.type == 1?'进账':'出账'}}</td>
                <td>{{data.sourceType == 1?'金额充值':'未知'}}</td>
                <td>￥{{data.amount}}</td>
                <td>{{data.marketingStatus == 1?'是':'否'}}</td>
                <td>
                    <span *ngIf="data.marketingType == null">无</span>
                    <span *ngIf="data.marketingType == 1">赠送金额</span>
                    <span *ngIf="data.marketingType == 2">充值返点</span>
                </td>
                <td>
                    <span *ngIf="data.marketingType == null">无</span>
                    <span *ngIf="data.marketingType == 1">{{'￥' + data.marketingPrice}}</span>
                    <span *ngIf="data.marketingType == 2">{{(data.marketingPrice * 100) + '%'}}</span>
                </td>
                <td>{{data.marketingTradePrice?'￥'+data.marketingTradePrice:'无'}}</td>
                <td>￥{{data.tradePrice}}</td>
                <td>￥{{data.beforeAmount}}</td>
                <td>￥{{data.afterAmount}}</td>
                <td>{{data.opUserName}}</td>
                <td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<!--                <td nzRight="0px" class="table-td-operation">
                    <a (click)="showRechargeModal(data.cardNo)"> 充值 </a>
                    <a nz-dropdown [nzDropdownMenu]="menu"> 操作列表 <i nz-icon nzType="down"></i> </a>
                    <nz-dropdown-menu #menu="nzDropdownMenu">
                        <ul nz-menu nzSelectable>
                        </ul>
                    </nz-dropdown-menu>
                </td>-->
            </tr>
            </tbody>
        </nz-table>
    </div>
</nz-spin>



<nz-modal [(nzVisible)]="rechargeModal" nzTitle="余额充值" (nzOnCancel)="closeRechargeModal()" nzWidth="500px" [nzFooter]="null">
    <form nz-form [formGroup]="rechargeForm">
        <nz-form-item>
            <nz-form-label [nzSpan]="6" nzRequired >当前余额</nz-form-label>
            <nz-form-control [nzSpan]="14">
                <nz-input-number style="width: 100%" formControlName="amount"></nz-input-number>
            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label [nzSpan]="6" nzRequired >充值金额</nz-form-label>
            <nz-form-control [nzSpan]="14">
                <nz-input-number style="width: 100%" formControlName="amount" [nzMin]="0.01" [nzMax]="9999999" [nzStep]="1" [nzPrecision]="2"></nz-input-number>
            </nz-form-control>
        </nz-form-item>
        <div style="text-align: center;">
            <button nz-button nzType="primary" style="width: 150px;" (click)="submitRecharge()">确定</button>
        </div>
    </form>
</nz-modal>
