1 Commits

Author SHA1 Message Date
kandrusyak
3ccfe8fccd fix search row 2023-08-17 21:19:38 +03:00

View File

@@ -5,23 +5,23 @@
) )
q-avatar(size="36px") q-avatar(size="36px")
img(:src="avatar") img(:src="avatar")
span.font-semibold.text-dark {{patientName}} span.font-semibold.text-dark {{fullName}}
.field(:style="headerStyle(headerConfig[1])") .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])") .field.gap-x-2(:style="headerStyle(headerConfig[2])")
.rounded-full.h-2.w-2(:style="{background: patientPriority?.color}") .rounded-full.h-2.w-2(:style="{background: patientPriority?.color}")
span(:style="{color: patientPriority?.color}") {{ patientPriority?.text }} span(:style="{color: patientPriority?.color}") {{ patientPriority?.text }}
.field(:style="headerStyle(headerConfig[3])") .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( .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 }} span.text-dark.cursor-pointer {{ medcardInfo?.number }}
q-icon.copy(size="18px", name="app:copy") q-icon.copy(size="18px", name="app:copy")
.field(:style="headerStyle(headerConfig[4])") .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])") .field.gap-x-3(:style="headerStyle(headerConfig[5])")
.track.h-2.flex-1.rounded .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 }}% span.grey-color {{ medcardInfo?.filling_percentage || 0 }}%
.field(:style="{...headerStyle(headerConfig[6])}") .field(:style="{...headerStyle(headerConfig[6])}")
q-icon.medcard.cursor-pointer(name="app:medcard", size="20px", @click="openMedicalCard") q-icon.medcard.cursor-pointer(name="app:medcard", size="20px", @click="openMedicalCard")
@@ -51,15 +51,18 @@ export default {
}; };
}, },
computed: { computed: {
patientName() { fullName() {
return `${this.medcardInfo?.person?.last_name} ${this.medcardInfo?.person?.first_name} ${this.medcardInfo?.person?.patronymic}`; return `${this.person?.last_name} ${this.person?.first_name} ${this.person?.patronymic}`;
},
person() {
return this.medcardInfo?.person;
}, },
patientPriority() { patientPriority() {
return priorityList?.find( return priorityList?.find(
({ priority }) => (this.medcardInfo.priority || null) === priority ({ priority }) => (this.medcardInfo.priority || null) === priority
); );
}, },
thumbStyle() { fillingThumbStyle() {
let percentage = this.medcardInfo?.filling_percentage || 0; let percentage = this.medcardInfo?.filling_percentage || 0;
return { return {
width: `calc(${percentage}%)`, width: `calc(${percentage}%)`,
@@ -77,16 +80,13 @@ export default {
getMedicalCardData: "getMedicalCardDataByPersonId", getMedicalCardData: "getMedicalCardDataByPersonId",
}), }),
openMedicalCard() { openMedicalCard() {
this.getMedicalCardData({ this.$router.push("medical-card/" + this.medcardInfo.id);
personId: this.medcardInfo.person_id,
successCallback: (id) => this.$router.push("medical-card/" + id),
});
}, },
convertDate(date) { formatDate(date) {
return moment(date)?.format("DD MMMM YYYY"); return moment(date)?.format("DD MMMM YYYY");
}, },
copyValue(text) { copyMedicalCardNumber() {
navigator.clipboard.writeText(text); navigator.clipboard.writeText(this.medcardInfo.number);
addNotification( addNotification(
new Date().getTime(), new Date().getTime(),
"", "",