feat: save image

This commit is contained in:
Methapon2001 2024-08-08 09:46:36 +07:00
parent ac1e8f71e9
commit 6286e2685a

View file

@ -1777,13 +1777,13 @@ watch(
<DialogContainer
:model-value="customerFormState.dialogModal"
:onOpen="
:on-open="
async () => {
await fetchListOfOptionBranch();
customerFormStore.resetForm(customerFormState.dialogType === 'create');
}
"
:onClose="() => (customerFormState.dialogModal = false)"
:on-close="() => (customerFormState.dialogModal = false)"
>
<template #header>
<DialogHeader
@ -1861,6 +1861,7 @@ watch(
await customerFormStore.submitFormCustomer();
customerFormState.readonly = true;
notify('create', $t('success'));
await fetchListCustomer();
}
"
:style="{
@ -1917,7 +1918,7 @@ watch(
/>
</div>
<q-form
@submit.prevent
@submit.prevent="async () => await fetchListCustomer()"
class="full-width"
v-if="customerFormData.customerBranch"
v-for="(_, idx) in customerFormData.customerBranch"
@ -2261,7 +2262,19 @@ watch(
customerFormState.dialogType === 'edit'
"
clear-button
@save="() => {}"
@save="
async (v) => {
if (
v &&
customerFormState.dialogType === 'edit' &&
customerFormState.editCustomerId
) {
await customerStore.setImage(customerFormState.editCustomerId, v);
await fetchListCustomer();
customerFormState.imageDialog = false;
}
}
"
>
<template #error>
<div class="full-height full-width" style="background: white">