<!-- 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 nz-col nzSpan="8" *ngIf="roleType == 5 && adminFlag == 1">
                    <nz-form-item>
                        <nz-form-label [nzSpan]="8">部门</nz-form-label>
                        <nz-form-control [nzSpan]="14">
                            <nz-select nzShowSearch nzAllowClear formControlName="orgId">
                                <nz-option *ngFor="let item of orgArray" nzLabel="{{item.name}}" nzValue="{{item.id}}"></nz-option>
                            </nz-select>
                        </nz-form-control>
                    </nz-form-item>
                </div>

                <div nz-col nzSpan="8" *ngIf="this.cardNo == null">
                    <nz-form-item>
                        <nz-form-label [nzSpan]="8">油卡卡号</nz-form-label>
                        <nz-form-control [nzSpan]="14">
                            <input nz-input formControlName="cardNo" />
                        </nz-form-control>
                    </nz-form-item>
                </div>

                <div nz-col nzSpan="8">
                    <nz-form-item>
                        <nz-form-label [nzSpan]="8">加油站</nz-form-label>
                        <nz-form-control [nzSpan]="14">
                            <input nz-input formControlName="goodsName" />
                        </nz-form-control>
                    </nz-form-item>
                </div>

                <div nz-col nzSpan="8">
                    <nz-form-item>
                        <nz-form-label [nzSpan]="8">订单状态</nz-form-label>
                        <nz-form-control [nzSpan]="14">
                            <nz-select nzShowSearch nzAllowClear formControlName="status">
                                <nz-option nzLabel="已支付" nzValue="2"></nz-option>
                                <nz-option nzLabel="已完成" nzValue="3"></nz-option>
                                <nz-option nzLabel="已退款" nzValue="4"></nz-option>
                                <nz-option nzLabel="退款中" nzValue="6"></nz-option>
                                <nz-option nzLabel="退款失败" nzValue="7"></nz-option>
                            </nz-select>
                        </nz-form-control>
                    </nz-form-item>
                </div>

                <div nz-col nzSpan="8">
                    <nz-form-item>
                        <nz-form-label [nzSpan]="8">支付时间</nz-form-label>
                        <nz-form-control [nzSpan]="14">
                            <nz-range-picker
                                    formControlName="payTime"
                                    [nzShowTime]="{ nzHideDisabledOptions: true}"
                                    nzFormat="yyyy-MM-dd HH:mm:ss"
                            ></nz-range-picker>
                        </nz-form-control>
                    </nz-form-item>
                </div>

            </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">
        <span>共计 {{dataObject.total?dataObject.total:0}} 条数据</span>
        <div class="operating-button">
            <button nz-button nzType="primary" class="right-btn" (click)="excelCardOrder()"><i nz-icon nzType="import" nzTheme="outline"></i>导出订单</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 *ngIf="roleType == 5 && adminFlag == 1" nzWidth="150px">所属部门</th>
                <th *ngIf="roleType == 5 && adminFlag == 1" nzWidth="120px">用户手机号</th>
                <th nzWidth="160px">油卡卡号</th>
                <th nzWidth="200px">平台订单号</th>
                <th nzWidth="230px">团油订单号</th>
                <th nzWidth="100px">加油金额</th>
                <th nzWidth="100px">优惠金额</th>
                <th nzWidth="100px">实付金额</th>
                <th nzWidth="200px">加油站</th>
                <th nzWidth="70px">油号</th>
                <th nzWidth="80px">油枪号</th>
                <th nzWidth="110px">团油油枪价</th>
                <th nzWidth="120px">平台油枪价格</th>
                <th nzWidth="100px">订单状态</th>
                <th nzWidth="160px">创建时间</th>
                <th nzWidth="160px">支付时间</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 *ngIf="roleType == 5 && adminFlag == 1">{{data.orgName}}</td>
                <td *ngIf="roleType == 5 && adminFlag == 1">{{data.merPhone}}</td>
                <td>{{data.memCardNo}}</td>
                <td>{{data.orderNo}}</td>
                <td>{{data.gasOrderNo}}</td>
                <td>￥{{data.totalPrice}}</td>
                <td>￥{{data.deductionPrice}}</td>
                <td>￥{{data.payRealPrice}}</td>
                <td>{{data.goodsName}}</td>
                <td>{{data.gasOilNo}}</td>
                <td>{{data.gasGunNo}}</td>
                <td>{{data.gasPriceGun}}</td>
                <td>{{data.platformPriceGun}}</td>
                <td>{{data.statusName}}</td>
                <td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
                <td>{{data.payTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
                <td>{{data.refundTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
                <!--                <td nzRight="0px" class="table-td-operation">
                                    <a nz-dropdown [nzDropdownMenu]="menu"> 操作列表 <i nz-icon nzType="down"></i> </a>
                                    <nz-dropdown-menu #menu="nzDropdownMenu">
                                        <ul nz-menu nzSelectable>
                                            <li nz-menu-item><a></a></li>
                                        </ul>
                                    </nz-dropdown-menu>
                                </td>-->
            </tr>
            </tbody>
        </nz-table>
    </div>
</nz-spin>
