This commit is contained in:
iriska-gri committed 2024-07-09 16:21:51 +03:00
1 parent a170ae017a
commit 21c0216d67
1 file changed
+31 -21
@@ -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,27 +218,27 @@ 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)
// == n.id
}
);
if (emp.employees.length > 0) ns.push(emp)
return propsEvent.value.mycalendars[indCal].participant.some(
(part) => part.id === n.id
);
// == n.id
});
if (emp.employees.length > 0) ns.push(emp);
// if (propsEvent.value.event.participant.length > 0) {
// e.employees.forEach((empl) => {
// let ab = propsEvent.value.event.participant.find(
@@ -347,7 +359,6 @@ export default {
// propsEvent.value.event.participant.push(e.id)
);
};
const dateEvent = computed({
@@ -357,7 +368,7 @@ export default {
set(newValue) {
let dateParts = newValue.split(".");
// let d = new Date(propsEvent.value.event.date_start).setFullYear(parseInt(dateParts[2], 10), parseInt(dateParts[1], 10), parseInt(dateParts[0], 10))
// let d = new Date(propsEvent.value.event.date_start).setDate(new Date(2024,01,01))
// propsEvent.value.event.date_start = new Date(2024,01,01);
@@ -370,11 +381,10 @@ 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]);
}
axiosApiInstance
.post("api/calendar_of_events/my_events/", postEvent)
.then((res) => {