<!--
 * @Author: your name
 * @Date: 2021-12-03 15:31:52
 * @LastEditTime: 2021-12-27 14:22:03
 * @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" [content]="headerContent">
  <ng-template #logo>
    <button nz-button nz-tooltip nzTooltipTitle="返回上一页" (click)="goBack()">
      <i nz-icon nzType="left" nzTheme="outline"></i>
    </button>
  </ng-template>
  <ng-template #headerContent>
    <div class="mb-xs" nz-row>
      <h4 class="ml-md" style="font-size: 18px;">订单号: {{ i?.billCode }}</h4>
    </div>
    <div nz-row style="display: flex; justify-content: end;">
      <div nz-col nzSpan="10">
        <button nz-button  >确认发车</button>
        <button nz-button >取消订单</button>
        <button nz-button  (click)="changeOrder()">修改订单</button>
        <button nz-button nzType="primary" nzGhost >再下一单</button>
      </div>
    </div>
   <div>
     <div style="display: flex; justify-content: space-between;">
      <div sv-container>
        <sv label="网络货运人">{{ i?.goodsResource?.[0]?.enterpriseInfoName }} </sv>
        <sv label="货主">{{ i?.goodsResource?.[0]?.shipperAppUserName }} </sv>
        <sv label="所属项目">{{i?.goodsResource?.[0]?.enterpriseProjectName}}</sv>
        <sv label="服务类型">{{i?.goodsResource?.[0]?.serviceTypeLabel}}</sv>
        <sv label="录单员">{{i?.goodsResource?.[0]?.dispatchName}} 18100000000 </sv>
        <sv label="调度员">{{i?.goodsResource?.[0]?.dispatchName}} </sv>
      </div>
      <div>
        <div>状态</div>
        <div style="font-size: 22px;font-weight: 700;">{{i?.billStatusLabel}}</div>
      </div>
     </div>
     <nz-tabset nzType="card" style="margin-top: 15px;">
      <nz-tab [nzTitle]="tempt" >
        <ng-template #tempt>
          <nz-anchor>
            <nz-link nzHref="#distannce1" nzTitle="装卸货信息"></nz-link>
          </nz-anchor>
        </ng-template>
      </nz-tab>
      <nz-tab [nzTitle]="tempt2" >
        <ng-template #tempt2>
          <nz-anchor>
            <nz-link nzHref="#distannce2" nzTitle="基本信息"></nz-link>
          </nz-anchor>
        </ng-template>
      </nz-tab>
      <nz-tab [nzTitle]="tempt3" >
        <ng-template #tempt3>
          <nz-anchor>
            <nz-link nzHref="#distannce3" nzTitle="运费信息"></nz-link>
          </nz-anchor>
        </ng-template>
      </nz-tab>
      <nz-tab [nzTitle]="tempt4" >
        <ng-template #tempt4>
          <nz-anchor>
            <nz-link nzHref="#distannce4" nzTitle="附件信息"></nz-link>
          </nz-anchor>
        </ng-template>
      </nz-tab>
      <nz-tab [nzTitle]="tempt5" >
        <ng-template #tempt5>
          <nz-anchor>
            <nz-link nzHref="#distannce5" nzTitle="轨迹信息"></nz-link>
          </nz-anchor>
        </ng-template>
      </nz-tab>
    </nz-tabset>
   </div>
  </ng-template>
</page-header-wrapper>
<nz-card nzTitle="运单进度">
  <div class="approval-status">
    <div style="width: 60%; margin: 0 auto">
      <!-- <nz-steps [nzLabelPlacement]="'vertical'">
        <nz-step [nzStatus]="i?.resourceStatus !== '1'?'finish':'process'" nzIcon="solution"
          [nzDescription]="i?.createAt" nzTitle="下单"></nz-step>
        <nz-step *ngIf="i?.resourceStatus === '1' || i?.resourceStatus === '2' "
          [nzStatus]="i?.resourceStatus=== '1'? 'wait':'finish'" nzIcon="file-done" [nzTitle]="'接单'"></nz-step>
        <nz-step nzStatus="finish" nzIcon="close-circle" nzTitle="取消货源" *ngIf="i?.resourceStatus === '3'"></nz-step>
      </nz-steps> -->
    </div>
  </div>
</nz-card>

<nz-card nzTitle="装卸货信息(一装一卸)" id="distannce1" >
  <div class="mt-md">
    <div nz-row [nzGutter]="24">
      <div nz-col [nzSpan]="8">
        <div class="handling-info p-md">
          <div class="flex" *ngFor="let item of i?.unLoadingPlaceList;let idx = index">
            <div *ngIf="item?.type === '1'" class="loading-row">
              <div class="info">
                <h4>装货地：{{item?.province}}{{item?.city}}{{item?.area}}{{item?.detailedAddress}}</h4>
                <p>联系人：{{item?.appUserName}}/{{item?.contractTelephone}}</p>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div nz-col [nzSpan]="8" style="display: flex; justify-content: center; align-items: center;">
        <div >
          <span style="padding: 24 px; font-size: 30px;"><img style="width: 48px;" src="../../../../../assets/images/usercenter/彩色-箭头-向右-1.png" alt=""></span>
        </div>
      </div>
      <div nz-col [nzSpan]="8">
        <div class="handling-info p-md">
          <div class="flex" *ngFor="let item of i?.unLoadingPlaceList;let idx = index">
            <div *ngIf="item?.type === '2'" class="loading-row">
              <div class="info">
                <h4>卸货地：{{item?.province}}{{item?.city}}{{item?.area}}{{item?.detailedAddress}}</h4>
                <p>联系人：{{item?.appUserName}}/{{item?.contractTelephone}}</p>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</nz-card>

