[WIP] Фикс при добавлении нового расписания, удалил ненужные переменные
This commit is contained in:
@@ -8,11 +8,9 @@
|
|||||||
@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",
|
||||||
@@ -21,9 +19,7 @@
|
|||||||
@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",
|
||||||
)
|
)
|
||||||
@@ -44,12 +40,6 @@ 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: "" },
|
timesShift: { start_time: "", end_time: "" },
|
||||||
buttons: [
|
buttons: [
|
||||||
@@ -143,7 +133,6 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.serialized = serialized;
|
this.serialized = serialized;
|
||||||
|
|
||||||
this.filterEmployee();
|
this.filterEmployee();
|
||||||
},
|
},
|
||||||
filterEmployee() {
|
filterEmployee() {
|
||||||
@@ -219,7 +208,7 @@ export default {
|
|||||||
switchNextMonth() {
|
switchNextMonth() {
|
||||||
this.startMonth = this.startMonth.clone().add(1, "M");
|
this.startMonth = this.startMonth.clone().add(1, "M");
|
||||||
},
|
},
|
||||||
houres() {
|
setTime() {
|
||||||
let now = new Date();
|
let now = new Date();
|
||||||
let hour = now.getHours();
|
let hour = now.getHours();
|
||||||
let minute = now.getMinutes();
|
let minute = now.getMinutes();
|
||||||
@@ -240,7 +229,7 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.fetchSchedules();
|
this.fetchSchedules();
|
||||||
this.houres();
|
this.setTime();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -39,9 +39,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,7 +26,7 @@
|
|||||||
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) : ''}"
|
||||||
)
|
)
|
||||||
@@ -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: "",
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
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 },
|
||||||
|
|||||||
Reference in New Issue
Block a user