From 99c0c8449a2c312f20ac72855f2e00cf09f123c8 Mon Sep 17 00:00:00 2001 From: Daria Golova Date: Thu, 29 Jun 2023 18:06:58 +0300 Subject: [PATCH] =?UTF-8?q?WIP=20=D0=9D=D0=B0=D1=87=D0=B0=D0=BB=D0=B0=20?= =?UTF-8?q?=D0=BC=D0=BE=D0=B4=D0=B0=D0=BB=D0=BA=D1=83=20=D0=BF=D1=80=D0=B5?= =?UTF-8?q?=D0=B4=D0=BF=D1=80=D0=BE=D1=81=D0=BC=D0=BE=D1=82=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/newCalendar/TheCalendar.vue | 23 ++++- .../newCalendar/components/CalendarColumn.vue | 7 +- .../components/CalendarRecordCard.vue | 3 +- .../components/CalendarRecordPreview.vue | 92 ++++++++++++++++++ src/pages/newCalendar/utils/calendarConfig.js | 93 +++++++++++++++++++ src/store/modules/calendar.js | 7 ++ 6 files changed, 221 insertions(+), 4 deletions(-) create mode 100644 src/pages/newCalendar/components/CalendarRecordPreview.vue diff --git a/src/pages/newCalendar/TheCalendar.vue b/src/pages/newCalendar/TheCalendar.vue index add8028..a059a5d 100644 --- a/src/pages/newCalendar/TheCalendar.vue +++ b/src/pages/newCalendar/TheCalendar.vue @@ -5,6 +5,8 @@ calendar-wrapper.ml-2(:open-sidebar="isOpen") base-modal(v-model="isShowForm", title="Создание записи", modal-padding) record-creation-form(v-model="isShowForm", :close-form="closeForm") + base-modal(v-model="previewVisibility", :hideHeader="true", :modalPadding="true") + calendar-record-preview(v-model:preview-visibility="previewVisibility") diff --git a/src/pages/newCalendar/components/CalendarColumn.vue b/src/pages/newCalendar/components/CalendarColumn.vue index 5c3e70f..f5504fa 100644 --- a/src/pages/newCalendar/components/CalendarColumn.vue +++ b/src/pages/newCalendar/components/CalendarColumn.vue @@ -9,7 +9,8 @@ :key="record?.id", :record="record", :expanded-type="expandedDisplayType", - :style="eventCardPosition(record.start, record.end)" + :style="eventCardPosition(record.start, record.end)", + @click="changeSelectedRecordId(record?.id)", ) .footer.flex.items-center.justify-center.bg-white.h-9(v-if="!expandedDisplayType") span.text-smm.color-grey 0 записей @@ -20,6 +21,7 @@ import * as moment from "moment/moment"; import { recordList } from "@/pages/newCalendar/utils/calendarConfig.js"; import CalendarRecordCard from "@/pages/newCalendar/components/CalendarRecordCard.vue"; import { verifyTime } from "@/pages/newCalendar/utils/calendarFunctions.js"; +import { mapActions } from "vuex"; export default { name: "CalendarColumn", components: { CalendarRecordCard }, @@ -47,6 +49,9 @@ export default { }, }, methods: { + ...mapActions({ + changeSelectedRecordId: "changeSelectedRecordId", + }), transformDayName(name) { return name[0]?.toUpperCase() + name?.slice(1); }, diff --git a/src/pages/newCalendar/components/CalendarRecordCard.vue b/src/pages/newCalendar/components/CalendarRecordCard.vue index 9f1fd8c..1523bb0 100644 --- a/src/pages/newCalendar/components/CalendarRecordCard.vue +++ b/src/pages/newCalendar/components/CalendarRecordCard.vue @@ -37,7 +37,7 @@ .h-6.w-6.color-black.background-dark-grey.text-xxs.rounded.flex.items-center.justify-center( v-if="collapsedDisplayCondition" ) +1 - span.text-xxs.self-end(v-if="servicesCount && bodyClass?.['flex-col']") {{`${servicesCount} услуги`}} + span.text-xxs.self-end(v-if="record?.services.length && bodyClass?.['flex-col']") {{`${record?.services.length} услуг`}} + + diff --git a/src/pages/newCalendar/utils/calendarConfig.js b/src/pages/newCalendar/utils/calendarConfig.js index e62b04f..4d5cc78 100644 --- a/src/pages/newCalendar/utils/calendarConfig.js +++ b/src/pages/newCalendar/utils/calendarConfig.js @@ -298,6 +298,7 @@ export const recordList = [ last_name: "Харитонова", first_name: "Ольга", patronymic: "Васильевна", + birth_date: "1990-03-12", contacts: [ { value: "+7 (910) 424–13–13", @@ -313,6 +314,28 @@ export const recordList = [ medicalCard: { status: "partially_filled", }, + services: [ + { + title: "Чистка зубов", + cost: 500, + }, + { + title: "Осмотр", + cost: 0, + }, + { + title: "Лечение среднего кариеса", + cost: 2000, + }, + { + title: "Изготовление коронки", + cost: 2700, + }, + { + title: "Снятие слепков", + cost: 400, + }, + ], }, { id: "ba931000-7140-4977-bd09-1ac212b8b8e5", @@ -329,6 +352,7 @@ export const recordList = [ last_name: "Гаранова", first_name: "Наталья", patronymic: "Романовна", + birth_date: "1990-04-12", contacts: [ { value: "+7 (910) 424–13–13", @@ -344,6 +368,28 @@ export const recordList = [ medicalCard: { status: "not_filled", }, + services: [ + { + title: "Чистка зубов", + cost: 500, + }, + { + title: "Осмотр", + cost: 0, + }, + { + title: "Лечение среднего кариеса", + cost: 2000, + }, + { + title: "Изготовление коронки", + cost: 2700, + }, + { + title: "Снятие слепков", + cost: 400, + }, + ], }, { id: "4cd94bec-a0df-4a18-879d-f64cd6d7098e", @@ -360,6 +406,7 @@ export const recordList = [ last_name: "Харитонова", first_name: "Ольга", patronymic: "Васильевна", + birth_date: "1990-05-12", contacts: [ { value: "+7 (910) 424–13–13", @@ -371,5 +418,51 @@ export const recordList = [ medicalCard: { status: "filled", }, + services: [ + { + title: "Чистка зубов", + cost: 500, + }, + { + title: "Осмотр", + cost: 0, + }, + { + title: "Лечение среднего кариеса", + cost: 2000, + }, + { + title: "Изготовление коронки", + cost: 2700, + }, + { + title: "Снятие слепков", + cost: 400, + }, + ], + }, +]; + +export const recordPreviewConfig = [ + { + title: "Статус", + data: "statusLabel", + icon: "statusIcon", + }, + { + title: "Дата", + data: "date", + }, + { + title: "Время", + data: "time", + }, + { + title: "Медкарта", + data: null, + }, + { + title: "Услуги", + data: null, }, ]; diff --git a/src/store/modules/calendar.js b/src/store/modules/calendar.js index 2e59ac9..cad59b1 100644 --- a/src/store/modules/calendar.js +++ b/src/store/modules/calendar.js @@ -10,6 +10,7 @@ const state = () => ({ from: moment().clone().startOf("week"), to: moment().clone().endOf("week"), }, + selectedRecordId: null, }); const getters = {}; @@ -18,12 +19,18 @@ const actions = { changeSelectedDates({ commit }, dates) { commit("setSelectedDates", dates); }, + changeSelectedRecordId({ commit }, id) { + commit("setSelectedRecordId", id); + }, }; const mutations = { setSelectedDates(state, data) { state.selectedDates = { ...data }; }, + setSelectedRecordId(state, id) { + state.selectedRecordId = id; + }, }; export default {