diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index a831d760..37868d76 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -406,7 +406,7 @@ async function editCustomerForm(id: string) { customerFormState.value.editCustomerId = id; } -function customerConfirmUnsave() { +function customerConfirmUnsave(close = true) { dialog({ color: 'warning', icon: 'mdi-alert', @@ -417,15 +417,15 @@ function customerConfirmUnsave() { action: () => { customerFormStore.resetForm(); customerFormState.value.editReadonly = true; - customerFormState.value.dialogModal = false; + customerFormState.value.dialogModal = !close; }, cancel: () => {}, }); } -function customerFormUndo() { +function customerFormUndo(close = true) { if (customerFormStore.isFormDataDifferent()) { - return customerConfirmUnsave(); + return customerConfirmUnsave(close); } customerFormStore.resetForm(); customerFormState.value.editReadonly = true; @@ -1698,8 +1698,8 @@ function createEmployeeForm() { " :edit="customerFormState.dialogType === 'edit'" :isEdit="customerFormState.editReadonly === false" - :undo="() => customerFormUndo()" - :deleteData=" + :undo="() => customerFormUndo(false)" + :delete-data=" () => customerFormState.editCustomerId && deleteCustomerById(customerFormState.editCustomerId)