feat: add low-stock threshold field to AddItemForm (#67)
This commit is contained in:
@@ -57,6 +57,21 @@
|
|||||||
/>
|
/>
|
||||||
</UFormGroup>
|
</UFormGroup>
|
||||||
|
|
||||||
|
<!-- Low Stock Threshold -->
|
||||||
|
<UFormGroup
|
||||||
|
label="Low Stock Alert"
|
||||||
|
hint="Optional - Alert when quantity falls below this"
|
||||||
|
>
|
||||||
|
<UInput
|
||||||
|
v-model.number="form.low_stock_threshold"
|
||||||
|
type="number"
|
||||||
|
min="0"
|
||||||
|
step="0.1"
|
||||||
|
placeholder="e.g. 2"
|
||||||
|
size="lg"
|
||||||
|
/>
|
||||||
|
</UFormGroup>
|
||||||
|
|
||||||
<!-- Notes -->
|
<!-- Notes -->
|
||||||
<UFormGroup label="Notes" hint="Optional">
|
<UFormGroup label="Notes" hint="Optional">
|
||||||
<UTextarea
|
<UTextarea
|
||||||
@@ -121,6 +136,7 @@ const form = reactive({
|
|||||||
quantity: 1,
|
quantity: 1,
|
||||||
unit_id: '',
|
unit_id: '',
|
||||||
expiry_date: '',
|
expiry_date: '',
|
||||||
|
low_stock_threshold: null as number | null,
|
||||||
notes: ''
|
notes: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -210,6 +226,7 @@ const handleSubmit = async () => {
|
|||||||
quantity: form.quantity,
|
quantity: form.quantity,
|
||||||
unit_id: form.unit_id,
|
unit_id: form.unit_id,
|
||||||
expiry_date: form.expiry_date || null,
|
expiry_date: form.expiry_date || null,
|
||||||
|
low_stock_threshold: form.low_stock_threshold,
|
||||||
notes: form.notes.trim() || null
|
notes: form.notes.trim() || null
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user