From a4661443db3245bfba813f4db3c5ca59be001787 Mon Sep 17 00:00:00 2001 From: iriska-gri <79623434+iriska-gri@users.noreply.github.com> Date: Thu, 11 Jul 2024 08:24:18 +0300 Subject: [PATCH] P-47 Selected complete --- .../calendar-create-select.vue | 27 ++++++++++--------- .../calendar_of_events/event-create.vue | 11 +------- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/src/front/src/components/calendar_of_events/calendar-create-select.vue b/src/front/src/components/calendar_of_events/calendar-create-select.vue index 42b3ea8b3..316958dcd 100644 --- a/src/front/src/components/calendar_of_events/calendar-create-select.vue +++ b/src/front/src/components/calendar_of_events/calendar-create-select.vue @@ -144,23 +144,26 @@ export default { let selected = []; props.staff.forEach((e) => { - // console.log(e, 'eeeeeeeeeeeee') - if (e.employees.every((n) => n[props.okey] == true)) { - // console.log(e.employees.length, 'if') + console.log(e, 'eeeeeeeeeeeee') + if (e.employees.length != 1 && e.employees.every((n) => n[props.okey] == true)) { + console.log(e.employees.length, 'if') + + e[props.okey] = true; + selected.push(e); + + + + } + else if (e.employees.length == 1 ) { e[props.okey] = true; - selected.push(e); - } else { - // console.log(e, 'else eeeeeeeeeeeee') + selected.push(...e.employees.filter((n) => n[props.okey] == true)); + } + else { + console.log(e, 'else eeeeeeeeeeeee') e[props.okey] = false; selected.push(...e.employees.filter((n) => n[props.okey] == true)); } }); - - // emit("returnIdParticant", { - // okey: props.okey, - // select: selected, - // staff: [], - // }); return selected; }, diff --git a/src/front/src/components/calendar_of_events/event-create.vue b/src/front/src/components/calendar_of_events/event-create.vue index a5be757b5..2e41d863e 100644 --- a/src/front/src/components/calendar_of_events/event-create.vue +++ b/src/front/src/components/calendar_of_events/event-create.vue @@ -50,6 +50,7 @@ density="compact" class="py-3" return-object + :disabled="'id' in propsEvent.event" >