import { HttpClient } from '@angular/common/http'; import { Component, Input, OnInit } from '@angular/core'; import { NzModalRef } from 'ng-zorro-antd/modal'; @Component({ selector: 'app-gas-base-info', templateUrl: './gas-base-info.component.html', styleUrls: ['./gas-base-info.component.scss'] }) export class GasBaseInfoComponent implements OnInit { constructor(private modal: NzModalRef,private http: HttpClient) { } @Input() data?: any; isDetails: boolean = false; //是否是详情 ngOnInit(): void { if (this.data.id === undefined) { //详情 this.isDetails = true //this.getAuditLogging() } this.getBaseInfo() } baseInfo: any = { stationType: null, } getBaseInfo() { let params = { organizationUnitId: this.data.organizationId } this.http.get('/api/services/app/GasStation/Get',{params}).subscribe((data: any)=>{ data.result.govUnitDetail? data.result.govUnitDetail = JSON.parse(data.result.govUnitDetail) : null; this.baseInfo = data.result }) } destroyModal() { this.modal.destroy({ data: 'this the result data' }); } auditList: any[] = []; //获取审核记录 getAuditLogging() { if (!this.data.organizationId) { return } let params = { orgId: this.data.organizationId } this.http.get(`/api/services/app/GasStation/GetAuditted`,{params}).subscribe((data: any)=>{ //this.auditList = data.result.actionList || [] console.log(data) }) } //获取驳回次数 getRejectNum(): number { let num = 0 this.auditList.forEach(item=>{ if (item.auditStatus == 3) { num = num + 1 } }) return num } }