feat: employee drawer info undo

This commit is contained in:
puriphatt 2024-06-12 09:16:21 +00:00
parent 60431904ce
commit c69283e1b1

View file

@ -714,7 +714,13 @@ async function submitBranch() {
}
function undo() {
infoDrawerEdit.value = false;
if (selectorLabel.value === 'EMPLOYER') infoDrawerEdit.value = false;
if (selectorLabel.value === 'EMPLOYEE') {
if (!currentEmployee.value) return;
infoDrawerEmployeeEdit.value = false;
assignFormDataEmployee(currentEmployee.value.id);
}
}
async function employeeFilterOwnerBranch(
@ -2256,8 +2262,8 @@ watch(fieldSelectedCustomer, async () => {
v-model:drawer-open="infoDrawerEmployee"
:is-edit="infoDrawerEmployeeEdit"
:editData="() => (infoDrawerEmployeeEdit = true)"
:undo="() => (infoDrawerEmployeeEdit = false)"
:close="() => clearFormEmployee()"
:undo="undo"
:close="clearFormEmployee"
:deleteData="
() => {
currentEmployee && onDelete(currentEmployee.id);