Changes 0128092025
This commit is contained in:
@@ -84,7 +84,8 @@ const store = () => {
|
||||
},
|
||||
onSuccess: () => {
|
||||
close();
|
||||
form.reset();
|
||||
// Preserve selected contract across submissions; reset only user-editable fields
|
||||
form.reset('due_date', 'amount', 'note');
|
||||
},
|
||||
onError: (errors) => {
|
||||
console.log('Validation or server error:', errors);
|
||||
@@ -95,6 +96,17 @@ const store = () => {
|
||||
});
|
||||
}
|
||||
|
||||
// When the drawer opens, always sync the current contractUuid into the form,
|
||||
// even if the value hasn't changed (prevents stale/null contract_uuid after reset)
|
||||
watch(
|
||||
() => props.show,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
form.contract_uuid = props.contractUuid || null;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<DialogModal :show="show" @close="close">
|
||||
|
||||
Reference in New Issue
Block a user