<!-- 页头 -->
<page-header-wrapper [title]="'企业列表'"></page-header-wrapper>
<nz-card>
  <!-- 搜索区 -->
  <!-- 搜索表单 -->
  <div nz-row nzGutter="8">
    <div nz-col [nzXl]="_$expand ? 24 : 16" [nzLg]="24" [nzSm]="24" [nzXs]="24">
      <sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
    </div>
    <div nz-col [nzXl]="_$expand ? 24 : 8" [nzLg]="24" [nzSm]="24" [nzXs]="24" class="text-right">
      <button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="creat()">新增企业</button>
      <button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="exportList()">导出</button>
      <button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="service.http.loading"
        (click)="st?.load(1)">查询</button>
      <button nz-button (click)="resetSF()">重置</button>
      <button nz-button nzType="link" (click)="expandToggle()">
        {{ !_$expand ? '展开' : '收起' }}
        <i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
      </button>
    </div>
  </div>
</nz-card>
<nz-card>
  <!-- 数据列表 -->
  <!-- [data]="service.$api_get_supplier_page" -->

  <st #st [columns]="columns" [data]='service.$api_get_freight_list'
    [req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
    [res]="{ reName: { list: 'data.records', total: 'data.total' }, process: dataProcess }"
    [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }" [loadingDelay]="500"
    [loading]="service.http.loading">
    <ng-template st-row="enterpriseName" let-item let-index="index">
      <div nz-tooltip [nzTooltipTitle]="item.enterpriseName">
        <div
          style="display: inline-block; max-width: 280px; margin: 0 auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis">
          {{ item.enterpriseName }}
        </div>
      </div>
    </ng-template>
    <ng-template st-row="promotersTelephone" let-item let-index="index">
      <a (click)="addPromoter(item)">{{ item.promotersTelephone || '添加' }}</a>
    </ng-template>
    <ng-template st-row="stateCol" let-item let-index="index">
      <nz-tag *ngIf="item.stateLocked" nzColor="error">冻结</nz-tag>
      <nz-tag *elseBlock nzColor="success">正常</nz-tag>
    </ng-template>
  </st>
</nz-card>

<ng-template #promoterModal>
  <div nz-row nzGutter="8">
    <div nz-col nzSpan="24" se-container [labelWidth]="80">
      <se [col]="1" label="手机号">
        <input nz-input [(ngModel)]="promotersTelephone" maxlength="11" required/>
      </se>
    </div>
  </div>
</ng-template>