<!--
 * @Description  : 
 * @Version      : 1.0
 * @Author       : Shiming
 * @Date         : 2021-12-07 15:57:49
 * @LastEditors  : Shiming
 * @LastEditTime : 2022-02-23 20:11:50
 * @FilePath     : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\contract-list\\contract-list.component.html
 * Copyright (C) 2022 huzhenhong. All rights reserved.
-->

<nz-card>
  <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)="st?.load(1)" (formReset)="resetSF()"></sf>
    </div>

    <!-- 查询字段大于3个时，根据展开状态调整布局 -->
    <ng-container>
      <div nz-col [nzSpan]="_$expand ? 24 : 18">
        <sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'">
          <ng-template sf-template="signTime" let-me let-ui="ui" let-schema="schema">
            <!-- <input placeholder="请输入1-30" type="number" [ngModel]="sf.value.description3" style="width: 200px;" nz-input />
              <span> 天内支付运费</span> -->
            <nz-range-picker [nzShowTime]="true" [(ngModel)]="sf.value.signTime"></nz-range-picker>
          </ng-template>
        </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)="st?.load(1)" acl [acl-ability]="['CONTRACT-INDEX-searchDetail']">查询</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>
</nz-card>

<nz-card class="content-box" nzBordered>
  <div style="position: relative">
    <nz-alert nzType="info" [nzMessage]="'当前共' + st?.total + '行记录，已选择' + selectedRows.length + '项'" nzShowIcon
      [ngStyle]="{ margin: '0 0 1rem 0' }">
    </nz-alert>
  </div>

  <st #st [data]="service.$api_listDetailed_page" [columns]="columns" [req]="{  params: reqParams }" [loading]="false"
    [scroll]="{ x: '1200px', y: '370px' }" (change)="stChange($event)">
    <ng-template st-row="contractCode" let-item let-index="index">
      <a (click)="service.openURL(item?.contractFilePath)">{{ item?.contractCode }}</a>
      <!-- <a [routerLink]="'/contract-management/index/detail/' + item.id">{{ item?.contractCode }}</a> -->
    </ng-template>
    <ng-template st-row="signingObject" let-item let-index="index">
      <span *ngIf="item.signingObject == 0"></span>
      <span></span>
    </ng-template>
  </st>
</nz-card>

<ng-template #auditModal>
  <div nz-row nzGutter="8">
    <div nz-col nzSpan="24" se-container [labelWidth]="80">
      <se [col]="1" label="备注">
        <textarea nz-input rows="3" placeholder="同意可以不用填写原因 ，拒绝必须说明原因"
          style="width: 325px; margin-left: 14px"></textarea>
      </se>
    </div>
  </div>
</ng-template>