From 36793f4741ec918d4a71fbfdf5d5e8d96f7bc642 Mon Sep 17 00:00:00 2001 From: puriphatt Date: Tue, 6 Aug 2024 04:51:17 +0000 Subject: [PATCH] fix(03): employee form --- .../FormEmployeeHealthCheck.vue | 126 +-- .../FormEmployeeOther.vue | 74 +- .../FormEmployeeWorkHistory.vue | 803 ++++++++---------- src/pages/03_customer-management/MainPage.vue | 108 ++- 4 files changed, 499 insertions(+), 612 deletions(-) diff --git a/src/components/03_customer-management/FormEmployeeHealthCheck.vue b/src/components/03_customer-management/FormEmployeeHealthCheck.vue index e631ba1d..f497ea29 100644 --- a/src/components/03_customer-management/FormEmployeeHealthCheck.vue +++ b/src/components/03_customer-management/FormEmployeeHealthCheck.vue @@ -46,7 +46,6 @@ withDefaults( dense?: boolean; outlined?: boolean; readonly?: boolean; - separator?: boolean; typeCustomer?: string; prefixId: string; showBtnSave?: boolean; @@ -57,7 +56,7 @@ withDefaults( ); defineEmits<{ - (e: 'save', id: string): void; + (e: 'save', index: number): void; }>(); async function fetchProvince() { @@ -73,7 +72,8 @@ async function fetchProvince() { } function addCheckup() { - const canAdd = checkTabBeforeAdd(employeeCheckup.value || []); + // const canAdd = checkTabBeforeAdd(employeeCheckup.value || []); + const canAdd = true; if (canAdd) { employeeCheckup.value?.push({ coverageExpireDate: null, @@ -136,72 +136,6 @@ const insuranceCompanyFilter = selectFilterOptionRefMod( - - - - - + diff --git a/src/components/03_customer-management/FormEmployeeOther.vue b/src/components/03_customer-management/FormEmployeeOther.vue index 3e132d2d..52579a1b 100644 --- a/src/components/03_customer-management/FormEmployeeOther.vue +++ b/src/components/03_customer-management/FormEmployeeOther.vue @@ -1,31 +1,33 @@ diff --git a/src/components/03_customer-management/FormEmployeeWorkHistory.vue b/src/components/03_customer-management/FormEmployeeWorkHistory.vue index aacea442..4e2141af 100644 --- a/src/components/03_customer-management/FormEmployeeWorkHistory.vue +++ b/src/components/03_customer-management/FormEmployeeWorkHistory.vue @@ -23,23 +23,21 @@ const workplaceOption = defineModel<{ label: string; value: string }[]>( const tab = ref(); -withDefaults( - defineProps<{ - title?: string; - dense?: boolean; - outlined?: boolean; - readonly?: boolean; - separator?: boolean; - prefixId: string; - showBtnSave: boolean; - }>(), - { - showBtnSave: false, - }, -); +defineProps<{ + title?: string; + dense?: boolean; + outlined?: boolean; + readonly?: boolean; + prefixId: string; +}>(); + +defineEmits<{ + (e: 'save', index: number): void; +}>(); function addData() { - const canAdd = checkTabBeforeAdd(employeeWork.value || []); + // const canAdd = checkTabBeforeAdd(employeeWork.value || []); + const canAdd = true; if (canAdd) { employeeWork.value?.push({ workEndDate: null, @@ -94,427 +92,372 @@ const workplaceFilter = selectFilterOptionRefMod( - + diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index 1b286d67..278b91c0 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -43,6 +43,8 @@ import { storeToRefs } from 'pinia'; import ProfileBanner from 'src/components/ProfileBanner.vue'; import ImageUploadDialog from 'src/components/ImageUploadDialog.vue'; import FormEmployeeHealthCheck from 'src/components/03_customer-management/FormEmployeeHealthCheck.vue'; +import FormEmployeeWorkHistory from 'src/components/03_customer-management/FormEmployeeWorkHistory.vue'; +import FormEmployeeOther from 'src/components/03_customer-management/FormEmployeeOther.vue'; import useOptionStore from 'src/stores/options'; const { t, locale } = useI18n(); @@ -1861,28 +1863,53 @@ function createEmployeeForm() {
-
+
+ +