This commit is contained in:
nasir@endelospay.com 2024-06-11 01:35:27 +05:00
parent f10af129df
commit 3f081cee50
7 changed files with 37 additions and 32 deletions

View File

@ -16,7 +16,6 @@ const props = defineProps({
}) })
const formatDateDate = (date) => { const formatDateDate = (date) => {
const messageDate = new Date(date); const messageDate = new Date(date);
const options = { const options = {
@ -29,23 +28,25 @@ const formatDateDate = (date) => {
return messageDate.toLocaleDateString('en-US', options).replace(/\//g, '-'); return messageDate.toLocaleDateString('en-US', options).replace(/\//g, '-');
}; };
const downloadFile = (fileUrl) => { const downloadFile = async (fileUrl, fileName = 'downloadedFile.png') => {
const link = document.createElement('a');
link.href = fileUrl;
link.download = 'noteFile.png';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
};
const downloadImage = async (imageUrl) => {
try { try {
const response = await fetch(imageUrl) const response = await fetch(fileUrl);
const blob = await response.blob() if (!response.ok) throw new Error('Network response was not ok');
const fileName = imageUrl.split('/').pop() const blob = await response.blob();
saveAs(blob, fileName) const link = document.createElement('a');
const url = window.URL.createObjectURL(blob);
link.href = url;
link.download = fileName;
document.body.appendChild(link);
link.click();
window.URL.revokeObjectURL(url);
document.body.removeChild(link);
} catch (error) { } catch (error) {
console.error('Error downloading image:', error) } console.error('Download failed', error);
} }
};
</script> </script>
<template> <template>
@ -75,7 +76,7 @@ const downloadImage = async (imageUrl) => {
</span> </span>
<span class="app-timeline-title" v-if="p_note.note_type == 'file'"> <span class="app-timeline-title" v-if="p_note.note_type == 'file'">
<VIcon>ri-attachment-2</VIcon> <button @click="downloadImage(p_note.note)">Download Image</button> <VIcon>ri-attachment-2</VIcon> <button @click="downloadFile(p_note.note,'noteFile.png')">Download Image</button>
</span> </span>
<span class="app-timeline-meta">{{ formatDateDate(p_note.created_at) }}</span> <span class="app-timeline-meta">{{ formatDateDate(p_note.created_at) }}</span>

View File

@ -142,8 +142,7 @@ const resolveUserRoleVariant = role => {
<span class="font-weight-medium"> <span class="font-weight-medium">
Address: Address:
</span> </span>
<span class="text-body-1">{{ props.userData.patient.address }} <span class="text-body-1">{{ props.userData.patient.address }} ,{{ props.userData.patient.city }},{{ props.userData.patient.state }} {{ props.userData.patient.zip_code }}</span>
<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ props.userData.patient.city }},{{ props.userData.patient.state }} {{ props.userData.patient.zip_code }}</span>
</VListItemTitle> </VListItemTitle>
</VListItem> </VListItem>

View File

@ -2,9 +2,9 @@
import NotesPanel from '@/pages/patients/NotesPanel.vue' import NotesPanel from '@/pages/patients/NotesPanel.vue'
import PatienTabOverview from '@/pages/patients/PatienTabOverview.vue' import PatienTabOverview from '@/pages/patients/PatienTabOverview.vue'
import PatientBioPanel from '@/pages/patients/PatientBioPanel.vue' import PatientBioPanel from '@/pages/patients/PatientBioPanel.vue'
import PatientProfile from '@/pages/patients/PatientProfile.vue'
import PrescriptionPanel from '@/pages/patients/PrescriptionPanel.vue' import PrescriptionPanel from '@/pages/patients/PrescriptionPanel.vue'
import UserTabNotifications from '@/views/apps/user/view/UserTabNotifications.vue'
import { useStore } from 'vuex' import { useStore } from 'vuex'
const patientDtail = ref(null); const patientDtail = ref(null);
@ -25,10 +25,10 @@ const tabs = [
icon: 'ri-bookmark-line', icon: 'ri-bookmark-line',
title: 'Prescriptions', title: 'Prescriptions',
}, },
// { {
// icon: 'ri-notification-4-line', icon: 'ri-notification-4-line',
// title: 'Notifications', title: 'Profile',
// }, },
// { // {
// icon: 'ri-link-m', // icon: 'ri-link-m',
// title: 'Connections', // title: 'Connections',
@ -99,7 +99,7 @@ onMounted(async () => {
</VWindowItem> </VWindowItem>
<VWindowItem> <VWindowItem>
<UserTabNotifications /> <PatientProfile :prescription-data="patientDtail"/>
</VWindowItem> </VWindowItem>

View File

@ -16,10 +16,16 @@ const address1 = ref(null);
const dob = ref(null); const dob = ref(null);
const agePatient = ref(null); const agePatient = ref(null);
const isMobile = ref(window.innerWidth <= 768); const isMobile = ref(window.innerWidth <= 768);
const patientId = route.params.patient_id const patientId = route.params.id
const props = defineProps({
userData: {
type: Object,
required: true,
},
})
onMounted(async () => { onMounted(async () => {
const navbar = document.querySelector('.layout-navbar'); const navbar = document.querySelector('.layout-navbar');
const callDiv = document.querySelector('.layout-page-content'); const callDiv = document.querySelector('.layout-page-content');
if (navbar) { if (navbar) {

View File

@ -137,8 +137,7 @@ const resolveUserRoleVariant = role => {
<span class="font-weight-medium"> <span class="font-weight-medium">
Address: Address:
</span> </span>
<span class="text-body-1">{{ props.userData.telemed.home_address }} <span class="text-body-1">{{ props.userData.telemed.home_address }}, {{ props.userData.telemed.city }},{{ props.userData.telemed.state }} {{ props.userData.telemed.zip_code }}</span>
<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ props.userData.telemed.city }},{{ props.userData.telemed.state }} {{ props.userData.telemed.zip_code }}</span>
</VListItemTitle> </VListItemTitle>
</VListItem> </VListItem>

View File

@ -139,9 +139,9 @@ export const routes = [
component: () => import('@/pages/providers/provider-profile.vue'), component: () => import('@/pages/providers/provider-profile.vue'),
}, },
{ {
path: '/admin/providers/patientprofile/:patient_id', path: '/admin/providers/patientprofile/:id',
name: 'admin-providers-patientprofile', name: 'admin-providers-patientprofile',
component: () => import('@/pages/patients/patientprofile.vue'), component: () => import('@/pages/patients/PatientProfile.vue'),
}, },
{ {
path: '/apps/email/filter/:filter', path: '/apps/email/filter/:filter',

2
typed-router.d.ts vendored
View File

@ -161,7 +161,7 @@ declare module 'vue-router/auto/routes' {
'patients-patient-profile': RouteRecordInfo<'patients-patient-profile', '/patients/patient-profile', Record<never, never>, Record<never, never>>, 'patients-patient-profile': RouteRecordInfo<'patients-patient-profile', '/patients/patient-profile', Record<never, never>, Record<never, never>>,
'patients-patien-tab-overview': RouteRecordInfo<'patients-patien-tab-overview', '/patients/PatienTabOverview', Record<never, never>, Record<never, never>>, 'patients-patien-tab-overview': RouteRecordInfo<'patients-patien-tab-overview', '/patients/PatienTabOverview', Record<never, never>, Record<never, never>>,
'patients-patient-bio-panel': RouteRecordInfo<'patients-patient-bio-panel', '/patients/PatientBioPanel', Record<never, never>, Record<never, never>>, 'patients-patient-bio-panel': RouteRecordInfo<'patients-patient-bio-panel', '/patients/PatientBioPanel', Record<never, never>, Record<never, never>>,
'patients-patientprofile': RouteRecordInfo<'patients-patientprofile', '/patients/patientprofile', Record<never, never>, Record<never, never>>, 'patients-patient-profile': RouteRecordInfo<'patients-patient-profile', '/patients/PatientProfile', Record<never, never>, Record<never, never>>,
'patients-patients': RouteRecordInfo<'patients-patients', '/patients/patients', Record<never, never>, Record<never, never>>, 'patients-patients': RouteRecordInfo<'patients-patients', '/patients/patients', Record<never, never>, Record<never, never>>,
'patients-prescription-panel': RouteRecordInfo<'patients-prescription-panel', '/patients/PrescriptionPanel', Record<never, never>, Record<never, never>>, 'patients-prescription-panel': RouteRecordInfo<'patients-prescription-panel', '/patients/PrescriptionPanel', Record<never, never>, Record<never, never>>,
'patients-question-progress-bar': RouteRecordInfo<'patients-question-progress-bar', '/patients/QuestionProgressBar', Record<never, never>, Record<never, never>>, 'patients-question-progress-bar': RouteRecordInfo<'patients-question-progress-bar', '/patients/QuestionProgressBar', Record<never, never>, Record<never, never>>,