diff --git a/src/components/03_customer-management/CustomerInfoComponent.vue b/src/components/03_customer-management/CustomerInfoComponent.vue index 1c95e05b..8d39392d 100644 --- a/src/components/03_customer-management/CustomerInfoComponent.vue +++ b/src/components/03_customer-management/CustomerInfoComponent.vue @@ -4,7 +4,7 @@ import AppBox from 'components/app/AppBox.vue'; import BranchCardCustomer from 'components/03_customer-management/BranchCardCustomer.vue'; import { onMounted } from 'vue'; import useCustomerStore from 'src/stores/customer'; -import { CustomerBranch } from 'src/stores/customer/types'; +import { CustomerBranch, Customer } from 'src/stores/customer/types'; const userCustomer = useCustomerStore(); const { fetchListById } = userCustomer; @@ -13,8 +13,9 @@ const inputSearch = ref(''); const branch = defineModel('branch'); const currentCustomerName = defineModel('currentCustomerName'); -const currentCustomerUrlImage = defineModel('currentCustomerUrlImage'); +const currentCustomerUrlImage = ref(); +const returnCustomer = ref(); const prop = withDefaults( defineProps<{ color?: 'purple' | 'green'; @@ -25,15 +26,20 @@ const prop = withDefaults( }, ); -defineEmits<{ +const emit = defineEmits<{ (e: 'back'): void; - (e: 'viewDetail'): void; + ( + e: 'viewDetail', + returnCustomer: Customer & { branch: CustomerBranch[] }, + ): void; + (e: 'dialog'): void; }>(); onMounted(async () => { const result = await fetchListById(prop.customerId); if (result) { + returnCustomer.value = result; currentCustomerName.value = result.customerName; currentCustomerUrlImage.value = result.imageUrl; branch.value = result.branch; @@ -140,9 +146,12 @@ onMounted(async () => { -
+
- +