PDF Download

This commit is contained in:
Bastian Wagner
2026-03-13 21:19:52 +01:00
parent 7973d4563e
commit 8a9295c309
17 changed files with 182 additions and 423 deletions

View File

@@ -37,7 +37,6 @@ export class CreateHandoverPdfDialogComponent {
});
ngOnInit() {
console.log(this.data)
this.patchInitialData();
}

View File

@@ -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)
}
}