/*
 * @Author: your name
 * @Date: 2021-12-07 17:30:18
 * @LastEditTime: 2021-12-16 15:31:13
 * @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\vehicle\components\list\img-view\img-view.component.ts
 */
import { Component, OnInit } from '@angular/core';
import { _HttpClient } from '@delon/theme';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { VehicleService } from '../../../services/vehicle.service';

@Component({
  selector: 'app-setting-components-info-img-view',
  templateUrl: './img-view.component.html',
})
export class VehicleImgViewComponent implements OnInit {
  record: any = {};
  i: any;

  constructor(private modal: NzModalRef, public msgSrv: NzMessageService, public http: _HttpClient, public service: VehicleService) {}

  ngOnInit(): void {
    console.log(this.i);
  }

  cancel() {
    this.modal.destroy();
  }
  // 驳回
  reject() {
    const params ={
      approvalStatus: 30,
      id: this.i.id
    }
    this.service.request(this.service.$api_get_auditCarProtocal_audit, params).subscribe((res) => {
      if(res) {
        this.modal.destroy();
        this.service.msgSrv.success('已驳回')
      } else {
        this.service.msgSrv.error(res.msg)
      }
    })
  }
  // 通过
  okCancel() {
  const params ={
    approvalStatus: 20,
    id: this.i.id
    }
    this.service.request(this.service.$api_get_auditCarProtocal_audit, params).subscribe((res) => {
        if(res) {
          this.modal.destroy();
        this.service.msgSrv.success('已通过')
        } else {
          this.service.msgSrv.error(res.msg)
        }
    })
  }
}
