diff --git a/src/pages/newCalendar/TheCalendar.vue b/src/pages/newCalendar/TheCalendar.vue index 9759040..d35cd6d 100644 --- a/src/pages/newCalendar/TheCalendar.vue +++ b/src/pages/newCalendar/TheCalendar.vue @@ -83,11 +83,9 @@ export default { immediate: true, deep: true, handler(value) { - console.log("отработало в роутинге", this.$route.path === "/calendar"); if (this.$route.path === "/calendar") { let dateType = this.calendarShape === "doctor" ? "week" : "day"; if (!value?.start || !value?.end) { - console.log("тут 1"); this.changeSelectedDates({ from: moment().clone().startOf(dateType), to: moment().clone().endOf(dateType), @@ -102,14 +100,9 @@ export default { value?.start !== this.selectedDates?.from?.format("DD.MM.YYYY") || value?.end !== this.selectedDates?.to?.format("DD.MM.YYYY") ) { - console.log( - "тут 2", - value?.start !== this.selectedDates?.from?.format("DD.MM.YYYY"), - value?.end !== this.selectedDates?.to?.format("DD.MM.YYYY") - ); this.changeSelectedDates({ - from: this.convertDate(value?.start), - to: this.convertDate(value?.end), + from: this.convertDate(value?.start).clone().startOf("day"), + to: this.convertDate(value?.end).clone().endOf("day"), }); } } diff --git a/src/pages/newCalendar/components/doctorCalendar/CalendarColumn.vue b/src/pages/newCalendar/components/doctorCalendar/CalendarColumn.vue index 2e285b6..e5bd845 100644 --- a/src/pages/newCalendar/components/doctorCalendar/CalendarColumn.vue +++ b/src/pages/newCalendar/components/doctorCalendar/CalendarColumn.vue @@ -44,5 +44,5 @@ export default { diff --git a/src/pages/newCalendar/components/doctorCalendar/CalendarHeader.vue b/src/pages/newCalendar/components/doctorCalendar/CalendarHeader.vue index 892b4fe..3b57dde 100644 --- a/src/pages/newCalendar/components/doctorCalendar/CalendarHeader.vue +++ b/src/pages/newCalendar/components/doctorCalendar/CalendarHeader.vue @@ -151,7 +151,7 @@ export default { diff --git a/src/pages/newCalendar/components/managerCalendar/CalendarColumn.vue b/src/pages/newCalendar/components/managerCalendar/CalendarColumn.vue index e9c5b32..59cb494 100644 --- a/src/pages/newCalendar/components/managerCalendar/CalendarColumn.vue +++ b/src/pages/newCalendar/components/managerCalendar/CalendarColumn.vue @@ -6,10 +6,10 @@ size="40px", round ) - img(:src="employee?.photo || defaultPhoto", alt="doctor") + img(:src="medic?.photo || defaultPhoto", alt="doctor") .flex.flex-col.justify-between - span.text-dark {{trimName(employee?.last_name, employee?.first_name, employee?.patronymic)}} - span.text-xsx.color-grey {{employee?.job || "Терапевт"}} + span.text-dark {{trimName(medic?.last_name, medic?.first_name, medic?.patronymic)}} + span.text-xsx.color-grey {{medic?.job || "Терапевт"}} button(@click="locked = !locked") q-icon.lock-icon( :name="locked ? 'app:lock' : 'app:lock-open'", @@ -29,35 +29,34 @@ diff --git a/src/pages/newCalendar/components/managerCalendar/CalendarHeader.vue b/src/pages/newCalendar/components/managerCalendar/CalendarHeader.vue index da16722..85315ea 100644 --- a/src/pages/newCalendar/components/managerCalendar/CalendarHeader.vue +++ b/src/pages/newCalendar/components/managerCalendar/CalendarHeader.vue @@ -113,7 +113,6 @@ export default { deep: true, immediate: true, handler(val) { - console.log(!val?.from.isSame(this.date, "day"), this.date); if (!val?.from.isSame(this.date, "day")) this.initializeDates(); }, }, @@ -122,7 +121,7 @@ export default { diff --git a/src/pages/newCalendar/mixins/wrapperMixin.js b/src/pages/newCalendar/mixins/wrapperMixin.js index b406623..b3da9a3 100644 --- a/src/pages/newCalendar/mixins/wrapperMixin.js +++ b/src/pages/newCalendar/mixins/wrapperMixin.js @@ -23,6 +23,7 @@ export const wrapperMixin = { timeCoil: [], timer: null, pixelsPerHour: 76, + isCurrent: true, }; }, computed: { @@ -66,7 +67,6 @@ export const wrapperMixin = { methods: { changeCurrentTime() { this.currentTime = moment().format("HH:mm:ss"); - console.log(this.currentTime); }, changeTimeCoil() { this.timeCoil = this.timeCoil.map((elem) => { @@ -104,6 +104,30 @@ export const wrapperMixin = { } return result; }, + timeCoilInitialization() { + this.timeCoil = []; + for (let i = this.validateStartTime; i < this.validateEndTime; i++) { + if ( + i === this.hours && + this.hours !== this.validateEndTime && + this.isCurrent + ) { + this.timeCoil.push(this.hoursMinutes); + } else this.timeCoil.push(`${i}:00`); + } + }, + }, + watch: { + currentTime() { + if ( + this.hours === this.validateEndTime && + this.minutes > 0 && + this.timer + ) { + this.stopTimer(); + this.timeCoilInitialization(); + } + }, }, beforeUnmount() { this.stopTimer(); diff --git a/src/pages/newCalendar/mixins/columnStyle.sass b/src/pages/newCalendar/sass/columnStyle.sass similarity index 100% rename from src/pages/newCalendar/mixins/columnStyle.sass rename to src/pages/newCalendar/sass/columnStyle.sass diff --git a/src/pages/newCalendar/mixins/headerStyle.sass b/src/pages/newCalendar/sass/headerStyle.sass similarity index 100% rename from src/pages/newCalendar/mixins/headerStyle.sass rename to src/pages/newCalendar/sass/headerStyle.sass diff --git a/src/pages/newCalendar/mixins/wrapperStyle.sass b/src/pages/newCalendar/sass/wrapperStyle.sass similarity index 100% rename from src/pages/newCalendar/mixins/wrapperStyle.sass rename to src/pages/newCalendar/sass/wrapperStyle.sass diff --git a/src/pages/newCalendar/utils/calendarConfig.js b/src/pages/newCalendar/utils/calendarConfig.js index 17450df..bd3c30f 100644 --- a/src/pages/newCalendar/utils/calendarConfig.js +++ b/src/pages/newCalendar/utils/calendarConfig.js @@ -778,7 +778,7 @@ export const services = [ export const recordList = [ { - id: "c3df0a95-8093-41f1-9584-5b70ee05e71c", + id: "asdf0a95-8093-41f1-9584-5b70ee05e71c", start: "2023-09-18T10:00:00Z", end: "2023-09-18T11:00:00Z", employee: { @@ -823,7 +823,7 @@ export const recordList = [ ], }, { - id: "ba931000-7140-4977-bd09-1ac212b8b8e5", + id: "ss931000-7140-4977-bd09-1ac212b8b8e5", start: "2023-09-18T15:00:00Z", end: "2023-09-18T15:30:00Z", employee: { @@ -877,11 +877,11 @@ export const recordList = [ ], }, { - id: "4cd94bec-a0df-4a18-879d-f64cd6d5698e", + id: "ccd94bec-a0df-4a18-879d-f64cd6d5698e", start: "2023-09-18T13:00:00Z", end: "2023-09-18T14:30:00Z", employee: { - id: "464101e6-b4e6-46a4-8ef6-08ecb2921493", + id: "111101e6-b4e6-46a4-8ef6-08ecb2921493", last_name: "Гурцев", first_name: "Семен", patronymic: "Семенович", @@ -930,105 +930,105 @@ export const recordList = [ }, ], }, - // { - // id: "ba931000-7140-4977-bd09-1ac233b8b8e5", - // start: "2023-09-18T15:00:00Z", - // end: "2023-09-18T15:30:00Z", - // employee: { - // id: "464101e6-b4e6-46a4-8ef6-08ecb2921493", - // last_name: "Лебедев", - // first_name: "Леонид", - // patronymic: "Семенович", - // }, - // person: { - // id: "d340d344-4fc7-4fbe-9db8-b7562b70438d", - // last_name: "Гаранова", - // first_name: "Наталья", - // patronymic: "Романовна", - // birth_date: "1990-04-12", - // photo: personImage, - // contacts: [ - // { - // value: "+7 (910) 424–13–13", - // kind: "PHONE", - // }, - // { - // value: "Haritonich@mail.ru", - // kind: "EMAIL", - // }, - // ], - // }, - // status: "accepted", - // medicalCard: { - // status: "not_filled", - // }, - // }, - // { - // id: "ba931000-7140-4977-bd09-1ac233b8b8e5", - // start: "2023-09-18T15:00:00Z", - // end: "2023-09-18T15:30:00Z", - // employee: { - // id: "464101e6-b4e6-46a4-8ef6-08ecb1121493", - // last_name: "Петров", - // first_name: "Леонид", - // patronymic: "Семенович", - // }, - // person: { - // id: "d340d344-4fc7-4fbe-9db8-b7562b70438d", - // last_name: "Гаранова", - // first_name: "Наталья", - // patronymic: "Романовна", - // birth_date: "1990-04-12", - // photo: personImage, - // contacts: [ - // { - // value: "+7 (910) 424–13–13", - // kind: "PHONE", - // }, - // { - // value: "Haritonich@mail.ru", - // kind: "EMAIL", - // }, - // ], - // }, - // status: "accepted", - // medicalCard: { - // status: "not_filled", - // }, - // }, - // { - // id: "ba931000-7140-4977-bd09-1ac233b8b8e5", - // start: "2023-09-18T15:00:00Z", - // end: "2023-09-18T15:30:00Z", - // employee: { - // id: "464101e6-b4e6-46a4-8ef6-22ecb2921493", - // last_name: "Ленин", - // first_name: "Леонид", - // patronymic: "Семенович", - // }, - // person: { - // id: "d340d344-4fc7-4fbe-9db8-b7562b70438d", - // last_name: "Гаранова", - // first_name: "Наталья", - // patronymic: "Романовна", - // birth_date: "1990-04-12", - // photo: personImage, - // contacts: [ - // { - // value: "+7 (910) 424–13–13", - // kind: "PHONE", - // }, - // { - // value: "Haritonich@mail.ru", - // kind: "EMAIL", - // }, - // ], - // }, - // status: "accepted", - // medicalCard: { - // status: "not_filled", - // }, - // }, + { + id: "vv931000-7140-4977-bd09-1ac233b8b8e5", + start: "2023-09-18T15:00:00Z", + end: "2023-09-18T15:30:00Z", + employee: { + id: "333101e6-b4e6-46a4-8ef6-08ecb2921493", + last_name: "Лебедев", + first_name: "Леонид", + patronymic: "Семенович", + }, + person: { + id: "d340d344-4fc7-4fbe-9db8-b7562b70438d", + last_name: "Гаранова", + first_name: "Наталья", + patronymic: "Романовна", + birth_date: "1990-04-12", + photo: personImage, + contacts: [ + { + value: "+7 (910) 424–13–13", + kind: "PHONE", + }, + { + value: "Haritonich@mail.ru", + kind: "EMAIL", + }, + ], + }, + status: "accepted", + medicalCard: { + status: "not_filled", + }, + }, + { + id: "rr931000-7140-4977-bd09-1ac233b8b8e5", + start: "2023-09-18T15:00:00Z", + end: "2023-09-18T15:30:00Z", + employee: { + id: "666101e6-b4e6-46a4-8ef6-08ecb7721493", + last_name: "Петров", + first_name: "Леонид", + patronymic: "Семенович", + }, + person: { + id: "d340d344-4fc7-4fbe-9db8-b7562b70438d", + last_name: "Гаранова", + first_name: "Наталья", + patronymic: "Романовна", + birth_date: "1990-04-12", + photo: personImage, + contacts: [ + { + value: "+7 (910) 424–13–13", + kind: "PHONE", + }, + { + value: "Haritonich@mail.ru", + kind: "EMAIL", + }, + ], + }, + status: "accepted", + medicalCard: { + status: "not_filled", + }, + }, + { + id: "ma931000-7140-4977-bd09-1ac233b8b8e5", + start: "2023-09-18T15:00:00Z", + end: "2023-09-18T15:30:00Z", + employee: { + id: "999101e6-b4e6-46a4-8ef6-22ecb2921493", + last_name: "Ленин", + first_name: "Леонид", + patronymic: "Семенович", + }, + person: { + id: "d340d344-4fc7-4fbe-9db8-b7562b70438d", + last_name: "Гаранова", + first_name: "Наталья", + patronymic: "Романовна", + birth_date: "1990-04-12", + photo: personImage, + contacts: [ + { + value: "+7 (910) 424–13–13", + kind: "PHONE", + }, + { + value: "Haritonich@mail.ru", + kind: "EMAIL", + }, + ], + }, + status: "accepted", + medicalCard: { + status: "not_filled", + }, + }, ]; export const recordPreviewConfig = [ diff --git a/src/pages/newCalendar/utils/calendarFunctions.js b/src/pages/newCalendar/utils/calendarFunctions.js index 5b0ea9b..33d8d76 100644 --- a/src/pages/newCalendar/utils/calendarFunctions.js +++ b/src/pages/newCalendar/utils/calendarFunctions.js @@ -3,8 +3,8 @@ export function convertTime(str, startIndex, endIndex) { } export function trimName(lastName, firstName, patronymic) { - let checkedFirstName = firstName !== null ? firstName?.[0] + ". " : ""; - let checkedPatronymic = patronymic !== null ? patronymic?.[0] + "." : ""; + let checkedFirstName = firstName ? firstName?.[0] + ". " : ""; + let checkedPatronymic = patronymic ? patronymic?.[0] + "." : ""; return `${lastName} ${checkedFirstName}${checkedPatronymic}`; } diff --git a/src/store/index.js b/src/store/index.js index b0ecdf5..86ff1e2 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -8,7 +8,7 @@ export default createStore({ imgUrl: "https://astra-dev.dopcore.com/api/store/", routingHistory: window.history, userData: {}, - calendarShape: "manager", + calendarShape: "doctor", }, modules: { medical,