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 { CustomerCreate } from 'stores/customer/types';
|
||||
import EmployerFormAbout from './EmployerFormAbout.vue';
|
||||
import EmployerFormAttachment from './EmployerFormAttachment.vue';
|
||||
import EmployerFormBasicInfo from './EmployerFormBasicInfo.vue';
|
||||
|
||||
import useOcrStore from 'stores/ocr';
|
||||
|
||||
const ocrStore = useOcrStore();
|
||||
import {
|
||||
SaveButton,
|
||||
EditButton,
|
||||
|
|
@ -13,7 +17,7 @@ import {
|
|||
UndoButton,
|
||||
} from 'components/button';
|
||||
import UploadFile from 'src/components/upload-file/UploadFile.vue';
|
||||
import { uploadFileList } from '../../constant';
|
||||
import { uploadFileListCustomer } from '../../constant';
|
||||
|
||||
const item = defineModel<NonNullable<CustomerCreate['customerBranch']>[number]>(
|
||||
'customerBranch',
|
||||
|
|
@ -35,6 +39,7 @@ defineProps<{
|
|||
prefixId?: string;
|
||||
actionDisabled?: boolean;
|
||||
customerType?: 'CORP' | 'PERS';
|
||||
treeFile?: { lable: string; file: { lable: string }[] }[];
|
||||
}>();
|
||||
</script>
|
||||
|
||||
|
|
@ -163,10 +168,30 @@ defineProps<{
|
|||
</q-tab-panel>
|
||||
<q-tab-panel name="attachment">
|
||||
<UploadFile
|
||||
:dropdown-list="uploadFileList"
|
||||
v-model:file="item.file"
|
||||
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
|
||||
:readonly="readonly"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue