<!--
 * @Description  : 
 * @Version      : 1.0
 * @Author       : Shiming
 * @Date         : 2022-01-12 10:52:50
 * @LastEditors  : Shiming
 * @LastEditTime : 2022-02-11 15:08:47
 * @FilePath     : \\tms-obc-web\\src\\app\\routes\\usercenter\\components\\freight\\list\\list.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 : 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"
      [class.expend-options]="_$expand">
      <button nz-button nzType="primary" (click)="creat()" acl
        [acl-ability]="['USERCENTER-FREIGHT-LIST-save']">新增企业</button>
      <button nz-button nzType="primary" [nzLoading]="loadingList" (click)="st?.load(1)" acl
        [acl-ability]="['USERCENTER-FREIGHT-LIST-list']">查询</button>
      <button nz-button nzType="primary" [disabled]="loadingList" (click)="exportList()" acl
        [acl-ability]="['USERCENTER-FREIGHT-LIST-export']">导出</button>
      <button nz-button (click)="resetSF()" [disabled]="loadingList">重置</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]="{  process: beforeReq }"
    [res]="{  process: dataProcess }" [scroll]="{ x: '1200px' }" [page]=" {}" [loading]="loadingList">
    <ng-template st-row="enterpriseName" let-item let-index="index">
      <label>{{ item.enterpriseName }}</label><br>
      <ng-container *ngIf="item.score!==null; else billEvaluateelseTemplate">
        <nz-rate [ngModel]="item.score" nzDisabled></nz-rate>
      </ng-container>
      <ng-template #billEvaluateelseTemplate>
        <p>暂无评价</p>
      </ng-template>
    </ng-template>
    <ng-template st-row="unifiedSocialCreditCode" let-item let-index="index">
      <label [ngStyle]="{'color': item.isExpired?'#ff4d4f':''}">{{ item.unifiedSocialCreditCode }}</label><br>
      <ng-container *ngIf="item.isExpired">
        <nz-tag nzColor="#ff4d4f">已过期</nz-tag>
      </ng-container>
    </ng-template>
    <ng-template st-row="contacter" let-item let-index="index">
      {{ item.contacter }}<br>/{{item.mobile}}
    </ng-template>
    <ng-template st-row="promotersTelephone" let-item let-index="index">
      <a acl [acl-ability]="['USERCENTER-FREIGHT-LIST-salesman']" (click)="addPromoter(item)">{{ item.promotersTelephone
        || '添加' }}</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>