fix: do not close on undo
This commit is contained in:
parent
de7346c9f5
commit
74a26a0586
1 changed files with 6 additions and 6 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue