changes
This commit is contained in:
@@ -158,7 +158,8 @@ export class HandoverDialogComponent {
|
||||
this._bottomSheet.open(BottomSheetCreateCustomer).afterDismissed().subscribe({
|
||||
next: async n => {
|
||||
if (!n) { return; }
|
||||
await this.createCustomer(val.customer);
|
||||
const customer = await this.createCustomer(val.customer);
|
||||
dto.customer = customer;
|
||||
this.saveIt(dto);
|
||||
}
|
||||
})
|
||||
@@ -168,7 +169,7 @@ export class HandoverDialogComponent {
|
||||
}
|
||||
|
||||
saveIt(data: any) {
|
||||
this.api.handoverKey(data)
|
||||
this.api.handoverKey(data)
|
||||
.pipe(
|
||||
this.toast.observe({
|
||||
loading: 'Speichern...',
|
||||
@@ -178,17 +179,20 @@ export class HandoverDialogComponent {
|
||||
)
|
||||
.subscribe({
|
||||
next: n => {
|
||||
this.dialogRef.close(data.direction == 'out')
|
||||
this.dialogRef.close(data.direction == 'out');
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
createCustomer(name: string) {
|
||||
createCustomer(name: string): Promise<any> {
|
||||
this.isLoading = true;
|
||||
this.api.createCustomer({ name, system: this.data.cylinder.system}).subscribe({
|
||||
next: n => {
|
||||
this.isLoading = false;
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
this.api.createCustomer({ name, system: this.data.cylinder.system}).subscribe({
|
||||
next: n => {
|
||||
this.isLoading = false;
|
||||
resolve(n);
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Schlüsselnummer</mat-label>
|
||||
<input type="number" matInput formControlName="nr" min="0" max="999999999999">
|
||||
<input type="text" matInput formControlName="nr" maxlength="100">
|
||||
<mat-hint>Nummer auf dem Schlüssel</mat-hint>
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
.floating-btn-container {
|
||||
position: absolute;
|
||||
bottom: 48px;
|
||||
right: 24px;
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
}
|
||||
@@ -52,6 +52,7 @@ export class KeysComponent {
|
||||
cellEditorPopup: false
|
||||
},
|
||||
{ colId: 'system', field: 'cylinder.system' , headerName: 'Schließanlage', flex: 1, editable: false, filter: true, cellRenderer: (data: any) => {return data.value?.name} },
|
||||
{ colId: 'customer', field: 'customer' , headerName: 'Kunde', flex: 1, editable: false, filter: true, cellRenderer: (data: any) => {return data.value?.name} },
|
||||
{
|
||||
field: 'createdAt'
|
||||
, headerName: 'Erstellt'
|
||||
|
||||
Reference in New Issue
Block a user