<!--
 * @Description  : 
 * @Version      : 1.0
 * @Author       : Shiming
 * @Date         : 2022-01-12 13:35:56
 * @LastEditors  : Shiming
 * @LastEditTime : 2022-02-28 14:17:40
 * @FilePath     : \\tms-obc-web\\src\\app\\routes\\usercenter\\components\\driver\\driver.component.html
 * Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<!-- 页头 -->
<page-header-wrapper [title]="'司机列表'"></page-header-wrapper>
<nz-card>
  <!-- 搜索表单 -->
  <div nz-row nzGutter="8">
    <div nz-col [nzXl]="_$expand ? 24 : 18" [nzLg]="24" [nzSm]="24" [nzXs]="24">
      <sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
    </div>
    <div nz-col [nzXl]="_$expand ? 24 : 6" [nzLg]="24" [nzSm]="24" [nzXs]="24" class="text-right"
      [class.expend-options]="_$expand">
      <button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)"  acl  [acl-ability]="['USERCENTER-DRIVER-LIST-list']">查询</button>
      <button nz-button nzType="primary" (click)="exportList()" [disabled]="false" acl  [acl-ability]="['USERCENTER-DRIVER-LIST-export']">导出</button>
      <button nz-button (click)="resetSF()" [disabled]="false">重置</button>
      <button nz-button nzType="link" (click)="expandToggle()">
        {{ !_$expand ? '展开' : '收起' }}
        <i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
      </button>
    </div>
  </div>
</nz-card>
<nz-card class="content-box">
  <nz-tabset [nzSelectedIndex]="1"  [nzTabBarExtraContent]="extraTemplate">
    <nz-tab nzTitle="全部" (nzClick)="selectChange(null)"></nz-tab>
    <nz-tab nzTitle="待审核" (nzClick)="selectChange(10)"></nz-tab>
    <nz-tab nzTitle="已审核" (nzClick)="selectChange(20)"></nz-tab>
  </nz-tabset>

  <!-- 数据列表 -->
  <st #st [columns]="columns" [scroll]="{x: '1200px'}" [data]='service.$api_get_driver_list'
    [req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
    [res]="{ reName: { list: 'data.records', total: 'data.total' } }"
    [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
    [loading]="service.http.loading">
    <ng-template st-row="promotersTelephone" let-item let-index="index">
      <a (click)="addPromoter(item)"  acl  [acl-ability]="['USERCENTER-DRIVER-LIST-promoter']">{{ item.promotersTelephone || '添加' }}</a>
    </ng-template>
    <ng-template st-row="carNo" let-item let-index="index">
      <a (click)="viewCar(item)" >{{ item?.carNo  }}</a>
    </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>
<ng-template #extraTemplate>
  <div>
    <button nz-button nzType="primary" (click)="add()">添加司机</button>
  </div>
</ng-template>