fix search row

This commit is contained in:
kandrusyak
2023-08-17 21:19:38 +03:00
parent e59624e263
commit 3ccfe8fccd

View File

@@ -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(),
"",