@@ -55,6 +55,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
|
||||||
@@ -112,6 +127,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: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -136,6 +152,7 @@ watch(() => props.item, (newItem) => {
|
|||||||
form.quantity = Number(newItem.quantity)
|
form.quantity = Number(newItem.quantity)
|
||||||
form.unit_id = newItem.unit_id
|
form.unit_id = newItem.unit_id
|
||||||
form.expiry_date = newItem.expiry_date || ''
|
form.expiry_date = newItem.expiry_date || ''
|
||||||
|
form.low_stock_threshold = newItem.low_stock_threshold || null
|
||||||
form.notes = newItem.notes || ''
|
form.notes = newItem.notes || ''
|
||||||
isOpen.value = true
|
isOpen.value = true
|
||||||
}
|
}
|
||||||
@@ -168,6 +185,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