From 018edf688bdfd638841957b8cafb853295649cd5 Mon Sep 17 00:00:00 2001 From: Net <93821485+somnetsak123@users.noreply.github.com> Date: Wed, 26 Jun 2024 14:21:14 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84?= =?UTF-8?q?=E0=B8=82=E0=B8=AA=E0=B8=B4=E0=B8=99=E0=B8=84=E0=B9=89=E0=B8=B2?= =?UTF-8?q?=20=E0=B9=81=E0=B8=A5=E0=B8=B0=20=E0=B8=9A=E0=B8=A3=E0=B8=B4?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3=20=E0=B9=84=E0=B8=A1=E0=B9=88?= =?UTF-8?q?=E0=B8=AD=E0=B8=B1=E0=B8=9B=E0=B9=80=E0=B8=94=E0=B8=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/04_product-service/MainPage.vue | 30 ++++++++++++++--------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/pages/04_product-service/MainPage.vue b/src/pages/04_product-service/MainPage.vue index ae66ade6..c05a956f 100644 --- a/src/pages/04_product-service/MainPage.vue +++ b/src/pages/04_product-service/MainPage.vue @@ -763,24 +763,26 @@ async function submitService() { formDataProductService.value.productTypeId = currentIdType.value; if (dialogService.value) { - const res = await createService(formDataProductService.value); - if (res) { - await fetchListOfService(); - } + await createService(formDataProductService.value); + totalService.value = totalService.value + 1; } if (dialogServiceEdit.value) { - const res = await editService(currentIdService.value, { + await editService(currentIdService.value, { ...formDataProductService.value, status: statusToggle.value ? formDataProductService.value.status : 'INACTIVE', }); - if (res) { - await fetchListOfService(); - } } - totalService.value = totalService.value + 1; + + if (productAndServiceTab.value === 'all') { + await fetchListOfProductAndService(); + } + if (productAndServiceTab.value === 'service') { + await fetchListOfService(); + } + clearFormService(); } @@ -806,7 +808,13 @@ async function submitProduct() { } totalProduct.value = totalProduct.value + 1; clearFormProduct(); - await fetchListOfProduct(currentIdType.value); + + if (productAndServiceTab.value === 'all') { + await fetchListOfProductAndService(); + } + if (productAndServiceTab.value === 'product') { + await fetchListOfProduct(currentIdType.value); + } } async function submitGroup() { @@ -1003,7 +1011,7 @@ watch(currentPageService, async () => { :label="$t('addService')" external-label label-position="left" - style="color: white; background-color: hsla(var(--blue-11-hsl))" + style="color: white; background-color: hsla(var(--orange-6-hsl))" padding="xs" icon="mdi-folder-multiple-plus" @click="