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