diff --git a/src/pages/03_customer-management/BranchPage.vue b/src/pages/03_customer-management/BranchPage.vue index e7443e2f..b7218aaa 100644 --- a/src/pages/03_customer-management/BranchPage.vue +++ b/src/pages/03_customer-management/BranchPage.vue @@ -663,6 +663,7 @@ watch( async () => { await fetchList(); customerBranchFormState.dialogModal = false; + customerBranchFormStore.resetForm(); flowStore.rotate(); } " diff --git a/src/pages/03_customer-management/form.ts b/src/pages/03_customer-management/form.ts index a6246f89..85117c4a 100644 --- a/src/pages/03_customer-management/form.ts +++ b/src/pages/03_customer-management/form.ts @@ -527,6 +527,11 @@ export const useCustomerBranchForm = defineStore('form-customer-branch', () => { currentFormData.value = structuredClone(resetFormData); } + function resetForm() { + resetFormData = structuredClone(defaultFormData); + currentFormData.value = structuredClone(resetFormData); + } + function isFormDataDifferent() { return ( JSON.stringify(resetFormData) !== JSON.stringify(currentFormData.value) @@ -574,6 +579,7 @@ export const useCustomerBranchForm = defineStore('form-customer-branch', () => { initForm, isFormDataDifferent, submitForm, + resetForm, }; });