[WIP] Фикс create таблицы

This commit is contained in:
megavrilinvv
2023-01-23 12:56:20 +03:00
parent 611558597a
commit 11af24f8bc
2 changed files with 13 additions and 15 deletions

View File

@@ -202,7 +202,7 @@ export default {
};
if (this.insideSchedules?.length > 0) {
this.postUpdateSchedule();
if (this.outsideSchedules)
if (this.outsideSchedules) {
this.outsideSchedules.forEach((el) => {
fetchWrapper.post("accounts/schedules/create/", {
...data,
@@ -210,6 +210,7 @@ export default {
end_date: el.end_date,
});
});
}
} else {
fetchWrapper
.post("accounts/schedules/create/", {

View File

@@ -81,13 +81,6 @@ export default {
choiceCell(day, id, schedule) {
if (this.showTime) return;
let formatTime = day.format("YYYY-MM-DD");
let insideSchedules = schedule?.schedules.filter(
(el) =>
(el.date > this.dateInterval.start &&
el.date < this.dateInterval.end) ||
el.date === this.dateInterval.start ||
el.date === this.dateInterval.end
);
if (this.dateInterval.id !== id) {
this.dateInterval.start = "";
@@ -100,14 +93,18 @@ export default {
this.dateInterval.id = id;
} else if (day.isAfter(this.dateInterval.start)) {
this.dateInterval.end = formatTime;
} else this.dateInterval.start = formatTime;
} else {
this.dateInterval.start = formatTime;
}
this.$emit("schedule-employee", this.dateInterval, id);
if (
!this.selectEmployee.label &&
this.dateInterval.start &&
this.dateInterval.end &&
insideSchedules
)
let insideSchedules = schedule?.schedules.filter(
(el) =>
(el.date > this.dateInterval.start &&
el.date < this.dateInterval.end) ||
el.date === this.dateInterval.start ||
el.date === this.dateInterval.end
);
if (!this.selectEmployee.label && !!insideSchedules)
this.rangeSchdedules(schedule, insideSchedules, id);
},
rangeSchdedules(schedule, insideSchedules, id) {