PDF Download
This commit is contained in:
@@ -37,7 +37,6 @@ export class CreateHandoverPdfDialogComponent {
|
||||
});
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.data)
|
||||
this.patchInitialData();
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,18 @@ export class HandoverDialogComponent extends AgGridContainerComponent {
|
||||
, sort: 'desc'
|
||||
, cellRenderer: (data: any) => this.datePipe.transform(new Date(data.value))
|
||||
},
|
||||
|
||||
{
|
||||
colId: 'download',
|
||||
headerName: 'PDF',
|
||||
field: 'pdfFormKey',
|
||||
width: 60,
|
||||
tooltipValueGetter: () => 'Übergabeprotokoll herunterladen',
|
||||
cellRenderer: () => '',
|
||||
cellClass: (data: any) => data.value ? 'download-pdf' : '',
|
||||
onCellClicked: (event) => {
|
||||
this.downloadHandoverPDF(event.value)
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -94,7 +105,7 @@ export class HandoverDialogComponent extends AgGridContainerComponent {
|
||||
key: new FormControl(this.data),
|
||||
direction: new FormControl('out', Validators.required),
|
||||
timestamp: new FormControl(new Date(), Validators.required),
|
||||
handoverDocument: new FormControl<boolean>(false)
|
||||
handoverDocument: new FormControl<boolean>(true)
|
||||
});
|
||||
|
||||
ngOnInit() {
|
||||
@@ -104,7 +115,6 @@ export class HandoverDialogComponent extends AgGridContainerComponent {
|
||||
loadData() {
|
||||
this.isLoading = true;
|
||||
const promises: Observable<any>[] = [
|
||||
this.getHandovers(),
|
||||
from(this.loadCustomers())
|
||||
];
|
||||
|
||||
@@ -218,6 +228,13 @@ export class HandoverDialogComponent extends AgGridContainerComponent {
|
||||
onGridReady(params: GridReadyEvent) {
|
||||
this.gridApi = params.api;
|
||||
this.gridApi.addEventListener("cellEditingStopped", evt => {})
|
||||
this.getHandovers();
|
||||
//this.downloadHandoverPDF('5b1f92d9-c66c-49ad-b654-b9a9a6a59752')
|
||||
}
|
||||
|
||||
downloadHandoverPDF(key: string) {
|
||||
if (!key) { return; }
|
||||
this.api.getHandoverPdf(key)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user