From 2d8b9ebb92c55dec5b4f7f652da2917566005753 Mon Sep 17 00:00:00 2001 From: puriphatt Date: Thu, 27 Jun 2024 10:23:54 +0000 Subject: [PATCH] feat: history dialog --- .../HistoryEditComponent.vue | 191 +++++++++++++++++- src/components/home/PersonCard.vue | 18 +- src/i18n/en-US/customer-main-page.ts | 6 + src/i18n/th-th/customer-main-page.ts | 6 + src/pages/03_customer-management/MainPage.vue | 21 ++ 5 files changed, 233 insertions(+), 9 deletions(-) diff --git a/src/components/03_customer-management/HistoryEditComponent.vue b/src/components/03_customer-management/HistoryEditComponent.vue index 2aa81593..6f644de1 100644 --- a/src/components/03_customer-management/HistoryEditComponent.vue +++ b/src/components/03_customer-management/HistoryEditComponent.vue @@ -1,12 +1,189 @@ - + - + diff --git a/src/components/home/PersonCard.vue b/src/components/home/PersonCard.vue index 61c22800..114e763e 100644 --- a/src/components/home/PersonCard.vue +++ b/src/components/home/PersonCard.vue @@ -22,10 +22,12 @@ defineProps<{ noBg?: boolean; detailColumnCount?: number; canEditProfile?: boolean; + history?: boolean; }>(); defineEmits<{ (e: 'editProfile'): void; + (e: 'history', id: string): void; (e: 'deleteCard', id: string): void; ( e: 'updateCard', @@ -68,12 +70,24 @@ defineEmits<{
+ + diff --git a/src/i18n/en-US/customer-main-page.ts b/src/i18n/en-US/customer-main-page.ts index 5f474432..262bf959 100644 --- a/src/i18n/en-US/customer-main-page.ts +++ b/src/i18n/en-US/customer-main-page.ts @@ -45,4 +45,10 @@ export default { customerBranchName: 'Company/Legal Entity Name', allEmployee: 'All Employee', + + editHistory: 'Edit History', + time: 'Time', + editBy: 'Edit by', + valueBefore: 'Before', + valueAfter: 'After', }; diff --git a/src/i18n/th-th/customer-main-page.ts b/src/i18n/th-th/customer-main-page.ts index 089005ed..1f5f32a8 100644 --- a/src/i18n/th-th/customer-main-page.ts +++ b/src/i18n/th-th/customer-main-page.ts @@ -53,4 +53,10 @@ export default { officeType: '', allEmployee: 'ลูกจ้างทั้งหมด', + + editHistory: 'ประวัติการแก้ไข', + time: 'เวลา', + editBy: 'แก้ไขโดย', + valueBefore: 'แก้ไขใหม่', + valueAfter: 'ค่าเดิม', }; diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index 6da6cd3d..41c08b11 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -31,6 +31,7 @@ import DrawerInfo from 'src/components/DrawerInfo.vue'; import InfoForm from 'src/components/02_personnel-management/InfoForm.vue'; import CustomerInfoComponent from 'src/components/03_customer-management/CustomerInfoComponent.vue'; import NoData from 'components/NoData.vue'; +import HistoryEditComponent from 'src/components/03_customer-management/HistoryEditComponent.vue'; import { CustomerCreate, @@ -118,6 +119,7 @@ const formData = ref({ image: null, }); +const employeeHistoryDialog = ref(false); const inputSearch = ref(); const fieldSelectedCustomer = ref<{ label: string; value: string }>({ label: t('all'), @@ -1089,6 +1091,11 @@ async function checkEmployeeForm() { } else return true; } +async function openHistory(id: string) { + console.log(id); + employeeHistoryDialog.value = true; +} + onMounted(async () => { const resultStats = await getStatsCustomer(); @@ -1603,6 +1610,7 @@ watch(selectorLabel, async () => {
{ + + + + +