[WIP] Добавил возможность замены смен, фикс стилей
This commit is contained in:
@@ -11,12 +11,16 @@
|
||||
:choice-state="choiceState",
|
||||
:buttons="buttons",
|
||||
:show-time="showTime",
|
||||
:schedule-list="scheduleList"
|
||||
:schedule-list="scheduleList",
|
||||
:open-form="openForm",
|
||||
:replacement-sheet="replacementSheet",
|
||||
:employees="employees",
|
||||
:change-shift="changeShift"
|
||||
)
|
||||
schedule-table-select(
|
||||
v-if="clearEmployee.length > 0",
|
||||
v-if="employees.length > 0",
|
||||
:select-employee="selectEmployee",
|
||||
:clear-employee="clearEmployee",
|
||||
:employees="employees",
|
||||
:result="result",
|
||||
:choice-cell="choiceCell",
|
||||
:choice-state="choiceState",
|
||||
@@ -44,11 +48,15 @@ export default {
|
||||
serialized: Array,
|
||||
buttons: Array,
|
||||
template: Object,
|
||||
clearEmployee: Array,
|
||||
employees: Array,
|
||||
showTime: Boolean,
|
||||
clearSelect: Function,
|
||||
selectEmployee: Object,
|
||||
startMonth: Object,
|
||||
trimOwnerName: Function,
|
||||
openForm: Function,
|
||||
replacementSheet: Object,
|
||||
changeShift: Function,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -63,6 +71,7 @@ export default {
|
||||
},
|
||||
activeButton: null,
|
||||
choiceMonth: null,
|
||||
act: null,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -80,6 +89,9 @@ export default {
|
||||
setActiveButton() {
|
||||
this.activeButton = this.buttons.find((e) => e.active);
|
||||
},
|
||||
setActiveCell() {
|
||||
return (this.buttons.find((e) => e.work === "WORKS").active = true);
|
||||
},
|
||||
choiceCell(day, id, schedule) {
|
||||
if (this.showTime) return;
|
||||
let formatTime = day.format("YYYY-MM-DD");
|
||||
@@ -156,7 +168,7 @@ export default {
|
||||
|
||||
if (resStart || resMiddle || resEnd)
|
||||
return {
|
||||
"set-template": !!this.template.item?.label,
|
||||
"set-template": !!this.template.item?.label && this.setActiveCell(),
|
||||
status: !!this.activeButton,
|
||||
"set-date": !this.activeButton,
|
||||
};
|
||||
@@ -171,11 +183,6 @@ export default {
|
||||
this.result.push(this.startMonth.clone().add(i - 1, "d"));
|
||||
}
|
||||
},
|
||||
trimOwnerName(lastName, firstName, patronymic) {
|
||||
let checkedFirstName = firstName !== null ? firstName[0] + "." : "";
|
||||
let checkedPatronymic = patronymic !== null ? patronymic[0] + "." : "";
|
||||
return `${lastName} ${checkedFirstName}${checkedPatronymic}`;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
startMonth: {
|
||||
|
||||
Reference in New Issue
Block a user