1
|
import {Component, OnInit} from '@angular/core';
|
2
|
import {FormBuilder, FormGroup} from '@angular/forms';
|
3
|
import {DynamicDialogConfig, DynamicDialogRef} from 'primeng/dynamicdialog';
|
4
|
|
5
|
@Component({
|
6
|
selector: 'app-preview-unhandled-data-popup',
|
7
|
templateUrl: './preview-unhandled-data-popup.component.html',
|
8
|
styleUrls: ['./preview-unhandled-data-popup.component.scss']
|
9
|
})
|
10
|
export class PreviewUnhandledDataPopupComponent implements OnInit {
|
11
|
invoiceForm: FormGroup;
|
12
|
|
13
|
constructor(public ref: DynamicDialogRef,
|
14
|
public config: DynamicDialogConfig, private fb: FormBuilder,
|
15
|
) {
|
16
|
this.config.header = 'Previewing of Unhandled Data';
|
17
|
this.config.height = 'auto';
|
18
|
this.config.width = '50vw';
|
19
|
this.config.closable = false;
|
20
|
}
|
21
|
|
22
|
ngOnInit(): void {
|
23
|
this.invoiceForm = this.fb.group({
|
24
|
invoiceNumber: this.fb.control({value:null,disabled:true}),
|
25
|
invoiceType: this.fb.control({value:null,disabled:true}),
|
26
|
invoiceIssueDate: this.fb.control({value:null,disabled:true}),
|
27
|
customerName: this.fb.control({value:null,disabled:true}),
|
28
|
supplierName: this.fb.control({value:null,disabled:true}),
|
29
|
totalPriceBeforeVat: this.fb.control({value:null,disabled:true}),
|
30
|
vatRate: this.fb.control({value:null,disabled:true}),
|
31
|
totalAmount: this.fb.control({value:null,disabled:true})
|
32
|
});
|
33
|
console.log(this.config.data);
|
34
|
this.invoiceForm.patchValue(this.config.data);
|
35
|
}
|
36
|
|
37
|
}
|