From 978a62be78fc6b10ecb7f249e8581290156073ce Mon Sep 17 00:00:00 2001 From: Net Date: Thu, 1 Aug 2024 15:56:59 +0700 Subject: [PATCH] refactor: add emit remove --- .../FormEmployeeHealthCheck.vue | 11 ++++++++++- .../FormEmployeeWorkHistory.vue | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/components/03_customer-management/FormEmployeeHealthCheck.vue b/src/components/03_customer-management/FormEmployeeHealthCheck.vue index 1eb0ab13..6b5e01b6 100644 --- a/src/components/03_customer-management/FormEmployeeHealthCheck.vue +++ b/src/components/03_customer-management/FormEmployeeHealthCheck.vue @@ -173,7 +173,16 @@ const insuranceCompanyFilter = selectFilterOptionRefMod( padding="xs" color="red" :class="{ dark: $q.dark.isActive }" - @click.stop="removeData(index)" + @click.stop=" + () => { + if (employeeCheckup?.[index].statusSave) { + $emit('remove', index); + removeData(index); + } else { + removeData(index); + } + } + " /> diff --git a/src/components/03_customer-management/FormEmployeeWorkHistory.vue b/src/components/03_customer-management/FormEmployeeWorkHistory.vue index 72b43e68..a4dd0b51 100644 --- a/src/components/03_customer-management/FormEmployeeWorkHistory.vue +++ b/src/components/03_customer-management/FormEmployeeWorkHistory.vue @@ -136,7 +136,16 @@ const workplaceFilter = selectFilterOptionRefMod( padding="xs" color="red" :class="{ dark: $q.dark.isActive }" - @click.stop="removeData(index)" + @click.stop=" + () => { + if (employeeWork?.[index].statusSave) { + $emit('remove', index); + removeData(index); + } else { + removeData(index); + } + } + " />