Добавил employee на расписание и стили
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user