diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index c69d762b..0cdd4803 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -2319,8 +2319,8 @@ const emptyCreateDialog = ref(false); } " @send-ocr=" - async (_, file) => { - if (file) await ocrStore.sendOcr({ file }); + async (group, file) => { + if (file) await ocrStore.sendOcr({ file, category: group }); employeeFormState.ocr = false; } " @@ -3325,8 +3325,9 @@ const emptyCreateDialog = ref(false); } " @send-ocr=" - async (_, file) => { - if (file) await ocrStore.sendOcr({ file }); + async (group, file) => { + if (file) + await ocrStore.sendOcr({ file, category: group }); employeeFormState.ocr = false; } " diff --git a/src/pages/03_customer-management/components/employer/EmployerFormBranch.vue b/src/pages/03_customer-management/components/employer/EmployerFormBranch.vue index 8cf46852..673b3b2b 100644 --- a/src/pages/03_customer-management/components/employer/EmployerFormBranch.vue +++ b/src/pages/03_customer-management/components/employer/EmployerFormBranch.vue @@ -213,8 +213,11 @@ defineProps<{ ) " @send-ocr=" - async (v: any, f: any) => { - const res = await ocrStore.sendOcr({ file: f }); + async (group: any, file: any) => { + const res = await ocrStore.sendOcr({ + file: file, + category: group, + }); if (res) { const map = res.fields.reduce>( diff --git a/src/stores/ocr/index.ts b/src/stores/ocr/index.ts index bbf4ddf0..b3e6a24e 100644 --- a/src/stores/ocr/index.ts +++ b/src/stores/ocr/index.ts @@ -10,6 +10,7 @@ const useOcr = defineStore('useOcrStore', () => { async function sendOcr( payload: { file: File; + category: string; }, flow?: { sessionId?: string; @@ -22,7 +23,7 @@ const useOcr = defineStore('useOcrStore', () => { document: string; fields: { name: string; value: string }[]; result: string; - }>(`${baseUrl}/`, payload.file, { + }>(`${baseUrl}/?category=${payload.category}`, payload.file, { headers: { 'Content-Type': payload.file?.type }, onUploadProgress: (e) => console.log(e), })