<!-- 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" >
          <nz-form-item>
            <nz-form-label [nzSpan]="8">商户号</nz-form-label>
            <nz-form-control [nzSpan]="14">
              <input nz-input formControlName="merNo" />
            </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="merName" />
            </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="merAbbreviate" />
            </nz-form-control>
          </nz-form-item>
        </div>


      </div>
      <div nz-row *ngIf="selectedIndex==1">
        <div nz-col nzSpan="8">
          <nz-form-item>
            <nz-form-label [nzSpan]="8">状态</nz-form-label>
            <nz-form-control [nzSpan]="14">
              <nz-select nzAllowClear formControlName="status">
                <!-- <nz-option nzLabel="不可用" nzValue="0"></nz-option> -->
                <nz-option nzLabel="正常" nzValue="1"></nz-option>
                <nz-option nzLabel="冻结" nzValue="2"></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>
        </div>
      </div>
    </form>
  </div>

  <nz-tabset class="inner-content" [(nzSelectedIndex)]="selectedIndex"  (nzSelectChange)="nzSelectChange([$event])">
    <nz-tab nzTitle="未参与" >
      <div class="mart10">
        <div class="operating-button">
          <nz-badge [nzCount]="setOfCheckedId.size">
            <button nz-button nzType="primary" [disabled]="setOfCheckedId.size === 0"  (click)="attendConfirm()">
              添加
            </button>
          </nz-badge>
        </div>
        <span>共计 {{dataObject.total?dataObject.total:0}} 条数据</span>
        <nz-table
          #rowSelectionTable
          [nzData]="dataObject.list"
          [nzTotal]="dataObject.total"
          [nzFrontPagination]="false"
          [nzLoading]="tableLoading"
          [nzPageIndex]="whereObject.pageNum"
          [nzPageSize]="whereObject.pageSize"
          (nzPageIndexChange)="requestqueryNotPartMerList($event)"

        >
          <thead>
          <tr>
            <th [nzChecked]="checked" [nzShowCheckbox]="true" (nzCheckedChange)="onAllChecked($event)"></th>
            <th >商户号</th>
            <th>商户名称</th>
            <th >商户简称</th>
          </tr>
          </thead>
          <tbody>

          <tr *ngFor="let data of rowSelectionTable.data;let i = index">
            <td
              [nzChecked]="setOfCheckedId.has(data.merNo)"
              (nzCheckedChange)="onItemChecked(data.merNo, $event)"
            ></td>
            <td>{{data.merNo}}</td>
            <td>{{data.merName}}</td>
            <td>{{data.merAbbreviate}}</td>
          </tr>
          </tbody>
        </nz-table>
      </div>
    </nz-tab>
    <nz-tab nzTitle="已参与">
      <div class="mart10">
        <span>共计 {{dataObject.total?dataObject.total:0}} 条数据</span>

        <nz-table #basicTable
                  [nzData]="dataObject.list"
                  [nzTotal]="dataObject.total"
                  [nzFrontPagination]="false"
                  [nzLoading]="tableLoading"
                  [nzPageIndex]="whereObject.pageNum"
                  [nzPageSize]="whereObject.pageSize"
                  (nzPageIndexChange)="requestqueryPartMerList($event)"
        >
          <thead>
          <tr>
            <th >商户号</th>
            <th >商户名称</th>
            <th >商户简称</th>
            <th >状态</th>
            <th >加入时间</th>
            <th>操作</th>
          </tr>
          </thead>
          <tbody>
          <tr *ngFor="let data of basicTable.data;let i = index">
            <td>{{data.merNo}}</td>
            <td>{{data.merName}}</td>
            <td>{{data.merAbbreviate}}</td>
            <td [class]="data.status==2?'fred':''">{{data.status | allocationStatus}}</td>
            <td >{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>

            <td nzRight="0px" class="table-td-operation">
              <a *ngIf="data.status==1" (click)="forbidden(data.merNo)">禁用</a>
              <a *ngIf="data.status==2" (click)="enable(data.merNo)">启用</a>
            </td>

          </tr>
          </tbody>
        </nz-table>


      </div>
    </nz-tab>

  </nz-tabset>
</nz-spin>
