/*
 * @Author: your name
 * @Date: 2021-12-03 11:10:14
 * @LastEditTime: 2021-12-09 20:54:28
 * @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\supply-management\components\vehicle-detail\vehicle-detail.component.ts
 */
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { STColumn } from '@delon/abc/st';
import { _HttpClient } from '@delon/theme';
import { NzMessageService } from 'ng-zorro-antd/message';
import { SupplyManagementService } from '../../services/supply-management.service';

@Component({
  selector: 'app-supply-management-vehicle-detail',
  templateUrl: './vehicle-detail.component.html',
  styleUrls: ['./vehicle-detail.component.less']
})
export class SupplyManagementVehicleDetailComponent implements OnInit {

  id = this.route.snapshot.params.id;
  i: any;
  dataList: any;
  logColumns: STColumn[] = [
    { title: '内容', index: 'theme' },
    { title: '操作人', index: 'operationUserPhone' },
    { title: '操作时间', index: ' createTime' },
  ];

  constructor(
    private route: ActivatedRoute,
    private msgSrv: NzMessageService,
    private service: SupplyManagementService,
    private router: Router,private ar: ActivatedRoute
  ) {

  }

  ngOnInit(): void {
    console.log(this.id)
    if(this.id) {
      this.getDetailList(this.id)
    }
  }

  // 获取录单员 
  getDetailList(id: any) {
    const params = {
      id: id
    };
   this.service.request(`${this.service.$api_get_getCompleteVehicleDetail}`, params).subscribe((res) => {
      console.log(res)
      this.dataList = res
    })
  }
  // 修改货源 
  modification() {
    this.router.navigate(['/supply-management/vehicle-amend', this.id], {
      queryParams: {
        sta: 1
      },
    })
  }
  //  再下一单
  nextOrder() {
    this.router.navigate(['/supply-management/vehicle-amend', this.id], {
      queryParams: {
        sta: 2
      },
    })
  }



  goBack() {
    window.history.go(-1);
  }
}
