From 9b0b57ac3f3182a70958f5274c94bcd17b7814a2 Mon Sep 17 00:00:00 2001 From: puriphatt Date: Wed, 17 Sep 2025 17:20:47 +0700 Subject: [PATCH] fix: customer & employee image list --- .../03_customer-management/DialogEmployee.vue | 1646 ++++++++++++++++ .../03_customer-management/DrawerEmployee.vue | 99 + .../03_customer-management/BranchPage.vue | 51 +- src/pages/03_customer-management/MainPage.vue | 12 +- .../03_customer-management/TabCustomer.vue | 10 +- .../03_customer-management/TabEmployee.vue | 1649 +---------------- src/pages/03_customer-management/form.ts | 5 + 7 files changed, 1816 insertions(+), 1656 deletions(-) create mode 100644 src/components/03_customer-management/DialogEmployee.vue diff --git a/src/components/03_customer-management/DialogEmployee.vue b/src/components/03_customer-management/DialogEmployee.vue new file mode 100644 index 00000000..cfd4088a --- /dev/null +++ b/src/components/03_customer-management/DialogEmployee.vue @@ -0,0 +1,1646 @@ + + diff --git a/src/components/03_customer-management/DrawerEmployee.vue b/src/components/03_customer-management/DrawerEmployee.vue index 5cbdde66..c5e94e79 100644 --- a/src/components/03_customer-management/DrawerEmployee.vue +++ b/src/components/03_customer-management/DrawerEmployee.vue @@ -22,6 +22,7 @@ import FormEmployeePassport from './FormEmployeePassport.vue'; import FormEmployeeVisa from './FormEmployeeVisa.vue'; import FormEmployeeWorkHistory from './FormEmployeeWorkHistory.vue'; import ExpirationDate from 'components/03_customer-management/ExpirationDate.vue'; +import ImageUploadDialog from '../ImageUploadDialog.vue'; import useOcrStore from 'stores/ocr'; import useOptionStore from 'src/stores/options'; @@ -58,6 +59,7 @@ const { state: employeeFormState, currentFromDataEmployee, refreshImageState, + onCreateImageList, } = storeToRefs(employeeFormStore); const { state: customerFormState, currentFormData: customerFormData } = storeToRefs(customerFormStore); @@ -71,7 +73,13 @@ const props = defineProps<{ customerId?: string; mobileFetch?: boolean; }) => Promise; + fetchImageList: ( + id: string, + selectedName: string, + type: 'customer' | 'employee', + ) => Promise; }>(); + const mrz = defineModel>>('mrz'); defineEmits<{ @@ -1668,4 +1676,95 @@ defineEmits<{ + + + + + diff --git a/src/pages/03_customer-management/BranchPage.vue b/src/pages/03_customer-management/BranchPage.vue index ef8ab8f5..dd8c4737 100644 --- a/src/pages/03_customer-management/BranchPage.vue +++ b/src/pages/03_customer-management/BranchPage.vue @@ -18,6 +18,8 @@ import { CustomerBranch, CustomerType } from 'stores/customer/types'; import { columnsEmployee } from './constant'; import { useCustomerBranchForm, useEmployeeForm } from './form'; +import DialogEmployee from 'src/components/03_customer-management/DialogEmployee.vue'; +import DrawerEmployee from 'src/components/03_customer-management/DrawerEmployee.vue'; import EmployerFormAuthorized from './components/employer/EmployerFormAuthorized.vue'; import FloatingActionButton from 'components/FloatingActionButton.vue'; import SideMenu from 'components/SideMenu.vue'; @@ -89,6 +91,11 @@ const prop = withDefaults( currentCitizenId?: string; gender: string; selectedImage: string; + fetchImageList: ( + id: string, + selectedName: string, + type: 'customer' | 'employee', + ) => Promise; }>(), { color: 'green', @@ -96,7 +103,6 @@ const prop = withDefaults( ); const currentBranchEmployee = ref(''); const listEmployee = ref([]); - const customerId = defineModel('customerId', { required: true }); defineEmits<{ @@ -106,16 +112,6 @@ defineEmits<{ (e: 'dialog'): void; }>(); -onMounted(async () => { - customerBranchFormState.value.currentCustomerId = route.params - .customerId as string; - await fetchList(); - - branch.value?.forEach((v) => { - currentBtnOpen.value.push(false); - }); -}); - const columns = [ { name: 'branchName', @@ -257,10 +253,6 @@ async function fetchEmployee(opts: { branchId: string; pageSize?: number }) { } } -onMounted(async () => { - await fetchList(); -}); - watch([customerId, inputSearch, currentStatus, pageSizeBranch], async () => { await fetchList(); }); @@ -280,6 +272,16 @@ watch( } }, ); + +onMounted(async () => { + customerBranchFormState.value.currentCustomerId = route.params + .customerId as string; + await fetchList(); + + branch.value?.forEach((v) => { + currentBtnOpen.value.push(false); + }); +}); + + + +