[WIP] Добавил отображение расписания

This commit is contained in:
megavrilinvv
2022-12-22 13:37:06 +03:00
parent 40e0c71347
commit 838266c0e9

View File

@@ -19,12 +19,12 @@
.flex.icon-edit
.name-employee.flex.justify-center.items-center.cursor-pointer(@click="openSelect")
span {{trimOwnerName(this.scheduleList[0]?.employee.last_name, this.scheduleList[0]?.employee.first_name, this.scheduleList[0]?.employee.patronymic)}}
.flex(v-for="day in result")
.flex
.cell.flex.flex-col.items-center.justify-center.w-11(
v-for="item in scheduleList",
:style="{backgroundColor: day.format('YYYY-MM-DD') === item.date ? choiceColor(item.status) : ''}"
v-for="day in result",
:style="{backgroundColor: day.format('YYYY-MM-DD') === choiceDay(day.format('YYYY-MM-DD')) ? choiceColor(day.format('YYYY-MM-DD')) : ''}"
)
.flex {{day.format("YYYY-MM-DD") === item.date ? choiceWorks(item.status) : ''}}
.flex {{day.format("YYYY-MM-DD") === choiceDay(day.format("YYYY-MM-DD")) ? choiceWorks(day.format('YYYY-MM-DD')) : ''}}
.schedule-body.flex.w-full
.edit.flex.items-center.justify-center.h-9.w-9
.flex.items-center.gap-x-8
@@ -112,11 +112,13 @@ export default {
this.currentEmployee.label = "";
this.currentEmployee.id = null;
},
choiceWorks(work) {
return this.works.find((e) => e.work === work).text;
choiceWorks(day) {
let a = this.scheduleList.find((e) => e.date === day).status;
return this.works.find((e) => e.work === a).text;
},
choiceColor(work) {
return this.works.find((e) => e.work === work).color;
choiceColor(day) {
let a = this.scheduleList.find((e) => e.date === day).status;
return this.works.find((e) => e.work === a).color;
},
changeDays() {
this.days = moment().daysInMonth();
@@ -138,6 +140,9 @@ export default {
this.employee.push(this.employeeList[index]);
}
},
choiceDay(day) {
return this.scheduleList.find((e) => day === e.date)?.date;
},
},
mounted() {