diff --git a/components/AssMea.vue b/components/AssMea.vue new file mode 100644 index 0000000..86c5b97 --- /dev/null +++ b/components/AssMea.vue @@ -0,0 +1,118 @@ + + + + \ No newline at end of file diff --git a/components/Itembdetail.vue b/components/Itembdetail.vue index 0a6e64f..8ae1d5c 100644 --- a/components/Itembdetail.vue +++ b/components/Itembdetail.vue @@ -86,7 +86,8 @@ @@ -119,6 +120,7 @@ import { useToast } from "primevue/usetoast"; import { ref } from "vue"; import { useDialog } from 'primevue/usedialog'; import Upditemb from "./upditemb.vue"; +import AssMea from "./AssMea.vue"; const dialog = useDialog(); @@ -147,7 +149,7 @@ interface cItemB { const {data: itemsbd } = await useFetch('http://ubodroid-2:8081/api/v1/itb/'+qid); const {data: images } = await useFetch('http://ubodroid-2:8081/api/v1/pho/itb/'+qid); - +const mea = ref({id: 0, kurz: '', brust:0, laenget:0, schulterbreite:0, taillenumfangt:0, hueftumfang:0, innennaht:0, laengeb:0, taillenumfangb:0}); const onDelete = () => { deleteItemBDialog.value = true; @@ -157,6 +159,20 @@ const onUpdate = () => { dialog.open(Upditemb, { data: {id: qid} }); }; +const onAssign = () => { + let mid: any; + dialog.open(AssMea, {data: { mea }, onClose(options) { + mid = options?.data; + if (mid) { + console.log('mid vor dem zweiten Dialog: ', mid) + dialog.open(Upditemb, { data: {id:qid, mid: mid.id }}); + } + } + }); + + +} + const hideDialog = () => { deleteItemBDialog.value = false; diff --git a/components/Measure.vue b/components/Measure.vue new file mode 100644 index 0000000..5b34b27 --- /dev/null +++ b/components/Measure.vue @@ -0,0 +1,211 @@ + + + + + \ No newline at end of file diff --git a/components/Typ.vue b/components/Typ.vue index 1998411..563687f 100644 --- a/components/Typ.vue +++ b/components/Typ.vue @@ -157,7 +157,9 @@ method: 'PUT', body: fd }); - console.log('UPDATE ausgeführt...'+ bezeichnung); + toast.add({ severity: 'success', summary: 'Type updated', detail: 'Description: ' + bezeichnung.value, life: 3000 }); + await refreshNuxtData(); + console.log('UPDATE ausgeführt...'+ bezeichnung.value); } async function onDelete() { diff --git a/components/UpdMeas.vue b/components/UpdMeas.vue new file mode 100644 index 0000000..7049c8b --- /dev/null +++ b/components/UpdMeas.vue @@ -0,0 +1,173 @@ + + + + + \ No newline at end of file diff --git a/components/UpdPhoto.vue b/components/UpdPhoto.vue index e4b1587..208c23d 100644 --- a/components/UpdPhoto.vue +++ b/components/UpdPhoto.vue @@ -27,11 +27,13 @@ - + diff --git a/components/upditemb.vue b/components/upditemb.vue index 00c3b63..00f09cf 100644 --- a/components/upditemb.vue +++ b/components/upditemb.vue @@ -135,12 +135,13 @@ const toast = useToast(); const {data: typen } = await useFetch('http://ubodroid-2:8081/api/v1/typ'); -let blubb: any; +let blubb, assm: any; let params: any; params = inject('dialogRef'); blubb = params.value.data.id; - //console.log(blubb); +assm = params.value.data.mid; +console.log('assm = ', assm); @@ -149,12 +150,19 @@ onMounted(() => { }) console.log('Blubb außerhalb von onMounted: ', blubb); -const {data: itemb } = await useFetch('http://ubodroid-2:8081/api/v1/itb/'+blubb); +const {data: itemb } = await modifyItem(); const hideDialog = () => { }; +async function modifyItem() { + const res = await useFetch('http://ubodroid-2:8081/api/v1/itb/'+blubb); + console.log(res); + res.data.value.abmessungen.id = assm; + return res; +} + async function doUpdate(t: cItemB) { let fd = new FormData(); fd.append('id', t.id); diff --git a/pages/measure.vue b/pages/measure.vue new file mode 100644 index 0000000..8f6ce14 --- /dev/null +++ b/pages/measure.vue @@ -0,0 +1,5 @@ + \ No newline at end of file