Merge branch 'UC-204' into 'master'
Resolve UC-204 See merge request andrusyakka/urban-couscous!261
This commit is contained in:
@@ -91,4 +91,5 @@ export default {
|
|||||||
border-radius: 50%
|
border-radius: 50%
|
||||||
z-index: 5
|
z-index: 5
|
||||||
opacity: 0
|
opacity: 0
|
||||||
|
cursor: pointer
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -5,11 +5,12 @@
|
|||||||
v-model="value",
|
v-model="value",
|
||||||
:options="items",
|
:options="items",
|
||||||
:disable="disable",
|
:disable="disable",
|
||||||
bg-color="var(--bg-disable-grey-color)"
|
:behavior="behavior",
|
||||||
|
bg-color="var(--bg-disable-grey-color)",
|
||||||
outlined,
|
outlined,
|
||||||
dense,
|
dense,
|
||||||
emit-value,
|
emit-value,
|
||||||
map-options,
|
map-options
|
||||||
)
|
)
|
||||||
template(v-slot:selected)
|
template(v-slot:selected)
|
||||||
span {{ textSelect }}
|
span {{ textSelect }}
|
||||||
@@ -29,6 +30,10 @@ export default {
|
|||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
|
behavior: {
|
||||||
|
type: String,
|
||||||
|
default: "menu",
|
||||||
|
},
|
||||||
disable: Boolean,
|
disable: Boolean,
|
||||||
label: String,
|
label: String,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ export default {
|
|||||||
text: "'В'",
|
text: "'В'",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
template: { item: { id: null, label: null } },
|
template: { item: {} },
|
||||||
startMonth: moment().startOf("month"),
|
startMonth: moment().startOf("month"),
|
||||||
showTime: false,
|
showTime: false,
|
||||||
schedulesDate: {},
|
schedulesDate: {},
|
||||||
@@ -147,6 +147,7 @@ export default {
|
|||||||
},
|
},
|
||||||
filterScheduleEmployee() {
|
filterScheduleEmployee() {
|
||||||
let serialized = [];
|
let serialized = [];
|
||||||
|
this.template.item = {};
|
||||||
this.scheduleList.forEach((e) => {
|
this.scheduleList.forEach((e) => {
|
||||||
let foundedElem = serialized.find((elem) => elem.id === e.employee.id);
|
let foundedElem = serialized.find((elem) => elem.id === e.employee.id);
|
||||||
if (!foundedElem) {
|
if (!foundedElem) {
|
||||||
@@ -200,9 +201,11 @@ export default {
|
|||||||
end_time: this.times.end_time,
|
end_time: this.times.end_time,
|
||||||
status: this.buttons.find((e) => e.active)?.work,
|
status: this.buttons.find((e) => e.active)?.work,
|
||||||
};
|
};
|
||||||
|
if (this.template.item.label)
|
||||||
|
data.kind_template = this.template.item.name;
|
||||||
if (this.insideSchedules?.length > 0) {
|
if (this.insideSchedules?.length > 0) {
|
||||||
this.postUpdateSchedule();
|
this.postUpdateSchedule();
|
||||||
if (this.outsideSchedules)
|
if (this.outsideSchedules) {
|
||||||
this.outsideSchedules.forEach((el) => {
|
this.outsideSchedules.forEach((el) => {
|
||||||
fetchWrapper.post("accounts/schedules/create/", {
|
fetchWrapper.post("accounts/schedules/create/", {
|
||||||
...data,
|
...data,
|
||||||
@@ -210,6 +213,7 @@ export default {
|
|||||||
end_date: el.end_date,
|
end_date: el.end_date,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
fetchWrapper
|
fetchWrapper
|
||||||
.post("accounts/schedules/create/", {
|
.post("accounts/schedules/create/", {
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
.wrapper-bar.flex.flex-col.gap-y-4.p-5.justify-between
|
.wrapper-bar.flex.flex-col.gap-y-4.p-5.justify-between
|
||||||
.flex.w-full.justify-around.gap-x-4
|
.flex.w-full.justify-around.gap-x-4
|
||||||
.time-wrapper.flex.justify-between.p-7
|
.time-wrapper.flex.justify-between.p-7
|
||||||
base-input(
|
base-input.items-center(
|
||||||
type="time",
|
type="time",
|
||||||
v-model="times.start_time",
|
v-model="times.start_time",
|
||||||
label="Начало",
|
label="Начало",
|
||||||
outlined
|
outlined
|
||||||
)
|
)
|
||||||
.flex.items-center.mt-6 —
|
.flex.items-center.mt-6 —
|
||||||
base-input(
|
base-input.items-center(
|
||||||
type="time",
|
type="time",
|
||||||
v-model="times.end_time",
|
v-model="times.end_time",
|
||||||
label="Конец",
|
label="Конец",
|
||||||
@@ -31,18 +31,11 @@
|
|||||||
style="width: 200px"
|
style="width: 200px"
|
||||||
)
|
)
|
||||||
.graph-template.flex.flex-col.items-center.gap-y-4
|
.graph-template.flex.flex-col.items-center.gap-y-4
|
||||||
base-select(
|
base-select.w-52(
|
||||||
:items="templateList",
|
:items="templateList",
|
||||||
v-model="template.item",
|
v-model="template.item",
|
||||||
placeholder="Шаблоны графиков"
|
placeholder="Выберите шаблон"
|
||||||
)
|
label="Шаблоны графиков"
|
||||||
base-input.w-28(
|
|
||||||
v-if="template.item.id === 1"
|
|
||||||
mask="#/#",
|
|
||||||
placeholder="0/0",
|
|
||||||
label="Введите график",
|
|
||||||
v-model="template.item.label",
|
|
||||||
outlined
|
|
||||||
)
|
)
|
||||||
.flex.justify-center.gap-x-6.h-10
|
.flex.justify-center.gap-x-6.h-10
|
||||||
q-btn(
|
q-btn(
|
||||||
@@ -83,10 +76,9 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
templateList: [
|
templateList: [
|
||||||
{ label: "Индивидуальный", id: 1 },
|
{ label: "2/2", name: "2/2", symbol: "'2/2'" },
|
||||||
{ label: "2/2", id: 2 },
|
{ label: "Дежурство", name: "DUTY", symbol: "'Д'" },
|
||||||
{ label: "3/2", id: 3 },
|
{ label: "Смена", name: "FirstEvenSecondOdd", symbol: "'С'" },
|
||||||
{ label: "5/2", id: 4 },
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -70,7 +70,9 @@ export default {
|
|||||||
this.setActiveButton();
|
this.setActiveButton();
|
||||||
return {
|
return {
|
||||||
"--bg-color-status": this.activeButton?.color,
|
"--bg-color-status": this.activeButton?.color,
|
||||||
"--text-status": this.activeButton?.text,
|
"--text-status": !this.template.item?.label
|
||||||
|
? this.activeButton?.text
|
||||||
|
: this.template.item.symbol,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -81,13 +83,6 @@ export default {
|
|||||||
choiceCell(day, id, schedule) {
|
choiceCell(day, id, schedule) {
|
||||||
if (this.showTime) return;
|
if (this.showTime) return;
|
||||||
let formatTime = day.format("YYYY-MM-DD");
|
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) {
|
if (this.dateInterval.id !== id) {
|
||||||
this.dateInterval.start = "";
|
this.dateInterval.start = "";
|
||||||
@@ -100,14 +95,18 @@ export default {
|
|||||||
this.dateInterval.id = id;
|
this.dateInterval.id = id;
|
||||||
} else if (day.isAfter(this.dateInterval.start)) {
|
} else if (day.isAfter(this.dateInterval.start)) {
|
||||||
this.dateInterval.end = formatTime;
|
this.dateInterval.end = formatTime;
|
||||||
} else this.dateInterval.start = formatTime;
|
} else {
|
||||||
|
this.dateInterval.start = formatTime;
|
||||||
|
}
|
||||||
this.$emit("schedule-employee", this.dateInterval, id);
|
this.$emit("schedule-employee", this.dateInterval, id);
|
||||||
if (
|
let insideSchedules = schedule?.schedules.filter(
|
||||||
!this.selectEmployee.label &&
|
(el) =>
|
||||||
this.dateInterval.start &&
|
(el.date > this.dateInterval.start &&
|
||||||
this.dateInterval.end &&
|
el.date < this.dateInterval.end) ||
|
||||||
insideSchedules
|
el.date === this.dateInterval.start ||
|
||||||
)
|
el.date === this.dateInterval.end
|
||||||
|
);
|
||||||
|
if (!this.selectEmployee.label && !!insideSchedules)
|
||||||
this.rangeSchdedules(schedule, insideSchedules, id);
|
this.rangeSchdedules(schedule, insideSchedules, id);
|
||||||
},
|
},
|
||||||
rangeSchdedules(schedule, insideSchedules, id) {
|
rangeSchdedules(schedule, insideSchedules, id) {
|
||||||
@@ -157,7 +156,8 @@ export default {
|
|||||||
|
|
||||||
if (resStart || resMiddle || resEnd)
|
if (resStart || resMiddle || resEnd)
|
||||||
return {
|
return {
|
||||||
status: !!this.activeButton,
|
"set-template": !!this.template.item?.label,
|
||||||
|
status: !!this.activeButton && !this.template.item,
|
||||||
"set-date": !this.activeButton,
|
"set-date": !this.activeButton,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -212,13 +212,4 @@ export default {
|
|||||||
border-radius: 4px
|
border-radius: 4px
|
||||||
width: 400px
|
width: 400px
|
||||||
height: 500px
|
height: 500px
|
||||||
|
|
||||||
.status
|
|
||||||
background-color: var(--bg-color-status) !important
|
|
||||||
|
|
||||||
.status::after
|
|
||||||
content: var(--text-status)
|
|
||||||
|
|
||||||
.set-date
|
|
||||||
background-color: var(--btn-blue-color-4) !important
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -116,4 +116,7 @@ export default {
|
|||||||
|
|
||||||
.status::after
|
.status::after
|
||||||
content: var(--text-status)
|
content: var(--text-status)
|
||||||
|
|
||||||
|
.set-template
|
||||||
|
background-color: var(--bg-event-orange-color) !important
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -99,12 +99,15 @@ export default {
|
|||||||
&:last-child
|
&:last-child
|
||||||
border-right: none
|
border-right: none
|
||||||
|
|
||||||
.set-date
|
|
||||||
background-color: var(--btn-blue-color-4) !important
|
|
||||||
|
|
||||||
.status
|
.status
|
||||||
background-color: var(--bg-color-status) !important
|
background-color: var(--bg-color-status) !important
|
||||||
|
|
||||||
.status::after
|
.status::after
|
||||||
content: var(--text-status)
|
content: var(--text-status)
|
||||||
|
|
||||||
|
.set-date
|
||||||
|
background-color: var(--btn-blue-color-4) !important
|
||||||
|
|
||||||
|
.set-template
|
||||||
|
background-color: var(--bg-event-orange-color) !important
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user