diff --git a/public/images/customer-legal-avartar.png b/public/images/customer-CORP-avartar.png similarity index 100% rename from public/images/customer-legal-avartar.png rename to public/images/customer-CORP-avartar.png diff --git a/public/images/customer-legal-banner-bg.jpg b/public/images/customer-CORP-banner-bg.jpg similarity index 100% rename from public/images/customer-legal-banner-bg.jpg rename to public/images/customer-CORP-banner-bg.jpg diff --git a/public/images/customer-PERS-avartar.png b/public/images/customer-PERS-avartar.png new file mode 100644 index 00000000..3ae92fdd Binary files /dev/null and b/public/images/customer-PERS-avartar.png differ diff --git a/public/images/customer-PERS-banner-bg.jpg b/public/images/customer-PERS-banner-bg.jpg new file mode 100644 index 00000000..34a7861a Binary files /dev/null and b/public/images/customer-PERS-banner-bg.jpg differ diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index aa0c23d1..24384864 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -382,6 +382,7 @@ async function editCustomerForm(id: string) { await customerFormStore.assignFormData(id); customerFormState.value.dialogType = 'edit'; customerFormState.value.dialogModal = true; + customerFormState.value.editCustomerId = id; } function createCustomerForm(customerType: 'CORP' | 'PERS') { @@ -1644,8 +1645,9 @@ function createCustomerForm(customerType: 'CORP' | 'PERS') { }) " :submit=" - () => { - customerFormStore.submitForm(); + async () => { + await customerFormStore.submitForm(); + await fetchListCustomer(); } " :close="() => (customerFormState.dialogModal = false)" @@ -1659,10 +1661,10 @@ function createCustomerForm(customerType: 'CORP' | 'PERS') { customerFormState.customerImageUrl === '' || customerFormState.customerImageUrl === null " - fallback-cover="/images/customer-legal-banner-bg.jpg" + :fallback-cover="`/images/customer-${customerFormData.customerType}-banner-bg.jpg`" :img=" customerFormState.customerImageUrl || - '/images/customer-legal-avartar.png' + `/images/customer-${customerFormData.customerType}-avartar.png` " color="hsla(var(--pink-6-hsl)/1)" bg-color="hsla(var(--pink-6-hsl)/0.15)" @@ -1701,7 +1703,6 @@ function createCustomerForm(customerType: 'CORP' | 'PERS') { id="customer-form-content" style="height: 100%; max-height: 100%; overflow-y: auto" > - {{ customerFormData.customerType }} diff --git a/src/pages/03_customer-management/form.ts b/src/pages/03_customer-management/form.ts index 2be84d31..485f5712 100644 --- a/src/pages/03_customer-management/form.ts +++ b/src/pages/03_customer-management/form.ts @@ -177,6 +177,10 @@ export const useCustomerForm = defineStore('form-customer', () => { await customerStore.editById(state.value.editCustomerId, { ...currentFormData.value, + status: + currentFormData.value.status !== 'CREATED' + ? currentFormData.value.status + : undefined, image: currentFormData.value.image || undefined, customerBranch: undefined, });