P-42
This commit is contained in:
1 parent
83b8fa27cf
commit
fc4f4cbc2d
2 files changed
+33
-21
No files matched your search
@@ -1,4 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
|
{{selected}}
|
||||||
<v-autocomplete
|
<v-autocomplete
|
||||||
v-model="selectedStaff"
|
v-model="selectedStaff"
|
||||||
:items="staff"
|
:items="staff"
|
||||||
@@ -93,25 +94,40 @@
|
|||||||
import { ref, computed } from "vue";
|
import { ref, computed } from "vue";
|
||||||
import { axiosApiInstance } from "@/utils/axios-api";
|
import { axiosApiInstance } from "@/utils/axios-api";
|
||||||
import { splitname } from "@/utils/universal_functions";
|
import { splitname } from "@/utils/universal_functions";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
setup() {
|
props : {
|
||||||
|
participant: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
}},
|
||||||
|
|
||||||
|
|
||||||
|
setup(props, { emit }) {
|
||||||
const filtered = ref("");
|
const filtered = ref("");
|
||||||
const staff = ref([]);
|
const staff = ref([]);
|
||||||
axiosApiInstance
|
axiosApiInstance
|
||||||
.get("api/calendar_of_events/get_employees/")
|
.get("api/calendar_of_events/get_employees/")
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
staff.value = res.data.filter((e) => e.employees.length > 0);
|
staff.value = res.data.filter((e) => e.employees.length > 0);
|
||||||
|
console.log(staff.value, 'staff.value');
|
||||||
});
|
});
|
||||||
|
|
||||||
const selectedStaff = computed(() => {
|
const selectedStaff = computed(() => {
|
||||||
let selected = [];
|
let selected = [];
|
||||||
|
//
|
||||||
|
|
||||||
staff.value.forEach((e) => {
|
staff.value.forEach((e) => {
|
||||||
|
|
||||||
|
|
||||||
if (e.employees.every((n) => n.selected == true)) {
|
if (e.employees.every((n) => n.selected == true)) {
|
||||||
e.selected = true;
|
e.selected = true;
|
||||||
selected.push(e);
|
selected.push(e);
|
||||||
} else {
|
} else {
|
||||||
e.selected = false;
|
e.selected = false;
|
||||||
selected.push(...e.employees.filter((n) => n.selected == true));
|
|
||||||
|
selected.push(...e.employees.filter((n) => {n.selected == true }));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,8 @@
|
|||||||
row-height="25"
|
row-height="25"
|
||||||
rows="1"
|
rows="1"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
hide-details0
|
hide-details
|
||||||
|
v-model="calendar.cl_name"
|
||||||
></v-textarea></v-col
|
></v-textarea></v-col
|
||||||
></v-row>
|
></v-row>
|
||||||
<v-row no-gutters class="align-center pt-3">
|
<v-row no-gutters class="align-center pt-3">
|
||||||
@@ -38,13 +39,14 @@
|
|||||||
size="x-small"
|
size="x-small"
|
||||||
:color="x"
|
:color="x"
|
||||||
:variant="
|
:variant="
|
||||||
newcalendar.cl_color === null
|
calendar.cl_color === null
|
||||||
? 'flat'
|
? 'flat'
|
||||||
: newcalendar.cl_color === x
|
: calendar.cl_color === x
|
||||||
? 'flat'
|
? 'flat'
|
||||||
: 'tonal'
|
: 'tonal'
|
||||||
"
|
"
|
||||||
/> </v-col
|
/>
|
||||||
|
</v-col
|
||||||
></v-row>
|
></v-row>
|
||||||
|
|
||||||
<v-row no-gutters class="align-center">
|
<v-row no-gutters class="align-center">
|
||||||
@@ -52,7 +54,8 @@
|
|||||||
Участники
|
Участники
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col>
|
<v-col>
|
||||||
<calendar-create-select /> </v-col
|
<calendar-create-select :participant = calendar.participant />
|
||||||
|
</v-col
|
||||||
></v-row>
|
></v-row>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col class="d-flex flex-grow-0">
|
<v-col class="d-flex flex-grow-0">
|
||||||
@@ -128,7 +131,7 @@ export default {
|
|||||||
|
|
||||||
calendar: {
|
calendar: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: {},
|
default: {cl_name:'', participant: []},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -201,27 +204,20 @@ export default {
|
|||||||
];
|
];
|
||||||
|
|
||||||
const colorPik = (col) => {
|
const colorPik = (col) => {
|
||||||
if (newcalendar.value.cl_color === col) {
|
if (props.calendar.cl_color === col) {
|
||||||
newcalendar.value.cl_color = null;
|
props.calendar.cl_color = null;
|
||||||
} else {
|
} else {
|
||||||
newcalendar.value.cl_color = col;
|
props.calendar.cl_color = col;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// почему запрос запускается при загрузке
|
|
||||||
// confirmation();
|
|
||||||
|
|
||||||
const newcalendar = ref({
|
|
||||||
cl_name: "",
|
|
||||||
// Почему тут этот цвет? ЧЕМ ОН ОТЛИЧАЕТСЯ ОТ COLOR[0]?
|
|
||||||
cl_color: "#F44336",
|
|
||||||
cl_descr: "",
|
|
||||||
participant_calendar: [],
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
dialog_create_calendar,
|
dialog_create_calendar,
|
||||||
newcalendar,
|
|
||||||
color,
|
color,
|
||||||
colorPik,
|
colorPik,
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user