feat: auto reset form customer branch
This commit is contained in:
parent
418ce20b06
commit
d1afb438ea
1 changed files with 9 additions and 0 deletions
|
|
@ -334,6 +334,15 @@ export const useCustomerBranchForm = defineStore('form-customer-branch', () => {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => state.value.dialogType,
|
||||||
|
() => {
|
||||||
|
if (state.value.dialogType === 'create') {
|
||||||
|
currentFormData.value = structuredClone(defaultFormData);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
async function submitForm() {
|
async function submitForm() {
|
||||||
if (!state.value.currentCustomerId) {
|
if (!state.value.currentCustomerId) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue