From 3ccfe8fccdfb97b13336cfcfb139d4144e3aef31 Mon Sep 17 00:00:00 2001 From: kandrusyak Date: Thu, 17 Aug 2023 21:19:38 +0300 Subject: [PATCH] fix search row --- .../components/MedicalCardSearchRow.vue | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/pages/medcards/components/MedicalCardSearchRow.vue b/src/pages/medcards/components/MedicalCardSearchRow.vue index 4a7d5a6..a55a7cc 100644 --- a/src/pages/medcards/components/MedicalCardSearchRow.vue +++ b/src/pages/medcards/components/MedicalCardSearchRow.vue @@ -5,23 +5,23 @@ ) q-avatar(size="36px") img(:src="avatar") - span.font-semibold.text-dark {{patientName}} + span.font-semibold.text-dark {{fullName}} .field(:style="headerStyle(headerConfig[1])") - span.text-dark {{ convertDate(medcardInfo?.person?.birth_date) }} г. + span.text-dark {{ formatDate(person?.birth_date) }} г. .field.gap-x-2(:style="headerStyle(headerConfig[2])") .rounded-full.h-2.w-2(:style="{background: patientPriority?.color}") span(:style="{color: patientPriority?.color}") {{ patientPriority?.text }} .field(:style="headerStyle(headerConfig[3])") .medcard-number.rounded.h-7.py-1.pl-3.pr-2.flex.items-center.justify-between.w-full.cursor-pointer( - @click="copyValue(medcardInfo?.number)" + @click="copyMedicalCardNumber" ) span.text-dark.cursor-pointer {{ medcardInfo?.number }} q-icon.copy(size="18px", name="app:copy") .field(:style="headerStyle(headerConfig[4])") - span.text-dark {{ convertDate(medcardInfo?.created_at) }} г. + span.text-dark {{ formatDate(medcardInfo?.created_at) }} г. .field.gap-x-3(:style="headerStyle(headerConfig[5])") .track.h-2.flex-1.rounded - .thumb.h-full.rounded(:style="thumbStyle") + .thumb.h-full.rounded(:style="fillingThumbStyle") span.grey-color {{ medcardInfo?.filling_percentage || 0 }}% .field(:style="{...headerStyle(headerConfig[6])}") q-icon.medcard.cursor-pointer(name="app:medcard", size="20px", @click="openMedicalCard") @@ -51,15 +51,18 @@ export default { }; }, computed: { - patientName() { - return `${this.medcardInfo?.person?.last_name} ${this.medcardInfo?.person?.first_name} ${this.medcardInfo?.person?.patronymic}`; + fullName() { + return `${this.person?.last_name} ${this.person?.first_name} ${this.person?.patronymic}`; + }, + person() { + return this.medcardInfo?.person; }, patientPriority() { return priorityList?.find( ({ priority }) => (this.medcardInfo.priority || null) === priority ); }, - thumbStyle() { + fillingThumbStyle() { let percentage = this.medcardInfo?.filling_percentage || 0; return { width: `calc(${percentage}%)`, @@ -77,16 +80,13 @@ export default { getMedicalCardData: "getMedicalCardDataByPersonId", }), openMedicalCard() { - this.getMedicalCardData({ - personId: this.medcardInfo.person_id, - successCallback: (id) => this.$router.push("medical-card/" + id), - }); + this.$router.push("medical-card/" + this.medcardInfo.id); }, - convertDate(date) { + formatDate(date) { return moment(date)?.format("DD MMMM YYYY"); }, - copyValue(text) { - navigator.clipboard.writeText(text); + copyMedicalCardNumber() { + navigator.clipboard.writeText(this.medcardInfo.number); addNotification( new Date().getTime(), "",