From c7cce35db7edc2472bf12397791891cb983fcafb Mon Sep 17 00:00:00 2001 From: Net <93821485+somnetsak123@users.noreply.github.com> Date: Thu, 13 Jun 2024 15:18:07 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E0=B8=84=E0=B9=89=E0=B8=99=E0=B8=AB?= =?UTF-8?q?=E0=B8=B2=20=E0=B8=82=E0=B8=AD=E0=B8=87=20Product=20type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/04_product-service/MainPage.vue | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/pages/04_product-service/MainPage.vue b/src/pages/04_product-service/MainPage.vue index c128bb91..d1abf410 100644 --- a/src/pages/04_product-service/MainPage.vue +++ b/src/pages/04_product-service/MainPage.vue @@ -13,11 +13,7 @@ import TooltipComponent from 'components/TooltipComponent.vue'; import { dialog } from 'src/stores/utils'; import useProductServiceStore from 'src/stores/product-service'; -import { - Product, - ProductCreate, - ProductUpdate, -} from 'src/stores/product-service/types'; +import { Product, ProductCreate } from 'src/stores/product-service/types'; const productServiceStore = useProductServiceStore(); @@ -79,7 +75,7 @@ const formData = ref({ const currentId = ref(''); const currentIdType = ref(''); const resultSearchGroup = ref(); -const resultSearchType = ref(); +const resultSearchType = ref<(Product & { productGroupId: string })[]>(); async function searchGroup() { const resultList = await fetchListProductService({ @@ -110,6 +106,17 @@ async function fetchListGroups() { } } +async function searchType() { + const res = await await fetchListProductServiceType({ + query: inputSearch.value, + productGroupId: currentId.value, + }); + + if (res) { + resultSearchType.value = res; + } +} + async function submitType() { if (drawerInfo.value) { await editProductServiceType(currentIdType.value, { @@ -339,7 +346,7 @@ watch(productMode, () => (inputSearch.value = '')); productMode === 'group' ? searchGroup() : productMode === 'type' - ? console.log('type') + ? searchType() : '' " >