WIP Добавил список записей клиента
This commit is contained in:
@@ -64,4 +64,5 @@
|
|||||||
--bg-disable-grey-color: #f0f0f0
|
--bg-disable-grey-color: #f0f0f0
|
||||||
--bg-grey-color: rgba(37, 40, 80, 0.15)
|
--bg-grey-color: rgba(37, 40, 80, 0.15)
|
||||||
--bg-aqua-blue: #55c5e8
|
--bg-aqua-blue: #55c5e8
|
||||||
|
--bg-status-green: #55CD76
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
.w-full.h-full
|
.w-full.h-full
|
||||||
medical-header.mb-2(
|
.flex.w-full.gap-x-2.pb-2
|
||||||
v-model="currentMenuItem",
|
medical-header(
|
||||||
:change-shown-remove-modal="changeShownRemoveModal",
|
v-model="currentMenuItem",
|
||||||
)
|
:change-shown-remove-modal="changeShownRemoveModal",
|
||||||
|
)
|
||||||
|
medical-records
|
||||||
component(
|
component(
|
||||||
v-if="currentMenuItem",
|
v-if="currentMenuItem",
|
||||||
v-bind:is="currentMenuItem",
|
v-bind:is="currentMenuItem",
|
||||||
@@ -17,6 +19,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import MedicalHeader from "@/pages/newMedicalCard/components/MedicalHeader.vue";
|
import MedicalHeader from "@/pages/newMedicalCard/components/MedicalHeader.vue";
|
||||||
|
import MedicalRecords from "@/pages/newMedicalCard/components/MedicalRecords.vue";
|
||||||
import MedicalBaseInfo from "@/pages/newMedicalCard/components/MedicalBaseInfo.vue";
|
import MedicalBaseInfo from "@/pages/newMedicalCard/components/MedicalBaseInfo.vue";
|
||||||
import BaseModal from "@/components/base/BaseModal.vue";
|
import BaseModal from "@/components/base/BaseModal.vue";
|
||||||
import MedicalRemoveModal from "@/pages/newMedicalCard/components/MedicalRemoveModal.vue";
|
import MedicalRemoveModal from "@/pages/newMedicalCard/components/MedicalRemoveModal.vue";
|
||||||
@@ -25,6 +28,7 @@ export default {
|
|||||||
name: "TheMedicalCard",
|
name: "TheMedicalCard",
|
||||||
components: {
|
components: {
|
||||||
MedicalHeader,
|
MedicalHeader,
|
||||||
|
MedicalRecords,
|
||||||
MedicalBaseInfo,
|
MedicalBaseInfo,
|
||||||
BaseModal,
|
BaseModal,
|
||||||
MedicalRemoveModal,
|
MedicalRemoveModal,
|
||||||
|
|||||||
69
src/pages/newMedicalCard/components/MedicalRecords.vue
Normal file
69
src/pages/newMedicalCard/components/MedicalRecords.vue
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
<template lang="pug">
|
||||||
|
.wrapper.rounded.flex.flex-col
|
||||||
|
.header.w-full.h-fit.flex.justify-between.px-6.pt-4.pb-3.text-sm.font-medium
|
||||||
|
span Записи
|
||||||
|
span {{ events.length }}
|
||||||
|
.w-full.h-full.py-10px.pl-6.pr-2
|
||||||
|
.events.flex.flex-col.pr-3.overflow-y-auto
|
||||||
|
.event.flex.justify-between.items-start.py-10px(v-for="(event, index) in getEventsList")
|
||||||
|
.flex.flex-col.gap-y-6px
|
||||||
|
span.date.font-bold.whitespace-nowrap {{ event.date }}
|
||||||
|
.time.flex.items-center.gap-x-6px
|
||||||
|
q-icon(name="app:time" size="13px")
|
||||||
|
span.font-medium.text-smm.whitespace-nowrap {{ `${event.startTime} - ${event.endTime}` }}
|
||||||
|
.flex.gap-x-1.text-smm.font-medium
|
||||||
|
span {{ event.status }}
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import moment from "moment";
|
||||||
|
import { mapState } from "vuex";
|
||||||
|
import { getChangeMonth } from "@/shared/utils/getChangeStrings";
|
||||||
|
import { mapEventStatus } from "@/pages/newMedicalCard/utils/medicalConfig";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "MedicalRecords",
|
||||||
|
computed: {
|
||||||
|
...mapState({
|
||||||
|
events: (state) => state.medical.events,
|
||||||
|
}),
|
||||||
|
getEventsList() {
|
||||||
|
return [
|
||||||
|
...this.events.map((el) => {
|
||||||
|
const start = moment(el.event.start);
|
||||||
|
const end = moment(el.event.end);
|
||||||
|
return {
|
||||||
|
...el,
|
||||||
|
date: `${start.format("D")} ${getChangeMonth(
|
||||||
|
start.format("MMMM")
|
||||||
|
)} (${start.format("dd")})`,
|
||||||
|
startTime: start.format("HH:mm"),
|
||||||
|
endTime: end.format("HH:mm"),
|
||||||
|
status: mapEventStatus[el.event.status],
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="sass" scoped>
|
||||||
|
.wrapper
|
||||||
|
width: 16.8%
|
||||||
|
height: 18.7%
|
||||||
|
background-color: var(--default-white)
|
||||||
|
.header
|
||||||
|
border-bottom: 1px solid var(--border-light-grey-color)
|
||||||
|
color: var(--font-grey-color)
|
||||||
|
.events
|
||||||
|
height: 124px
|
||||||
|
&::-webkit-scrollbar
|
||||||
|
width: 4px
|
||||||
|
.event
|
||||||
|
border-bottom: 1px solid var(--border-light-grey-color)
|
||||||
|
.date
|
||||||
|
color: var(--font-dark-blue-color)
|
||||||
|
.time
|
||||||
|
color: var(--font-grey-color)
|
||||||
|
</style>
|
||||||
@@ -542,3 +542,10 @@ export const documentForm = [
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const mapEventStatus = {
|
||||||
|
COMPLETED: "Принят",
|
||||||
|
CANCELED: "Отказ",
|
||||||
|
RECEPTION: "На приеме",
|
||||||
|
PLANNED: "Не принят",
|
||||||
|
};
|
||||||
|
|||||||
5
src/shared/utils/getChangeStrings.js
Normal file
5
src/shared/utils/getChangeStrings.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
export function getChangeMonth(month) {
|
||||||
|
const changeStr = month.replace(/[ь,й]/g, "");
|
||||||
|
if (changeStr.slice(-1) === "т") return changeStr + "a";
|
||||||
|
else return changeStr + "я";
|
||||||
|
}
|
||||||
@@ -59,6 +59,7 @@ const state = () => ({
|
|||||||
allergies: [],
|
allergies: [],
|
||||||
avatar: "",
|
avatar: "",
|
||||||
benefitData: [],
|
benefitData: [],
|
||||||
|
events: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
const getters = {
|
const getters = {
|
||||||
@@ -241,6 +242,7 @@ const actions = {
|
|||||||
commit("setDocumentsData");
|
commit("setDocumentsData");
|
||||||
commit("setAllergiesData");
|
commit("setAllergiesData");
|
||||||
commit("setConfidantData");
|
commit("setConfidantData");
|
||||||
|
commit("setEventsPersonData", res.person.id);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getPersonsFiltredList() {
|
getPersonsFiltredList() {
|
||||||
@@ -296,6 +298,11 @@ const mutations = {
|
|||||||
setPersonFiltredList(state, persons) {
|
setPersonFiltredList(state, persons) {
|
||||||
state.personFiltredList = persons;
|
state.personFiltredList = persons;
|
||||||
},
|
},
|
||||||
|
setEventsPersonData(state, id) {
|
||||||
|
fetchWrapper.get(`general/person/${id}/detail/`).then((res) => {
|
||||||
|
state.events = res.events;
|
||||||
|
});
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
Reference in New Issue
Block a user