[WIP] Фикс create таблицы
This commit is contained in:
@@ -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/", {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user