<!--
 * @Author: your name
 * @Date: 2021-12-03 15:31:52
 * @LastEditTime: 2021-12-20 15:07:51
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \tms-obc-web\src\app\routes\order-management\components\vehicle-detail\vehicle-detail.component.html
-->
<page-header-wrapper [title]="''" [logo]="logo">
  <ng-template #logo>
    <button nz-button nz-tooltip nzTooltipTitle="返回上一页" (click)="goBack()">
      <i nz-icon nzType="left" nzTheme="outline"></i>
    </button>
  </ng-template>
</page-header-wrapper>
<nz-card>
  <div nz-row>
    <div nz-col nzSpan="4">
      <sv-container class="bdr">
        <sv label="订单号" col="1">{{ i?.no }}</sv>
        <sv-title class="text-center text-lg" style="font-weight: 700;">{{i?.wayBillStatusLabel}}</sv-title>
        <sv-title>
          <div style="display: flex; justify-content: center;">
            <a class="btn-size" (click)="hand()">指派车队长</a>
          </div>
        </sv-title>
      </sv-container>
    </div>
    <div nz-col nzSpan="16" class="approval-status">
      <nz-steps style="width: 80%; margin: 0 auto" [nzLabelPlacement]="'vertical'">
        <nz-step nzStatus="finish" nzIcon="user" [nzDescription]="i?.createAt" nzTitle="下单"></nz-step>
        <nz-step nzStatus="finish" nzIcon="solution" nzTitle="完结"></nz-step>
      </nz-steps>
    </div>
  </div>
  <nz-divider></nz-divider>
  <div sv-container *ngIf="i">
    <sv label="项目名称">{{ i?.enterpriseProject }}</sv>
    <sv label="调度员">{{ i?.dispatch?.name }}/{{i?.dispatch?.phone}}</sv>
    <sv label="承诺付款时间">到货后{{ i?.paymentDays }}天内支付运费</sv>
    <sv label="服务类型">{{ i?.serviceTypeLabel }}</sv>
  </div>
  <nz-divider></nz-divider>
  <div nz-row>
    <div nz-col nzSpan="6">
      <div *ngFor="let item of unLoadingPlaceVOList; let ii = index">
        <h3 *ngIf="ii === 0" style="font-weight: 700;">装卸货信息</h3>
        <div *ngIf="item?.type === 1 || item?.type === '1'">
          <p>装货地：{{item?.detailedAddress}}</p>
           <p>联系人：{{item?.appUserName}}/{{item?.contractTelephone}}</p>
        <p>发货日期：{{item?.createTime}}</p>
        </div>
        <div *ngIf="item.type === 2 || item.type === '2'">
        <p>卸货地：{{item?.detailedAddress}}</p>
        <p>联系人：{{item?.appUserName}}/{{item?.contractTelephone}}</p>
        <p>卸货日期：{{item?.modifyTime}}</p>
      </div>
      </div>
    </div>
    <div nz-col nzSpan="5">
      <div class="source-info bdr bdl pl-md">
        <h3>货物信息</h3>
        <div *ngFor="let item of i?.goodsInfos; let i = index">
          <p>货物名称：{{item?.goodsName}}</p>
          <p>重量/体积：{{item?.weight}}吨/{{item?.volume}}立方</p>
          <p>用车需求：{{item?.vehicleDemand}}</p>
          </div>
      </div>
    </div>
    <div nz-col nzSpan="5">
      <div class="source-info bdr bdl pl-md">
        <h3>托运信息</h3>
        <p>公司名称：{{i?.enterpriseInfoName}}</p>
        <p>联系人：{{ i?.dispatch?.name }}/{{i?.dispatch?.phone}}</p>
      </div>
    </div>
    <div nz-col nzSpan="5">
      <div class="source-info bdr pl-md">
        <h3>承运信息</h3>
        <p>司机：{{i?.driverVo?.name}}/{{i?.driverVo?.phone}}</p>
        <p>车牌号：{{i?.carVO?.carNo}}</p>
        <p>车型/车长/承重：{{i?.carVO?.carModel}} | {{i?.carVO?.carLength}} | {{i?.carVO?.carLoad}}</p>
      </div>
    </div>
    <div class="source-info pl-md">
      <h3>补充信息</h3>
      <p style="color: #1890ff;" (click)="agreement('1')">协议附件</p>
      <p style="color: #1890ff;" (click)="agreement('2')"> 装车附件</p>
      <p style="color: #1890ff;" (click)="agreement('3')">卸货附件</p>
      <p style="color: #1890ff;" (click)="agreement('4')">回单附件</p>
    </div>
  </div>
  <nz-divider></nz-divider>
  <div nz-row>
    <div class="freight-info-box">
      <h3>运费信息</h3>
      <div class="text-right">
        <p><label class="freigth-label">收款人:</label><span>{{i?.payee?.name}} /{{i?.payee?.phone}} / {{i?.payee?.phone}}</span></p>
        <div *ngFor="let item of i?.billExpenseDetailVOList">
          <p><label class="freigth-label">{{item?.costName}}:</label><span>{{ item?.price| currency: '￥' }}</span></p>
        </div>
      </div>
    </div>
    <nz-divider></nz-divider>
    <div class="freight-info-box" nz-row>
      <div nz-col nzSpan="24">
        <h3 class="text-right"><label>总计 :</label> <span class="text-error-dark text-xl">{{i?.freight | currency: '￥' }}</span></h3>
        <h3 class="text-right">{{i?.wayBillStatusLabel}}</h3>
      </div>

    </div>
  </div>
  <nz-divider></nz-divider>
  <div nz-row > 
    <div nz-col [nzSpan]='12'>
      <div  style="position: relative;">
        <div style="height: 24px; width: 90px; background-color: #68758e;color: #fff;text-align: center;">平台支付</div>
        
        <div >
          <!-- <p><label class="freigth-label">{{i?.platformPaymentDetail?.costName}}:</label><span>{{ i?.platformPaymentDetail?.price| currency: '￥' }}</span></p> -->
          <div *ngFor="let item of i?.platformPaymentDetail">
            <p><label class="freigth-label">{{item?.costName}}:</label><span>{{ item?.price| currency: '￥' }}</span></p>
          </div>
        </div>
      </div>
    </div>
    <div nz-col [nzSpan]='12'>
      <div style="position: relative;">
        <div style="height: 24px; width: 90px; background-color: #68758e;color: #fff;text-align: center;">货主支付</div>
        <div *ngFor="let item of i?.ownerPaymentDetail?.freightDetail">
          <p><label class="freigth-label">{{item?.costName}}:</label><span>{{ item?.price| currency: '￥' }}</span></p>
        </div>
      </div>
    </div>
  </div>
  <nz-divider></nz-divider>
  
  <div nz-row>
    <nz-card nzTitle="轨迹信息" style="width: 100%;" >
      <div nz-row > 
        <div nz-col [nzSpan]='12'>
    <st #st [data]="i?.auditRecordList" [columns]="logColumns" [ps]="0" [page]="{ show: false, showSize: false }">
    </st>
  </div>
  <div nz-col [nzSpan]='12'>
     <amap-path-simplifier></amap-path-simplifier>
   </div>
   </div>
    </nz-card>
  </div>
</nz-card>
<nz-modal [(nzVisible)]="isVisible"   [nzFooter]="nzModalFooter" nzTitle="附件信息" (nzOnOk)="handleOK()" (nzOnCancel)="handleCancel()">
  <ng-container *nzModalContent>
    <app-imagelist [imgList]="imges"></app-imagelist>
  </ng-container>
  <ng-template #nzModalFooter>
    <button nz-button nzType="primary" (click)="handleOK()" [disabled]="">取消</button>
    <button nz-button nzType="default" (click)="handleCancel()">确定  </button>
  </ng-template>
</nz-modal>