<nz-card nzTitle="基本信息" id="distannce2">
  <sv-container col="1">
      <sv label="货物名称">
        {{i?.goodsInfoList?.[0]?.goodsName}}
      </sv>
  </sv-container>
  <sv-container col="2">
      <sv label="货物数量">
        {{i?.goodsInfoList?.[0]?.weight}}吨,{{i?.goodsInfoList?.[0]?.volume}}方,{{i?.goodsInfoList?.[0]?.number}}件
      </sv>
      <sv label="用车需求">
        {{i?.goodsInfoList?.[0]?.maxWeightLabel}}/{{i?.goodsInfoList?.[0]?.maxCube}}
      </sv>
      <sv label="承运司机">
        {{i?.driverId}}
      </sv>
      <sv label="车型车长载重">
        {{i?.goodsInfoList?.[0]?.weight}}吨,{{i?.goodsInfoList?.[0]?.volume}}方,{{i?.goodsInfoList?.[0]?.number}}件
      </sv>
      <sv label="计划装货时间">
        {{i?.loadPlanTime}}
      </sv>
      <sv label="计划卸货时间">
        {{i?.unloadPlanTime}}
      </sv>
      <sv label="接单数量">
        {{i?.acceptWeight}}吨,{{i?.acceptVolume}}方,{{i?.acceptNumber}}件
      </sv>
      <sv label="装货数量">
        {{i?.acceptWeight}}吨,{{i?.acceptVolume}}方,{{i?.acceptNumber}}件
      </sv>
      <sv label="卸货数量">
        {{i?.settlementWeight}}吨,{{i?.settlementVolume}}方,{{i?.acceptNumber}}件
      </sv>
  </sv-container>
</nz-card>

<nz-card nzTitle="运费信息" id="distannce3">
  <h2>{{i?.goodsInfoList?.[0]?.freightPrice}}{{i?.goodsInfoList?.[0]?.freightTypeLabel}}（以发货为准，保留小数）</h2>
  <st #st [data]="i?.billExpenseDetails" [columns]="logColumns" [ps]="0" [page]="{ show: false, showSize: false }">

  </st>
  <div>总计：{{i?.total | currency: '￥'}}（运费￥3500.00，附加运费￥191.98，附加费率3.5%）</div>
  <div>收款人：</div>
</nz-card>

<nz-card nzTitle="附件信息" id="distannce4">
  <sv-container>
    <sv label="协议附件">
      <!-- {{i?.supplementaryInformationVO?.stateReceipt?'是':'否'}} -->
      <a href="javascript:;" (click)="agreement('1')">查看附件</a> &nbsp;&nbsp;&nbsp;&nbsp;
      <a href="javascript:;" (click)="agreement('2')">补充协议</a>
    </sv>
  </sv-container>
  <sv-container col="2" class="mt-md">
    <sv label="装货凭证">
      <app-imagelist [imgList]="[i?.loadingLadingBillFilePath,i?.loadingPeopleVehiclesGoodsFilePath]">
      </app-imagelist>
    </sv>
    <sv label="卸货凭证">
      <app-imagelist [imgList]="[i?.unloadingLadingBillFilePath,i?.unloadingPeopleVehiclesGoodsFilePath]">
      </app-imagelist>
    </sv>
  </sv-container>
</nz-card>
<nz-card nzTitle="补充信息">
  <sv-container>
    <sv label="是否回单">
      {{i?.goodsResource?.stateReceipt ?'是':'否'}}
    </sv>
    <sv label="回单类型">
      {{i?.goodsResource?.receiptTypeLabel}}
    </sv>
    <sv label="联系人">
      {{i?.goodsResource?.receiptUserId}} / {{i?.supplementaryInformationVO?.phon}}
    </sv>
    <sv label="所在地区">
      {{i?.goodsResource?.receiptAddress}}
    </sv>
    <sv label="详细地址">
      {{i?.goodsResource?.receiptAddress}}
    </sv>
  
  </sv-container>
  <sv-container col="1" class="mt-md">
    <sv label="回单凭证">
      <app-imagelist [imgList]="[i?.receiptFilePath]"></app-imagelist>
    </sv>
    <sv label="备注">
      {{i?.goodsResource?.remarks}}
    </sv>
  </sv-container>
</nz-card>

<nz-card>
  <div nz-row>
    <nz-card nzTitle="轨迹信息" style="width: 100%;" id="distannce5">
      <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>