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; + } + " >