From c2e869a74cea1a1bb8c0cf3b68619cc61acdf2b3 Mon Sep 17 00:00:00 2001 From: Net Date: Thu, 1 Aug 2024 11:57:20 +0700 Subject: [PATCH] refactor: add props showBtnSave --- .../BasicInformation.vue | 28 +++++++++++-------- src/pages/03_customer-management/MainPage.vue | 4 +++ 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/components/03_customer-management/BasicInformation.vue b/src/components/03_customer-management/BasicInformation.vue index a46d7cf9..d98300b6 100644 --- a/src/components/03_customer-management/BasicInformation.vue +++ b/src/components/03_customer-management/BasicInformation.vue @@ -31,16 +31,22 @@ const customerBranch = defineModel<{ const employeeId = defineModel('employeeId'); const nrcNo = defineModel('nrcNo'); -const props = defineProps<{ - dense?: boolean; - outlined?: boolean; - readonly?: boolean; - separator?: boolean; - typeCustomer?: string; - employee?: boolean; - employeeOwnerOption?: CustomerBranch[]; - prefixId: string; -}>(); +const props = withDefaults( + defineProps<{ + dense?: boolean; + outlined?: boolean; + readonly?: boolean; + separator?: boolean; + typeCustomer?: string; + employee?: boolean; + employeeOwnerOption?: CustomerBranch[]; + prefixId: string; + showBtnSave: boolean; + }>(), + { + showBtnSave: false, + }, +); defineEmits<{ (e: 'filterOwnerBranch', val: string, update: void): void; @@ -440,7 +446,7 @@ onMounted(() => {
(); async function triggerCreate(type: CustomerType) { + countStartsOne.value = 1; customerType.value = type; await fetchListOfOptionBranch(); openDialogInputForm(); @@ -3159,6 +3160,7 @@ watch(isMainPage, () => { v-model:customer-name-en="formData.customerNameEN" v-model:person-name="formData.personName" v-model:tax-no="formData.taxNo" + :show-btn-save="true" @save=" async () => { await onSubmitBasicInformation(); @@ -3309,6 +3311,7 @@ watch(isMainPage, () => { { dense outlined separator + :show-btn-save="true" :readonly="!infoDrawerEdit" :type-customer="customerType" v-model:options-branch="branchOption"