feat: rotate log id

This commit is contained in:
Methapon2001 2024-06-26 17:03:49 +07:00
parent f46b7868fa
commit 83831988dd
3 changed files with 29 additions and 2 deletions

View file

@ -59,8 +59,10 @@ import FormEmployeeVisa from 'src/components/03_customer-management/FormEmployee
import { Icon } from '@iconify/vue';
import { dialog, calculateAge } from 'src/stores/utils';
import { useI18n } from 'vue-i18n';
import useFlowStore from 'src/stores/flow';
const { t, locale } = useI18n();
const userCustomer = useCustomerStore();
const {
create,
@ -74,6 +76,7 @@ const {
fetchListBranch,
fetchListBranchById,
} = userCustomer;
const flowStore = useFlowStore();
const employeeStore = useEmployeeStore();
const optionStore = useOptionStore();
const formData = ref<CustomerCreate>({
@ -431,6 +434,7 @@ function onClose() {
infoDrawer.value = false;
infoDrawerEdit.value = false;
dialogInputForm.value = false;
flowStore.rotate();
clearForm();
}
@ -438,6 +442,7 @@ function onCloseBranch() {
infoDrawerBranch.value = false;
infoDrawerEdit.value = false;
dialogInputForm.value = false;
flowStore.rotate();
clearForm();
}
@ -607,6 +612,7 @@ function deleteBranchId(id: string) {
if (result) branch.value = result.branch;
infoDrawerBranch.value = false;
flowStore.rotate();
},
cancel: () => {},
});
@ -641,6 +647,7 @@ async function onSubmit() {
clearFormEmployee();
}
}
flowStore.rotate();
}
async function onSubmitCustomerBranch() {
@ -660,6 +667,7 @@ async function onSubmitCustomerBranch() {
currentCustomerUrlImage.value = result.imageUrl;
branch.value = result.branch;
}
flowStore.rotate();
}
const resultSearch = ref<(Customer & { branch: CustomerBranch[] })[]>();
@ -674,6 +682,7 @@ async function searchCustomer() {
if (resultList) {
resultSearch.value = resultList.result;
}
flowStore.rotate();
}
async function searchEmployee() {
@ -684,6 +693,7 @@ async function searchEmployee() {
if (resultList) {
resultSearchEmployee.value = resultList.result;
}
flowStore.rotate();
}
async function fetchListCustomer() {
@ -727,12 +737,14 @@ async function toggleStatusEmployee(id: string, status: boolean) {
await employeeStore.editById(id, { status: !status ? 'ACTIVE' : 'INACTIVE' });
await fetchListEmployee();
flowStore.rotate();
}
async function toggleStatusCustomer(id: string, status: boolean) {
await editById(id, { status: !status ? 'ACTIVE' : 'INACTIVE' });
await fetchListCustomer();
flowStore.rotate();
}
async function onSubmitEdit(id: string) {
@ -771,6 +783,7 @@ async function onSubmitEdit(id: string) {
clearFormEmployee();
}
}
flowStore.rotate();
}
async function onDelete(id: string) {
@ -787,6 +800,7 @@ async function onDelete(id: string) {
const resultList = await employeeStore.fetchList();
if (resultList) listEmployee.value = resultList.result;
clearFormEmployee();
flowStore.rotate();
},
cancel: () => {},
});
@ -813,6 +827,7 @@ async function submitBranch() {
}
infoDrawerBranch.value = false;
flowStore.rotate();
clearForm();
}
@ -1028,6 +1043,7 @@ async function assignFormDataEmployee(id: string) {
formDataEmployeeSameAddr.value = false;
}
}
flowStore.rotate();
}
async function checkEmployeeForm() {
@ -1115,6 +1131,7 @@ onMounted(async () => {
);
listEmployee.value = resultListEmployee.result;
}
flowStore.rotate();
});
watch(locale, () => {
@ -1150,6 +1167,7 @@ watch(fieldSelectedCustomer, async () => {
if (resultList) {
listCustomer.value = resultList.result;
}
flowStore.rotate();
});
watch(
@ -1189,6 +1207,7 @@ watch(
watch(genderselector, async (gender) => {
await fetchListEmployee({ gender: gender });
flowStore.rotate();
});
watch(currentStatus, async () => {
@ -1204,6 +1223,7 @@ watch(currentStatus, async () => {
: 'INACTIVE',
});
}
flowStore.rotate();
});
watch(selectorLabel, async () => {