This commit is contained in:
iriska-gri committed 2024-07-09 16:21:51 +03:00
1 parent a170ae017a
commit 21c0216d67
1 file changed
+25 -15
@@ -31,8 +31,20 @@
</v-col>
<v-col>
<calendar-create-select
v-if="calendar.length > 0"
:staff="newStaff"
@returnIdParticant="returnIdParticant"
/>
<v-autocomplete
v-else
label="Выберите из списка или найдите по ФИО"
variant="outlined"
density="compact"
hide-details
class="max-height-select py-3"
disabled
return-object
/> </v-col
></v-row>
@@ -206,26 +218,26 @@ export default {
const accountStore = useAccountStore();
const newStaff = computed({
get() {
let ns = []
let indCal = propsEvent.value.mycalendars.findIndex(e=>e.id ==propsEvent.value.event.calendar )
let ns = [];
let indCal = propsEvent.value.mycalendars.findIndex(
(e) => e.id == propsEvent.value.event.calendar
);
console.log(indCal);
staff.value.forEach((e) => {
let emp = { ...e };
emp.employees = e.employees.filter((n) =>
{
if (n.id ==accountStore.user.is_idEmployee) {
n.selected = true
emp.employees = e.employees.filter((n) => {
if (n.id == accountStore.user.is_idEmployee) {
n.selected = true;
}
return propsEvent.value.mycalendars[indCal].participant.some(part => part.id === n.id)
return propsEvent.value.mycalendars[indCal].participant.some(
(part) => part.id === n.id
);
// == n.id
}
});
);
if (emp.employees.length > 0) ns.push(emp)
if (emp.employees.length > 0) ns.push(emp);
// if (propsEvent.value.event.participant.length > 0) {
// e.employees.forEach((empl) => {
@@ -347,7 +359,6 @@ export default {
// propsEvent.value.event.participant.push(e.id)
);
};
const dateEvent = computed({
@@ -370,7 +381,6 @@ export default {
let postEvent = new FormData();
postEvent.append("event", JSON.stringify({ ...propsEvent.value.event }));
if (propsEvent.value.event.files !== null) {
files.value.forEach((e) => postEvent.append("files", e));
// postEvent.append("files", propsEvent.value.event.files[0]);
}