Добавил employee на расписание и стили

This commit is contained in:
megavrilinvv
2022-12-21 19:00:45 +03:00
parent e9a9c20fb5
commit 1fd6b62c36
6 changed files with 92 additions and 23 deletions

View File

@@ -2,7 +2,11 @@
.wrapper.flex.w-full.relative.mx-2
.schedule-wrapper.relative.flex.flex-col.px-6.py-6.h-full.w-full.gap-y-5
schedule-header
schedule-body(:employee-list="employeeList")
schedule-body(
:employee-list="employeeList",
:schedules-employee="fetchSchedulesEmployee",
:schedule-list="scheduleList"
)
schedule-bar
</template>
@@ -17,17 +21,25 @@ export default {
data() {
return {
employeeList: [],
scheduleList: [],
};
},
methods: {
getSchedules() {
fetchSchedules() {
fetchWrapper
.get("general/employee/")
.then((res) => (this.employeeList = res.results));
},
fetchSchedulesEmployee(id) {
fetchWrapper
.get(`accounts/schedules/?employee=${id}`, "api")
.then((data) => {
this.scheduleList = data.results;
});
},
},
mounted() {
this.getSchedules();
this.fetchSchedules();
},
};
</script>