<!--
 * @Description  : 
 * @Version      : 1.0
 * @Author       : Shiming
 * @Date         : 2021-12-21 10:57:48
 * @LastEditors  : Shiming
 * @LastEditTime : 2022-01-18 17:27:26
 * @FilePath     : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\addmodal\\addmodal.component.html
 * Copyright (C) 2022 huzhenhong. All rights reserved.
-->

<div class="modal-header">
  <div class="modal-title">添加熟车</div>
</div>
<div>
  <!-- 搜索表单 -->
  <div nz-row nzGutter="8">
    <!-- 查询字段小于或等于3个时，不显示伸缩按钮 -->
    <div nz-col nzSpan="24" *ngIf="queryFieldCount <= 4">
      <sf
        #sf
        [schema]="schema"
        [ui]="ui"
        [mode]="'search'"
        [disabled]="!sf?.valid"
        [loading]="false"
        (formSubmit)="initData(true)"
        (formReset)="resetSF()"
      ></sf>
    </div>

    <!-- 查询字段大于3个时，根据展开状态调整布局 -->
    <ng-container *ngIf="queryFieldCount > 4">
      <div nz-col [nzSpan]="_$expand ? 24 : 18">
        <sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
      </div>
      <div nz-col [nzSpan]="_$expand ? 24 : 6" [class.text-right]="_$expand">
        <button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="isLoading && st.loading" (click)="initData(true)">查询</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>
    </ng-container>
  </div>
  <!-- 数据列表 -->
  <!-- [data]="service.$api_getCarCaptainByMobile" -->
  <div *ngIf="sf?.value?.mobile && tableData?.length > 0">
    <st
      #st
      multiSort
      bordered
      [columns]="columns"
      [ps]="20"
      [req]="{ method: 'POST', allInBody: true, reName: { pi: '', ps: '' }, params: reqParams }"
      [res]="{ reName: { list: 'data', total: 'data.total' } }"
      [page]="{ show: true, showSize: true, pageSizes: [20, 50, 100] }"
      [loading]="false"
      [data]="tableData"
    >
      <ng-template st-row="certificationStatus" let-item let-index="index">
        <div *ngIf="item.certificationStatus === -1">
          <span class="ng-tns-c230-1239 ant-badge-status-dot ant-badge-status-processing ng-star-inserted"></span> 未认证
        </div>
        <div *ngIf="item.certificationStatus === 0">
          <span class="ng-tns-c230-1239 ant-badge-status-dot ant-badge-status-processing ng-star-inserted"></span> 待审核
        </div>
        <div *ngIf="item.certificationStatus === 1">
          <span class="ng-tns-c230-1239 ant-badge-status-dot ant-badge-status-success ng-star-inserted"></span> 已成功
        </div>
        <div *ngIf="item.certificationStatus === 2">
          <span class="ng-tns-c230-1240 ant-badge-status-dot ant-badge-status-warning ng-star-inserted"></span> 已驳回
        </div>
      </ng-template>
      <ng-template st-row="carModel" let-item let-index="index">
        <span>{{ item.carModelLabel }}-{{ item.carLengthLabel }}米-{{ item.carLoad }}吨</span>
      </ng-template>
    </st>
  </div>

  <div class="noContent" *ngIf="sf?.value?.mobile && tableData?.length === 0 && flag">
    抱歉，该手机号还未注册，仍然需要添加请点击 <span (click)="addModal()">继续添加 </span>
  </div>
</div>
<div class="modal-footer">
  <button nz-button type="button" (click)="close()">关闭</button>
</div>
