/*
 * @Author: your name
 * @Date: 2021-12-03 15:31:52
 * @LastEditTime: 2021-12-20 13:55:09
 * @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.ts
 */
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { STColumn } from '@delon/abc/st';
import { _HttpClient } from '@delon/theme';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalService } from 'ng-zorro-antd/modal';
import { WaybillManagementServe } from '../../services/waybill-management.service';
@Component({
  selector: 'app-supply-management-vehicle-detail',
  templateUrl: './vehicle-detail.component.html',
  styleUrls: ['./vehicle-detail.component.less']
})
export class WaybillManagementVehicleDetailComponent implements OnInit {

  id = this.route.snapshot.params.id;
  isVisible = false;
  i: any;
  imges: any;
  logColumns: STColumn[] = [
    { title: '时间', index: 'operationUserPhone' },
    { title: '地点', index: ' createTime' },
  ];
  unLoadingPlaceVOList: any = [];

  constructor(
    private route: ActivatedRoute,
    private msgSrv: NzMessageService,
    private service: WaybillManagementServe,
    private modalService: NzModalService
  ) {

  }

  ngOnInit(): void {
    this.initData()
  }
  initData() {
    const params = {
      id: this.id
    }
    this.service.request(this.service.$api_get_getWholeDetail, params).subscribe((res) => {
      console.log(res)
      this.unLoadingPlaceVOList.push(...res.loadingPlace)
      this.unLoadingPlaceVOList.push(...res.dischargePlace)
      console.log(this.unLoadingPlaceVOList)
      this.i = res;
    })
  }


  hand() {
    this.modalService.create({
      nzTitle: '',
      // nzContent: OrderManagementGaodeMapComponent,
      nzWidth: 1200
    });
  }

  goBack() {
    window.history.go(-1);
  }
handleCancel() {
    this.isVisible = false
}
handleOK() {
  this.isVisible = false
}
agreement(value: any) {
  console.log('123')
  console.log(value)
  if(value === '1') {
    this.imges = this.i?.supplementAgreement
  } else if (value === '2') {
    this.imges = this.i?.loadingCertificate
  } else if (value === '3') {
    this.imges = this.i?.unLoadingCertificate
  } else if (value === '4') {
    this.imges = this.i?.receiptCertificate
  }
  this.isVisible = true;
}
}
