iOS: Einzelstücke (UID/QR) + Scan öffnet das Stück; Seed ohne Modell-Kaufdatum
iOS-Parität zum Web: Item-Modell + API, Einzelstueck-Liste in der Produkt- Detailansicht (anlegen, je-Stueck Lagerort/Kaufdatum/Garantie/Bezugsquelle/Notiz aendern, entfernen mit Grund, QR je Stueck via CoreImage). Anlegen-Formular hat den Schalter "Einzelstuecke". Der Scanner erkennt Einzelstueck-QR (…/i/<UID>) und oeffnet direkt das Stueck. Seed: "Kaufdatum"/"Garantie bis" nicht mehr als Modell-Felder auf Elektronik - diese Angaben gehoeren je Einzelstueck ans Item, nicht ans Modell. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -72,6 +72,8 @@ struct ProductFormView: View {
|
||||
@State private var selectedCategoryId: Int?
|
||||
// Umschalter Lebensmittel/Gegenstand: filtert die Kategorieauswahl.
|
||||
@State private var modus = "object"
|
||||
// Gegenstand als Einzelstücke (UID/QR je Stück) führen?
|
||||
@State private var individual = false
|
||||
@State private var groups: [GroupItem] = []
|
||||
@State private var categories: [CategoryItem] = []
|
||||
@State private var units: [Unit] = []
|
||||
@@ -97,9 +99,14 @@ struct ProductFormView: View {
|
||||
}
|
||||
.pickerStyle(.segmented)
|
||||
CategoryPicker(categories: categories, selection: $selectedCategoryId, tracking: modus)
|
||||
if modus == "object" {
|
||||
Toggle("Einzelstücke (UID/QR je Stück)", isOn: $individual)
|
||||
}
|
||||
} footer: {
|
||||
Text(modus == "object"
|
||||
? "Gegenstand: Menge je Lagerort und eigene Felder."
|
||||
? (individual
|
||||
? "Einzelstücke: jedes Stück mit eigener UID/QR, Kaufdatum, Garantie."
|
||||
: "Gegenstand: Menge je Lagerort und eigene Felder.")
|
||||
: "Lebensmittel: Chargen mit Mindesthaltbarkeit.")
|
||||
}
|
||||
.onChange(of: modus) { neu in
|
||||
@@ -209,7 +216,8 @@ struct ProductFormView: View {
|
||||
packageLabel: packageLabel.isEmpty ? nil : packageLabel,
|
||||
datePrecision: datePrecision,
|
||||
groupId: selectedGroupId,
|
||||
categoryId: selectedCategoryId
|
||||
categoryId: selectedCategoryId,
|
||||
individual: modus == "object" ? individual : nil
|
||||
)
|
||||
)
|
||||
onCreated(product)
|
||||
|
||||
Reference in New Issue
Block a user