<!-- 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)" [nzLayout]="'vertical'" >
      <div nz-row [nzGutter]="24">

        <div nz-col nzSpan="6">
          <nz-form-item>
            <nz-form-label>商户号</nz-form-label>
            <nz-form-control>
              <nz-select nzShowSearch formControlName="merNo" [nzDropdownMatchSelectWidth]="false">
                <nz-option *ngFor="let item of merArray" nzLabel="（{{item.merNo}}）{{item.merName}}" nzValue="{{item.merNo}}"></nz-option>
              </nz-select>
            </nz-form-control>
          </nz-form-item>
        </div>

        <div nz-col [nzSpan]="16">
          <nz-form-item>
            <nz-form-label>分账时间</nz-form-label>
            <nz-form-control>
              <nz-range-picker formControlName="createTimeArray" nzShowTime [nzAllowClear]="false" [nzFormat]="'yyyy/MM/dd HH:mm:ss'"></nz-range-picker>
              <nz-radio-group nzButtonStyle="solid" formControlName="createTimeSelect" (ngModelChange)="createTimeInit()">
                <label nz-radio-button *ngFor="let item of dateTypeSelect" nzValue="{{item.value}}">{{item.name}}</label>
              </nz-radio-group>
            </nz-form-control>
          </nz-form-item>
        </div>

        <div nz-col nzSpan="6">
          <nz-form-item>
            <nz-form-label>分账流水号</nz-form-label>
            <nz-form-control>
              <input nz-input formControlName="profitSharingOrderNo" placeholder="请输入" />
            </nz-form-control>
          </nz-form-item>
        </div>

        <div nz-col nzSpan="6">
          <nz-form-item>
            <nz-form-label>平台流水号</nz-form-label>
            <nz-form-control>
              <input nz-input formControlName="platformProfitSharingOrderNo" placeholder="请输入" />
            </nz-form-control>
          </nz-form-item>
        </div>

        <div nz-col nzSpan="6">
          <nz-form-item>
            <nz-form-label>接收方号</nz-form-label>
            <nz-form-control>
              <input nz-input formControlName="receiverNo" placeholder="请输入" />
            </nz-form-control>
          </nz-form-item>
        </div>

        <div nz-col nzSpan="6">
          <nz-form-item>
            <nz-form-label>分账类型</nz-form-label>
            <nz-form-control>
              <nz-select nzShowSearch formControlName="cmdType" [nzDropdownMatchSelectWidth]="false">
                <nz-option nzLabel="全部" nzValue=""></nz-option>
                <nz-option nzLabel="分账" nzValue="1"></nz-option>
                <nz-option nzLabel="分账撤销" nzValue="2"></nz-option>
                <nz-option nzLabel="分账回退" nzValue="3"></nz-option>
              </nz-select>
            </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>
          <button nz-button [nzType]="'primary'" (click)="download()">导出数据</button>
        </div>
      </div>
    </form>
  </div>

  <div class="inner-content">
    <!--数组表格 -->
    <nz-table #basicTable
              nzBordered
              nzShowSizeChanger
              nzSize="small"
              [nzShowTotal]="totalTemplate"
              [nzFrontPagination]="false"
              [nzData]="tableData.list"
              [nzTotal]="tableData.total"
              [nzLoading]="tableLoading"
              (nzPageIndexChange)="requestData($event, pageSize)"
              (nzPageSizeChange)="requestData(pageNum, $event)"
              [nzScroll]="{ x: '1500px'}">
      <thead>
      <tr>
        <th nzWidth="110px">商户号</th>
        <th nzWidth="130px">商户名称</th>
        <th nzWidth="150px">分账流水号</th>
        <th nzWidth="150px">平台流水号</th>
        <th nzWidth="100px">分账时间</th>
        <th nzWidth="50px">分账类型</th>
        <th nzWidth="110px">分账接收号</th>
        <th nzWidth="130px">分账接收名称</th>
        <th nzWidth="80px">分账金额（元）</th>
      </tr>
      </thead>
      <tbody>
      <tr *ngFor="let data of basicTable.data;let i = index">
        <td>{{data.merNo}}</td>
        <td nzEllipsis>{{data.merName}}</td>
        <td>{{data.profitSharingOrderNo}}</td>
        <td>{{data.platformProfitSharingOrderNo}}</td>
        <td>{{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td>
        <td>{{data.cmdType | tradeSharingCmdType}}</td>
        <td>{{data.receiverNo}}</td>
        <td nzEllipsis>{{data.receiverName}}</td>
        <td>{{data.receiverAmount}}</td>
      </tr>
      </tbody>
      <ng-template #totalTemplate let-total>总计 {{ total }} 条</ng-template>
    </nz-table>
  </div>
</nz-spin>
