1
|
import {Component, OnInit} from '@angular/core';
|
2
|
import {DialogService, DynamicDialogConfig, DynamicDialogRef} from 'primeng/dynamicdialog';
|
3
|
import {FileViewerPopupComponent} from '../file-viewer-popup/file-viewer-popup.component';
|
4
|
import {InboxManagementService} from '../../../../../shared/services/inbox-management.service';
|
5
|
import {ReceivedFile} from '../../../../../shared/models/inbox-document.interface';
|
6
|
import {InboxBatch} from '../../../../../shared/models/inbox-batch.interface';
|
7
|
import { NotificationsHandlingService } from 'src/app/shared/services/notifications-handling/notifications-handling.service';
|
8
|
import { ReceivedFiles } from 'src/app/shared/models/receivedFiles.interface';
|
9
|
|
10
|
@Component({
|
11
|
selector: 'app-forward-file-to-abby-for-recognition-dialog',
|
12
|
templateUrl: './forward-file-to-abby-for-recognition-dialog.component.html',
|
13
|
styleUrls: ['./forward-file-to-abby-for-recognition-dialog.component.scss']
|
14
|
})
|
15
|
export class ForwardFileToAbbyForRecognitionDialogComponent implements OnInit {
|
16
|
documents: ReceivedFiles[] = [];
|
17
|
documentBatch: InboxBatch;
|
18
|
|
19
|
constructor(
|
20
|
public ref: DynamicDialogRef
|
21
|
, public config: DynamicDialogConfig
|
22
|
, private dialogService: DialogService
|
23
|
, private inboxService: InboxManagementService
|
24
|
, private notificationService: NotificationsHandlingService) {
|
25
|
|
26
|
this.config.header = 'Forward Documents';
|
27
|
}
|
28
|
|
29
|
ngOnInit(): void {
|
30
|
this.documentBatch = this.config.data;
|
31
|
this.documents = [this.documentBatch.receivedFile];
|
32
|
console.log(this.documents, this.config);
|
33
|
}
|
34
|
|
35
|
showOrDownloadFile(document: any) {
|
36
|
this.dialogService.open(FileViewerPopupComponent, {data: document});
|
37
|
}
|
38
|
|
39
|
onForward() {
|
40
|
this.inboxService.forward(String(this.documentBatch.statusPerDocRecId)).subscribe( result => {
|
41
|
this.notificationService.showOnForwardSuccess();
|
42
|
});
|
43
|
this.ref.close();
|
44
|
}
|
45
|
|
46
|
closeDialog() {
|
47
|
this.ref.close();
|
48
|
}
|
49
|
}
|