diff --git a/public/option/option.json b/public/option/option.json index 79d36b0d..6e050cbb 100644 --- a/public/option/option.json +++ b/public/option/option.json @@ -1,5 +1,51 @@ { "eng": { + "workerStatus": [ + { + "label": "Normal", + "value": "normal" + }, + { + "label": "Service Canceled", + "value": "canceled" + }, + { + "label": "Resigned", + "value": "resigned" + }, + { + "label": "Absconded", + "value": "absconded" + }, + { + "label": "Deceased", + "value": "deceased" + }, + { + "label": "Repatriated to Home Country", + "value": "repatriated" + }, + { + "label": "Did Not Enter Thailand", + "value": "not_entered" + } + ], + + "workerType": [ + { + "label": "Bangkok Bank", + "value": "mou" + }, + { + "label": "Nationality Verification Group", + "value": "ืืnvg" + }, + { + "label": "Border Pass Group", + "value": "bp" + } + ], + "bankBook": [ { "label": "Bangkok Bank", @@ -1001,6 +1047,52 @@ }, "tha": { + "workerStatus": [ + { + "label": "ปกติ", + "value": "normal" + }, + { + "label": "ยกเลิกบริการ", + "value": "canceled" + }, + { + "label": "ลาออก", + "value": "resigned" + }, + { + "label": "หลบหนี", + "value": "absconded" + }, + { + "label": "เสียชีวิต", + "value": "deceased" + }, + { + "label": "ส่งกลับประเทศต้นทาง", + "value": "repatriated" + }, + { + "label": "ไม่ได้เดินทางเข้าประเทศไทย", + "value": "not_entered" + } + ], + + "workerType": [ + { + "label": "กลุ่ม MOU", + "value": "mou" + }, + { + "label": "กลุ่ม พิสูจน์สัญชาติ", + "value": "ืืnvg" + }, + { + "label": "กลุ่ม Border pass ", + "value": "bp" + } + ], + "bankBook": [ { "label": "ธนาคารกรุงเทพ", diff --git a/src/components/03_customer-management/FormEmployeePassport.vue b/src/components/03_customer-management/FormEmployeePassport.vue index 02bf9a5f..bd7df57b 100644 --- a/src/components/03_customer-management/FormEmployeePassport.vue +++ b/src/components/03_customer-management/FormEmployeePassport.vue @@ -1,12 +1,12 @@ diff --git a/src/components/03_customer-management/FormEmployeeVisa.vue b/src/components/03_customer-management/FormEmployeeVisa.vue index 1d49374e..eb571911 100644 --- a/src/components/03_customer-management/FormEmployeeVisa.vue +++ b/src/components/03_customer-management/FormEmployeeVisa.vue @@ -32,9 +32,17 @@ const visaIssuingPlace = defineModel('visaIssuingPlace'); const visaStayUntilDate = defineModel( 'visaStayUntilDate', ); +const entryCount = defineModel('entryCount'); +const issueCountry = defineModel('issueCountry'); + const tm6Number = defineModel('tm6Number'); const entryDate = defineModel('entryDate'); +const workerType = defineModel('workerType'); +const dayNext = defineModel('dayNext'); +const tmNo = defineModel('tmNo'); +const enteredCheckpoint = defineModel('enteredCheckpoint'); + defineProps<{ title?: string; dense?: boolean; @@ -47,6 +55,14 @@ defineProps<{ ocr?: boolean; }>(); +async function calculate90DayNext(currentDate: Date) { + const futureDate = new Date(currentDate); + + // Add 90 days to the current date + futureDate.setDate(currentDate.getDate() + 90); + + return futureDate; +} async function fetchProvince() { const result = await addressStore.fetchProvince(); @@ -63,12 +79,24 @@ let visaTypeFilter: ( update: (callbackFn: () => void, afterFn?: (ref: QSelect) => void) => void, ) => void; +const workerTypeOptions = ref[]>([]); +let workerTypeFilter: ( + value: string, + update: (callbackFn: () => void, afterFn?: (ref: QSelect) => void) => void, +) => void; + onMounted(() => { visaTypeFilter = selectFilterOptionRefMod( ref(optionStore.globalOption?.nationality), visaTypeOptions, 'label', ); + + workerTypeFilter = selectFilterOptionRefMod( + ref(optionStore.globalOption?.workerType), + workerTypeOptions, + 'label', + ); }); watch( @@ -79,150 +107,442 @@ watch( visaTypeOptions, 'label', ); + + workerTypeFilter = selectFilterOptionRefMod( + ref(optionStore.globalOption?.workerType), + workerTypeOptions, + 'label', + ); }, ); + + diff --git a/src/i18n/eng.ts b/src/i18n/eng.ts index 4e99594a..94405c88 100644 --- a/src/i18n/eng.ts +++ b/src/i18n/eng.ts @@ -491,6 +491,7 @@ export default { table: { orderNumber: 'No.', fullname: 'Full Name', + fullnameEN: 'Full Name', titleName: 'Name', businessTypePure: 'Business Type', jobPosition: 'Job Position', @@ -516,6 +517,8 @@ export default { other: 'Other', family: 'Family', }, + workerStatus: 'Worker Status', + previousPassportNumber: 'Previous Passport Number', employerBranch: 'Employer Branch', employeeCode: 'Employee Code', nrcNo: 'Non-Thai Identification Number (N.R.C No.)', @@ -541,7 +544,14 @@ export default { visaTM6: 'TM.6 Number (Arrival)', visaEnter: 'Date of Entry into the Country', visaExpireDate: 'Visa Expiry Date', - + visa90Day: '90-day report next time', + arrivalCardNo: 'Arrival Card, Number TM', + visaCheckpoint: 'Entered through the checkpoint', + workerType: 'Type of worker', + placeOfBirth: 'Place of Birth', + countryOfbirth: 'Country of Birth', + issueCountry: 'Issue Country', + entryCount: 'Entry Count', employerSelect: { branchName: 'Branch Name', customerName: 'Employer Name', diff --git a/src/i18n/tha.ts b/src/i18n/tha.ts index c7e55c8d..6bcfd50b 100644 --- a/src/i18n/tha.ts +++ b/src/i18n/tha.ts @@ -487,6 +487,7 @@ export default { table: { orderNumber: 'ลําดับ', fullname: 'ชื่อ-นามสกุล', + fullnameEN: 'ชื่อ-นามสกุล ภาษาอังกฤษ', titleName: 'ชื่อ บริษัท/นิติบุคคล', businessTypePure: 'ประเภทกิจการ', jobPosition: 'ตำแหน่งงาน', @@ -512,6 +513,8 @@ export default { other: 'ข้อมูลอื่นๆ', family: 'ข้อมูลครอบครัว', }, + workerStatus: 'สถานะคนงาน', + previousPassportNumber: 'หมายเลขอันเก่าหนังสือเดินทาง', employerBranch: 'สาขานายจ้าง', employeeCode: 'รหัสลูกจ้าง', nrcNo: 'เลขบัตรประจำตัวคนซึ่งไม่มีสัญชาติไทย (N.R.C No.)', @@ -537,7 +540,14 @@ export default { visaTM6: 'เลขที่ใบ ตม.6 (ใบขาเข้า)', visaEnter: 'วันที่เดินทางเข้ามาในประเทศ', visaExpireDate: 'วันหมดอายุ visa', - + visa90Day: 'รายงานตัว 90 วัน ครั้งต่อไป', + arrivalCardNo: 'บัตรขาเข้า หมายเลข TM', + visaCheckpoint: 'เดินทางเข้ามาทางด่าน', + workerType: 'ประเภทคนงาน', + placeOfBirth: 'สถานที่เกิด', + countryOfbirth: 'ประเทศที่เกิด', + issueCountry: 'ประเทศที่ออก', + entryCount: 'จำนวนที่เข้าประเทศ', employerSelect: { branchName: 'ชื่อสาขา', customerName: 'ชื่อนายจ้าง', diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index 24d44fd8..e41e98b5 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -46,7 +46,6 @@ import FormPerson from 'components/02_personnel-management/FormPerson.vue'; import { EmployerFormBasicInfo, EmployerFormBranch } from './components'; import BranchPage from './BranchPage.vue'; import FormEmployeePassport from 'components/03_customer-management/FormEmployeePassport.vue'; -import FormEmployeeVisa from 'components/03_customer-management/FormEmployeeVisa.vue'; import DialogForm from 'components/DialogForm.vue'; import SideMenu from 'components/SideMenu.vue'; import TableEmpoloyee from 'src/components/03_customer-management/TableEmpoloyee.vue'; @@ -77,6 +76,7 @@ import useOptionStore from 'stores/options'; import { DialogContainer, DialogHeader } from 'components/dialog'; import KebabAction from 'src/components/shared/KebabAction.vue'; import { nextTick } from 'vue'; +import FormEmployeeVisa from 'components/03_customer-management/FormEmployeeVisa.vue'; const { t, locale } = useI18n(); const $q = useQuasar(); @@ -464,7 +464,7 @@ async function toggleStatusCustomer(id: string, status: boolean) { async function deleteEmployeeById(opts: { id?: string; - type?: 'passport' | 'healthCheck' | 'work'; + type?: 'passport' | 'visa' | 'healthCheck' | 'work'; }) { dialog({ color: 'negative', @@ -478,6 +478,10 @@ async function deleteEmployeeById(opts: { await employeeFormStore.deletePassport(); } + if (opts.type === 'visa') { + await employeeFormStore.deleteVisa(); + } + if (opts.type === 'healthCheck') { await employeeFormStore.deleteHealthCheck(); } @@ -2300,6 +2304,10 @@ const emptyCreateDialog = ref(false); await employeeFormStore.submitPassport(); } + if (employeeFormState.currentTab === 'visa') { + await employeeFormStore.submitVisa(); + } + if (employeeFormState.currentTab === 'healthCheck') { await employeeFormStore.submitHealthCheck(); } @@ -2370,6 +2378,11 @@ const emptyCreateDialog = ref(false); name: 'passport', label: 'customerEmployee.fileType.passport', }, + { + name: 'visa', + label: 'customerEmployee.form.group.visa', + }, + { name: 'healthCheck', label: 'customerEmployee.form.group.healthCheck', @@ -2479,6 +2492,20 @@ const emptyCreateDialog = ref(false); sub: true, })) || []), + { + name: $t('customerEmployee.form.group.visa'), + anchor: 'drawer-visa', + tab: 'visa', + useBtn: true, + }, + + ...(currentFromDataEmployee.employeeVisa?.map((v, i) => ({ + name: dateFormat(v.expireDate), + anchor: `drawer-employee-visa-${i}`, + tab: 'visa', + sub: true, + })) || []), + ...(currentFromDataEmployee.employeeCheckup?.map((v, i) => ({ name: $t('general.times', { number: i + 1 }), anchor: `form-employee-checkup-${i}`, @@ -2953,6 +2980,8 @@ const emptyCreateDialog = ref(false); v-model:visa-issue-date="meta.issueDate" v-model:visa-expiry-date="meta.expireDate" v-model:visa-issuing-place="meta.issuePlace" + v-model:entry-count="meta.entryCount" + v-model:issue-country="meta.issueCountry" /> @@ -3091,6 +3120,114 @@ const emptyCreateDialog = ref(false); + + + + @@ -4483,6 +4655,8 @@ const emptyCreateDialog = ref(false); v-model:visa-issue-date="meta.issueDate" v-model:visa-expiry-date="meta.expireDate" v-model:visa-issuing-place="meta.issuePlace" + v-model:entry-count="meta.entryCount" + v-model:issue-country="meta.issueCountry" /> @@ -4619,6 +4793,115 @@ const emptyCreateDialog = ref(false); + + +