Merge branch 'UC-190' into 'master'
Resolve UC-190 See merge request andrusyakka/urban-couscous!235
This commit is contained in:
@@ -3,15 +3,14 @@
|
|||||||
.schedule-wrapper.relative.flex.flex-col.px-6.py-6.h-full.w-full.gap-y-5
|
.schedule-wrapper.relative.flex.flex-col.px-6.py-6.h-full.w-full.gap-y-5
|
||||||
schedule-header(
|
schedule-header(
|
||||||
:start-month="startMonth",
|
:start-month="startMonth",
|
||||||
|
:times-shift="timesShift",
|
||||||
@switch-previous-month="switchPreviousMonth",
|
@switch-previous-month="switchPreviousMonth",
|
||||||
@switch-next-month="switchNextMonth"
|
@switch-next-month="switchNextMonth"
|
||||||
)
|
)
|
||||||
schedule-body(
|
schedule-body(
|
||||||
:employee-list="employeeList",
|
|
||||||
:schedules-employee="fetchSchedulesEmployee",
|
:schedules-employee="fetchSchedulesEmployee",
|
||||||
:schedule-list="scheduleList",
|
:schedule-list="scheduleList",
|
||||||
:serialized="serialized",
|
:serialized="serialized",
|
||||||
:data-schedule="dataSchedule",
|
|
||||||
:buttons="buttons",
|
:buttons="buttons",
|
||||||
:start-month="startMonth",
|
:start-month="startMonth",
|
||||||
:clear-employee="clearEmployee",
|
:clear-employee="clearEmployee",
|
||||||
@@ -20,11 +19,9 @@
|
|||||||
@schedules="distributeRequest"
|
@schedules="distributeRequest"
|
||||||
)
|
)
|
||||||
schedule-bar(
|
schedule-bar(
|
||||||
:data-schedule="dataSchedule",
|
|
||||||
:buttons="buttons",
|
:buttons="buttons",
|
||||||
:clear-employee="clearEmployee",
|
|
||||||
:times="times",
|
:times="times",
|
||||||
:create-schedules="postCreateSchedules"
|
:create-schedules="postCreateSchedules",
|
||||||
)
|
)
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -43,13 +40,8 @@ export default {
|
|||||||
scheduleList: [],
|
scheduleList: [],
|
||||||
clearEmployee: [],
|
clearEmployee: [],
|
||||||
serialized: [],
|
serialized: [],
|
||||||
dataSchedule: {
|
|
||||||
status: "",
|
|
||||||
date: null,
|
|
||||||
startTime: "",
|
|
||||||
endTime: "",
|
|
||||||
},
|
|
||||||
times: { start_time: "", end_time: "" },
|
times: { start_time: "", end_time: "" },
|
||||||
|
timesShift: { start_time: "", end_time: "" },
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
class: "button-work",
|
class: "button-work",
|
||||||
@@ -141,7 +133,6 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.serialized = serialized;
|
this.serialized = serialized;
|
||||||
|
|
||||||
this.filterEmployee();
|
this.filterEmployee();
|
||||||
},
|
},
|
||||||
filterEmployee() {
|
filterEmployee() {
|
||||||
@@ -217,6 +208,19 @@ export default {
|
|||||||
switchNextMonth() {
|
switchNextMonth() {
|
||||||
this.startMonth = this.startMonth.clone().add(1, "M");
|
this.startMonth = this.startMonth.clone().add(1, "M");
|
||||||
},
|
},
|
||||||
|
setTime() {
|
||||||
|
let now = new Date();
|
||||||
|
let hour = now.getHours();
|
||||||
|
let minute = now.getMinutes();
|
||||||
|
let localDatetime =
|
||||||
|
(hour < 10 ? "0" + hour.toString() : hour) +
|
||||||
|
":" +
|
||||||
|
(minute < 10 ? "0" + minute.toString() : minute);
|
||||||
|
this.times.start_time = localDatetime;
|
||||||
|
this.times.end_time = localDatetime;
|
||||||
|
this.timesShift.start_time = localDatetime;
|
||||||
|
this.timesShift.end_time = localDatetime;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
startMonth() {
|
startMonth() {
|
||||||
@@ -225,6 +229,7 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.fetchSchedules();
|
this.fetchSchedules();
|
||||||
|
this.setTime();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
base-custom-select(v-model="currentEmployee", label="Текущий сотрудник")
|
base-custom-select(v-model="currentEmployee", label="Текущий сотрудник")
|
||||||
base-custom-select(v-model="currentEmployee", label="Замена сотрудника")
|
base-custom-select(v-model="currentEmployee", label="Замена сотрудника")
|
||||||
.time-wrapper.flex.justify-center
|
.time-wrapper.flex.justify-center
|
||||||
base-input-time.px-4.item-input.text-base(label="Начало")
|
base-input-time.px-4.item-input.text-base(label="Начало", v-model="timesShift.start_time")
|
||||||
base-input-time.px-4.item-input.text-base(label="Конец")
|
base-input-time.px-4.item-input.text-base(label="Конец", v-model="timesShift.end_time")
|
||||||
.flex.justify-center
|
.flex.justify-center
|
||||||
base-button.font-semibold(:size="40") Сохранить
|
base-button.font-semibold(:size="40") Сохранить
|
||||||
</template>
|
</template>
|
||||||
@@ -26,7 +26,7 @@ import BaseButton from "@/components/base/BaseButton.vue";
|
|||||||
export default {
|
export default {
|
||||||
name: "FormChangeShift",
|
name: "FormChangeShift",
|
||||||
components: { BaseCustomSelect, BaseInputDate, BaseInputTime, BaseButton },
|
components: { BaseCustomSelect, BaseInputDate, BaseInputTime, BaseButton },
|
||||||
props: { closeForm: Function },
|
props: { closeForm: Function, timesShift: Object },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
currentEmployee: { label: "", id: null },
|
currentEmployee: { label: "", id: null },
|
||||||
|
|||||||
@@ -35,9 +35,7 @@ export default {
|
|||||||
name: "ScheduleBar",
|
name: "ScheduleBar",
|
||||||
components: { BaseButton, BaseCustomSelect, BaseInputTime, BaseInputDate },
|
components: { BaseButton, BaseCustomSelect, BaseInputTime, BaseInputDate },
|
||||||
props: {
|
props: {
|
||||||
dataSchedule: Object,
|
|
||||||
buttons: Array,
|
buttons: Array,
|
||||||
clearEmployee: Array,
|
|
||||||
times: Object,
|
times: Object,
|
||||||
createSchedules: Function,
|
createSchedules: Function,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -26,10 +26,10 @@
|
|||||||
v-for="day in result",
|
v-for="day in result",
|
||||||
:key="day",
|
:key="day",
|
||||||
:id="schedule.id + day",
|
:id="schedule.id + day",
|
||||||
@click="choiceCell(day, schedule.id, schedule)",
|
@click="choiceCell(day, schedule.id, schedule); saveEmployee()",
|
||||||
:class="choiceState(day, schedule.id)",
|
:class="choiceState(day, schedule.id)",
|
||||||
:style="{backgroundColor: choiceDay(day, schedule.id) ? choiceColor(day, schedule) : ''}"
|
:style="{backgroundColor: choiceDay(day, schedule.id) ? choiceColor(day, schedule) : ''}"
|
||||||
)
|
)
|
||||||
.flex(
|
.flex(
|
||||||
:class="{'cell-work': choiceState(day, schedule.id).status}"
|
:class="{'cell-work': choiceState(day, schedule.id).status}"
|
||||||
) {{choiceDay(day, schedule.id) ? choiceWorks(day, schedule) : ''}}
|
) {{choiceDay(day, schedule.id) ? choiceWorks(day, schedule) : ''}}
|
||||||
@@ -74,15 +74,8 @@ export default {
|
|||||||
name: "ScheduleBody",
|
name: "ScheduleBody",
|
||||||
components: { BaseModal, BaseButton, BaseCustomSelect },
|
components: { BaseModal, BaseButton, BaseCustomSelect },
|
||||||
props: {
|
props: {
|
||||||
employeeList: {
|
|
||||||
type: Array,
|
|
||||||
default() {
|
|
||||||
return [];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
scheduleList: Array,
|
scheduleList: Array,
|
||||||
serialized: Array,
|
serialized: Array,
|
||||||
dataSchedule: Object,
|
|
||||||
buttons: Array,
|
buttons: Array,
|
||||||
startMonth: Object,
|
startMonth: Object,
|
||||||
clearEmployee: Array,
|
clearEmployee: Array,
|
||||||
@@ -91,13 +84,11 @@ export default {
|
|||||||
return {
|
return {
|
||||||
days: "",
|
days: "",
|
||||||
result: [],
|
result: [],
|
||||||
showSelect: false,
|
|
||||||
employee: [],
|
employee: [],
|
||||||
currentEmployee: {
|
currentEmployee: {
|
||||||
label: "",
|
label: "",
|
||||||
id: null,
|
id: null,
|
||||||
},
|
},
|
||||||
curWork: "",
|
|
||||||
dateInterval: {
|
dateInterval: {
|
||||||
id: "",
|
id: "",
|
||||||
start: "",
|
start: "",
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
.flex.flex-col.gap-y-5
|
.flex.flex-col.gap-y-5
|
||||||
.flex.justify-center.pl-8.pr-20.font-bold.text-xl Планировщик смен
|
.flex.justify-center.pl-8.pr-20.font-bold.text-xl Планировщик смен
|
||||||
form-change-shift(v-if="showForm", :close-form="closeForm")
|
transition(name="form")
|
||||||
|
form-change-shift(
|
||||||
|
v-if="showForm",
|
||||||
|
:close-form="closeForm",
|
||||||
|
:times-shift="timesShift"
|
||||||
|
)
|
||||||
.flex
|
.flex
|
||||||
.calendar-header-wrapper.flex.items-center.justify-between.py-3.pl-5.pr-6
|
.calendar-header-wrapper.flex.items-center.justify-between.py-3.pl-5.pr-6
|
||||||
.flex
|
.flex
|
||||||
@@ -22,9 +27,8 @@
|
|||||||
:size="32"
|
:size="32"
|
||||||
)
|
)
|
||||||
.text.flex.items-center
|
.text.flex.items-center
|
||||||
span.text.font-medium.text-base {{ dateString }}
|
.text.font-medium.text-base {{ dateString }}
|
||||||
span.today.font-bold.text-xxs.ml-2(v-if="isCurrentMonth") Текущий
|
.opacity-50.font-bold.text-xxs.ml-2(v-if="isCurrentMonth") Текущий
|
||||||
//.flex.text-xl Жмых Олег Анатольевич
|
|
||||||
base-button.font-semibold(:size="40", @click="openForm") Замена смен
|
base-button.font-semibold(:size="40", @click="openForm") Замена смен
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -32,11 +36,13 @@
|
|||||||
import * as moment from "moment";
|
import * as moment from "moment";
|
||||||
import BaseButton from "@/components/base/BaseButton.vue";
|
import BaseButton from "@/components/base/BaseButton.vue";
|
||||||
import FormChangeShift from "@/pages/schedule/components/FormChangeShift.vue";
|
import FormChangeShift from "@/pages/schedule/components/FormChangeShift.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "ScheduleHeader",
|
name: "ScheduleHeader",
|
||||||
components: { BaseButton, FormChangeShift },
|
components: { BaseButton, FormChangeShift },
|
||||||
props: {
|
props: {
|
||||||
startMonth: Object,
|
startMonth: Object,
|
||||||
|
timesShift: Object,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -99,6 +105,22 @@ export default {
|
|||||||
.text
|
.text
|
||||||
color: var(--font-dark-blue-color)
|
color: var(--font-dark-blue-color)
|
||||||
|
|
||||||
.today
|
.form-enter-from
|
||||||
opacity: 0.5
|
opacity: 0
|
||||||
|
transform: translateY(300px)
|
||||||
|
pointer-events: none
|
||||||
|
|
||||||
|
.form-enter-active
|
||||||
|
transition: 0.5s ease
|
||||||
|
|
||||||
|
.form-leave-to
|
||||||
|
opacity: 0
|
||||||
|
transform: translateY(300px)
|
||||||
|
pointer-events: none
|
||||||
|
|
||||||
|
.form-leave-active
|
||||||
|
transition: 0.5s ease
|
||||||
|
|
||||||
|
.form-move
|
||||||
|
transition: 0.5s ease
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user