feat: add navigation to customer and employee details from request list
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 7s

This commit is contained in:
puriphatt 2025-04-11 15:50:24 +07:00
parent 586fbed4e3
commit d909be2fc4
3 changed files with 98 additions and 7 deletions

View file

@ -142,6 +142,14 @@ async function init() {
gridView.value = $q.screen.lt.md ? true : false;
if (route.query.tab === 'customer') {
currentTab.value = 'employer';
if (route.query.id) openSpecificCustomer(route.query.id as string);
} else if (route.query.tab === 'employee') {
currentTab.value = 'employee';
if (route.query.id) openSpecificEmployee(route.query.id as string);
}
if (route.name === 'CustomerManagement') await fetchListCustomer(true);
if (
@ -490,6 +498,30 @@ async function fetchImageList(
return res;
}
async function openSpecificCustomer(id: string) {
await customerFormStore.assignFormData(id);
await fetchImageList(
id,
customerFormData.value.selectedImage || '',
'customer',
);
customerFormState.value.branchIndex = -1;
customerFormState.value.drawerModal = true;
customerFormState.value.editCustomerId = id;
customerFormState.value.dialogType = 'info';
}
async function openSpecificEmployee(id: string) {
await employeeFormStore.assignFormDataEmployee(id);
await fetchImageList(
id,
currentFromDataEmployee.value.selectedImage || '',
'employee',
);
employeeFormState.value.dialogType = 'info';
employeeFormState.value.drawerModal = true;
}
// TODO: When in employee form, if select address same as customer then auto fill
watch(