refactor: add uploadFile in EmployerFormBranch
This commit is contained in:
parent
82470fcda5
commit
055a8a1a9b
1 changed files with 30 additions and 5 deletions
|
|
@ -5,7 +5,11 @@ import EmployerFormBusiness from './EmployerFormBusiness.vue';
|
||||||
import EmployerFormContact from './EmployerFormContact.vue';
|
import EmployerFormContact from './EmployerFormContact.vue';
|
||||||
import { CustomerCreate } from 'stores/customer/types';
|
import { CustomerCreate } from 'stores/customer/types';
|
||||||
import EmployerFormAbout from './EmployerFormAbout.vue';
|
import EmployerFormAbout from './EmployerFormAbout.vue';
|
||||||
import EmployerFormAttachment from './EmployerFormAttachment.vue';
|
import EmployerFormBasicInfo from './EmployerFormBasicInfo.vue';
|
||||||
|
|
||||||
|
import useOcrStore from 'stores/ocr';
|
||||||
|
|
||||||
|
const ocrStore = useOcrStore();
|
||||||
import {
|
import {
|
||||||
SaveButton,
|
SaveButton,
|
||||||
EditButton,
|
EditButton,
|
||||||
|
|
@ -13,7 +17,7 @@ import {
|
||||||
UndoButton,
|
UndoButton,
|
||||||
} from 'components/button';
|
} from 'components/button';
|
||||||
import UploadFile from 'src/components/upload-file/UploadFile.vue';
|
import UploadFile from 'src/components/upload-file/UploadFile.vue';
|
||||||
import { uploadFileList } from '../../constant';
|
import { uploadFileListCustomer } from '../../constant';
|
||||||
|
|
||||||
const item = defineModel<NonNullable<CustomerCreate['customerBranch']>[number]>(
|
const item = defineModel<NonNullable<CustomerCreate['customerBranch']>[number]>(
|
||||||
'customerBranch',
|
'customerBranch',
|
||||||
|
|
@ -35,6 +39,7 @@ defineProps<{
|
||||||
prefixId?: string;
|
prefixId?: string;
|
||||||
actionDisabled?: boolean;
|
actionDisabled?: boolean;
|
||||||
customerType?: 'CORP' | 'PERS';
|
customerType?: 'CORP' | 'PERS';
|
||||||
|
treeFile?: { lable: string; file: { lable: string }[] }[];
|
||||||
}>();
|
}>();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -163,10 +168,30 @@ defineProps<{
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
<q-tab-panel name="attachment">
|
<q-tab-panel name="attachment">
|
||||||
<UploadFile
|
<UploadFile
|
||||||
:dropdown-list="uploadFileList"
|
|
||||||
v-model:file="item.file"
|
|
||||||
hide-action
|
hide-action
|
||||||
/>
|
:dropdown-list="uploadFileListCustomer"
|
||||||
|
v-model:file="item.file"
|
||||||
|
:tree-file="treeFile"
|
||||||
|
@send-ocr="
|
||||||
|
async (v: any, f: any) => {
|
||||||
|
await ocrStore.sendOcr({ file: f });
|
||||||
|
}
|
||||||
|
"
|
||||||
|
@save="
|
||||||
|
(group: any, file: any) => {
|
||||||
|
// const ext = file.name.split('.').at(-1);
|
||||||
|
// let filename = group + '-' + new Date().getTime();
|
||||||
|
// if (ext) filename += `.${ext}`;
|
||||||
|
// customerFormStore.putAttachment({
|
||||||
|
// branchId: item.id || '',
|
||||||
|
// file,
|
||||||
|
// filename,
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<template #form></template>
|
||||||
|
</UploadFile>
|
||||||
|
|
||||||
<!-- <EmployerFormAttachment
|
<!-- <EmployerFormAttachment
|
||||||
:readonly="readonly"
|
:readonly="readonly"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue