From e70fafe203cd5c3f891af2d4a63216569cd4d1b6 Mon Sep 17 00:00:00 2001 From: Thanaphon Frappet Date: Tue, 12 Nov 2024 16:01:43 +0700 Subject: [PATCH] refactor: add group value --- .../upload-file/UploadFileGroup.vue | 7 +- src/pages/03_customer-management/constant.ts | 67 ++++++++++++------- 2 files changed, 50 insertions(+), 24 deletions(-) diff --git a/src/components/upload-file/UploadFileGroup.vue b/src/components/upload-file/UploadFileGroup.vue index a51b5652..33974bb7 100644 --- a/src/components/upload-file/UploadFileGroup.vue +++ b/src/components/upload-file/UploadFileGroup.vue @@ -53,7 +53,12 @@ const props = withDefaults( autoSave?: boolean; hideAction?: boolean; columns: QTableProps['columns']; - menu?: { label: string; value: string; _meta?: Record }[]; + menu?: { + label: string; + group: string; + value: string; + _meta?: Record; + }[]; }>(), {}, ); diff --git a/src/pages/03_customer-management/constant.ts b/src/pages/03_customer-management/constant.ts index c9a98b0c..7674a4ea 100644 --- a/src/pages/03_customer-management/constant.ts +++ b/src/pages/03_customer-management/constant.ts @@ -64,60 +64,72 @@ export const countryCode = [ export const uploadFileListCustomer: { label: string; value: string; + group: string; _meta?: Record; }[] = [ { label: 'customer.typeFile.citizenId', value: 'citizen', + group: 'citizen', }, { label: 'customer.typeFile.registrationBook', - value: 'house-registration', + value: 'attachment', + group: 'houseRegistration', }, { label: 'customer.typeFile.houseMap', - value: 'vat-registration', + value: 'attachment', + group: 'vatRegistration', }, { label: 'customer.typeFile.businessRegistration', - value: 'commercial-registration', + group: 'commercialRegistration', + value: 'attachment', }, { label: 'customer.typeFile.dbdCertificate', - value: 'power-of-attorney', + group: 'powerOfAttorney', + value: 'attachment', }, { label: 'customer.typeFile.vatRegistrationCertificate', - value: 'vatRegistrationCertificate', + group: 'vatRegistrationCertificate', + value: 'attachment', }, { label: 'customer.typeFile.powerOfAttorney', - value: 'powerOfAttorney', + group: 'powerOfAttorney', + value: 'attachment', }, { label: 'customer.typeFile.others', - value: 'others', + group: 'others', + value: 'attachment', }, ]; export const uploadFileListEmployee: { label: string; + group: string; value: string; _meta?: Record; }[] = [ { label: 'customerEmployee.fileType.passport', value: 'passport', + group: 'passport', }, { label: 'customerEmployee.fileType.visa', value: 'visa', + group: 'visa', _meta: { number: '', type: '', @@ -132,35 +144,43 @@ export const uploadFileListEmployee: { }, { label: 'customerEmployee.fileType.tm6', - value: 'tm6', + value: 'attachment', + group: 'tm6', }, { label: 'customerEmployee.fileType.workPermit', - value: 'other', + value: 'attachment', + group: 'workPermit', }, { label: 'customerEmployee.fileType.noticeJobEmployment', - value: 'noticeJobEmployment', + value: 'attachment', + group: 'noticeJobEmployment', }, { label: 'customerEmployee.fileType.noticeJobEntry', - value: 'other', + value: 'attachment', + group: 'noticeJobEntry', }, { label: 'customerEmployee.fileType.historyJob', - value: 'other', + value: 'attachment', + group: 'historyJob', }, { label: 'customerEmployee.fileType.acceptJob', - value: 'other', + value: 'attachment', + group: 'acceptJob', }, { label: 'customerEmployee.fileType.receipt', - value: 'other', + value: 'attachment', + group: 'receipt', }, { label: 'customerEmployee.fileType.other', - value: 'other', + value: 'attachment', + group: 'other', }, ]; @@ -172,16 +192,17 @@ export const columnsAttachment = [ field: 'branchNo', }, { - name: 'document', - align: 'center', - label: 'general.document', - field: 'attachmentName', - }, - { - name: 'uploadDate', + name: 'createdAt', align: 'center', label: 'general.uploadDate', - field: 'uploadDate', + field: 'attachmentName', + }, + + { + name: 'ัexpireDate', + align: 'center', + label: 'general.expirationDate', + field: 'attachmentName', }, {