feat(bestellungen): add optional "Für Mitglied" field, auto-populated from internal request submitter

This commit is contained in:
Matthias Hochmeister
2026-04-15 18:17:54 +02:00
parent 67fd0878ce
commit eb2342684e
8 changed files with 86 additions and 13 deletions

View File

@@ -23,7 +23,7 @@ import { ausruestungsanfrageApi } from '../services/ausruestungsanfrage';
import type { BestellungFormData, BestellpositionFormData, LieferantFormData, Lieferant } from '../types/bestellung.types';
import type { AusruestungArtikel } from '../types/ausruestungsanfrage.types';
const emptyOrderForm: BestellungFormData = { bezeichnung: '', lieferant_id: undefined, besteller_id: '', notizen: '', positionen: [] };
const emptyOrderForm: BestellungFormData = { bezeichnung: '', lieferant_id: undefined, besteller_id: '', mitglied_id: undefined, notizen: '', positionen: [] };
const emptyVendorForm: LieferantFormData = { name: '', kontakt_name: '', email: '', telefon: '', adresse: '', website: '', notizen: '' };
const emptyPosition: BestellpositionFormData = { bezeichnung: '', menge: 1, einheit: 'Stk' };
@@ -150,6 +150,14 @@ export default function BestellungNeu() {
renderInput={(params) => <TextField {...params} label="Besteller" />}
/>
<Autocomplete
options={orderUsers}
getOptionLabel={(o) => o.name}
value={orderUsers.find((u) => u.id === orderForm.mitglied_id) || null}
onChange={(_e, v) => setOrderForm((f) => ({ ...f, mitglied_id: v?.id || '' }))}
renderInput={(params) => <TextField {...params} label="Für Mitglied" />}
/>
<TextField
label="Notizen"
multiline