Allow downloading of fingerprint data.

This commit is contained in:
2022-01-16 16:08:19 +05:30
parent 1806ae1b06
commit 7065a3b911
5 changed files with 94 additions and 3 deletions

View File

@ -18,6 +18,11 @@
"target": "http://localhost:9998",
"secure": false,
"logLevel": "info"
},
"/fingerprint-report": {
"target": "http://localhost:9998",
"secure": false,
"logLevel": "info"
},
"/db-image": {
"target": "http://localhost:9998",

View File

@ -47,7 +47,7 @@
fxLayoutGap="20px"
fxLayoutGap.lt-md="0px"
>
<mat-form-field fxFlex="40">
<mat-form-field fxFlex="35">
<input
matInput
[matDatepicker]="attendanceStartDate"
@ -59,7 +59,7 @@
<mat-datepicker-toggle matSuffix [for]="attendanceStartDate"></mat-datepicker-toggle>
<mat-datepicker #attendanceStartDate></mat-datepicker>
</mat-form-field>
<mat-form-field fxFlex="40">
<mat-form-field fxFlex="35">
<input
matInput
[matDatepicker]="attendanceFinishDate"
@ -72,9 +72,12 @@
<mat-datepicker #attendanceFinishDate></mat-datepicker>
</mat-form-field>
<a mat-raised-button color="primary" href="{{ attendanceRecordUrl() }}" fxFlex="20"
<a mat-raised-button color="primary" href="{{ attendanceRecordUrl() }}" fxFlex="15"
>Download Attendance</a
>
<a mat-raised-button color="primary" href="{{ fingerPrintUrl() }}" fxFlex="15"
>Download Fingerprints</a
>
</form>
</mat-card-content>
</mat-card>

View File

@ -92,6 +92,20 @@ export class EmployeeFunctionsComponent {
return `/attendance-report?s=${startDate}&f=${finishDate}`;
}
fingerPrintUrl() {
const startDate = moment(
(this.attendanceRecordForm.get('startDate') as FormControl).value,
).format('DD-MMM-YYYY');
const finishDate = moment(
(this.attendanceRecordForm.get('finishDate') as FormControl).value,
).format('DD-MMM-YYYY');
if (!startDate || !finishDate) {
// this.toaster.show('Danger', 'Please choose a start and finish date.');
return '';
}
return `/fingerprint-report?s=${startDate}&f=${finishDate}`;
}
detectFiles(event: Event) {
// eslint-disable-next-line prefer-destructuring
this.fingerprintFile = ((event.target as HTMLInputElement).files as FileList)[0];