From 37f1289b768b6bf8f1592b5c64cded7a14a9cdbf Mon Sep 17 00:00:00 2001 From: Net <93821485+somnetsak123@users.noreply.github.com> Date: Fri, 21 Jun 2024 11:40:18 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E0=B8=AA=E0=B8=A3=E0=B9=89=E0=B8=B2?= =?UTF-8?q?=E0=B8=87=20service?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/04_product-service/MainPage.vue | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/pages/04_product-service/MainPage.vue b/src/pages/04_product-service/MainPage.vue index 743ceb68..a346ef62 100644 --- a/src/pages/04_product-service/MainPage.vue +++ b/src/pages/04_product-service/MainPage.vue @@ -489,10 +489,23 @@ function clearFormService() { }, work: [], }; + + selectProduct.value = []; dialogService.value = false; } +function assignFormDataProductServiceCreate() { + workItems.value.forEach((item) => { + formDataProductService.value.work.push({ + name: item.name, + attributes: item.attributes, + productId: item.product.map((productItem) => productItem.id), + }); + }); +} + async function submitService() { + assignFormDataProductServiceCreate(); const res = await createService(formDataProductService.value); if (res) { await fetchListOfService(); @@ -1406,6 +1419,16 @@ watch(currentStatus, async () => { v-model:modal="dialogService" v-model:tabs-list="serviceTab" v-model:current-tab="currentServiceTab" + :submit=" + () => { + submitService(); + } + " + :close=" + () => { + dialogService = false; + } + " >