Merge branch 'dev' of ssh://git.codelfi.com:2202/TelemedPro/hgh_admin into dev
This commit is contained in:
commit
b0f2c86fa5
@ -1,12 +1,12 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { layoutConfig } from '@layouts'
|
import { layoutConfig } from '@layouts';
|
||||||
import { can } from '@layouts/plugins/casl'
|
import { can } from '@layouts/plugins/casl';
|
||||||
import { useLayoutConfigStore } from '@layouts/stores/config'
|
import { useLayoutConfigStore } from '@layouts/stores/config';
|
||||||
import {
|
import {
|
||||||
getComputedNavLinkToProp,
|
getComputedNavLinkToProp,
|
||||||
getDynamicI18nProps,
|
getDynamicI18nProps,
|
||||||
isNavLinkActive,
|
isNavLinkActive,
|
||||||
} from '@layouts/utils'
|
} from '@layouts/utils';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
item: {
|
item: {
|
||||||
@ -22,13 +22,14 @@ const hideTitleAndBadge = configStore.isVerticalNavMini()
|
|||||||
<template>
|
<template>
|
||||||
<li
|
<li
|
||||||
v-if="can(item.action, item.subject)"
|
v-if="can(item.action, item.subject)"
|
||||||
class="nav-link"
|
class="nav-link 22"
|
||||||
:class="{ disabled: item.disable }"
|
:class="{ disabled: item.disable }"
|
||||||
>
|
>
|
||||||
<Component
|
<Component
|
||||||
:is="item.to ? 'RouterLink' : 'a'"
|
:is="item.to ? 'RouterLink' : 'a'"
|
||||||
v-bind="getComputedNavLinkToProp(item)"
|
v-bind="getComputedNavLinkToProp(item)"
|
||||||
:class="{ 'router-link-active router-link-exact-active': isNavLinkActive(item, $router) }"
|
:class="{ 'router-link-active router-link-exact-active': isNavLinkActive(item, $router) }"
|
||||||
|
|
||||||
>
|
>
|
||||||
<Component
|
<Component
|
||||||
:is="layoutConfig.app.iconRenderer || 'div'"
|
:is="layoutConfig.app.iconRenderer || 'div'"
|
||||||
|
@ -46,18 +46,46 @@ export const resolveNavLinkRouteName = (link, router) => {
|
|||||||
*/
|
*/
|
||||||
export const isNavLinkActive = (link, router) => {
|
export const isNavLinkActive = (link, router) => {
|
||||||
// Matched routes array of current route
|
// Matched routes array of current route
|
||||||
const matchedRoutes = router.currentRoute.value.matched
|
const matchedRoutes = router.currentRoute.value.matched;
|
||||||
|
const currentRoute = router.currentRoute.value;
|
||||||
|
|
||||||
|
// Check if the parent menu item should be active
|
||||||
|
|
||||||
|
if (isParentActive(currentRoute,router,link)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if provided route matches route's matched route
|
// Check if provided route matches route's matched route
|
||||||
const resolveRoutedName = resolveNavLinkRouteName(link, router)
|
const resolveRoutedName = resolveNavLinkRouteName(link, router);
|
||||||
if (!resolveRoutedName)
|
if (!resolveRoutedName) {
|
||||||
return false
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return matchedRoutes.some(route => {
|
return matchedRoutes.some(route => {
|
||||||
return route.name === resolveRoutedName || route.meta.navActiveLink === resolveRoutedName
|
return route.name === resolveRoutedName || route.meta.navActiveLink === resolveRoutedName;
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
const ParentMenuItemName = 'admin-patients';
|
||||||
|
|
||||||
|
export const isParentActive = (route, router,link) => {
|
||||||
|
// Get the current route's activeParent meta property
|
||||||
|
const activeParent = route.meta.activeParent;
|
||||||
|
|
||||||
|
// Check if the activeParent is defined and not an empty string
|
||||||
|
if (activeParent && activeParent.trim().length > 0) {
|
||||||
|
// Find the parent route configuration
|
||||||
|
const parentRoute = router.options.routes.find(r => r.name === activeParent);
|
||||||
|
console.log('fffff', link.to)
|
||||||
|
// Check if the parent route configuration exists
|
||||||
|
if (link.to) {
|
||||||
|
// Use the parent route's name or any other property as the parent menu item name
|
||||||
|
return link.to === activeParent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the activeParent is not defined, an empty string, or the parent route configuration is not found, return false
|
||||||
|
return false;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* Check if nav group is active
|
* Check if nav group is active
|
||||||
* @param {Array} children Group children
|
* @param {Array} children Group children
|
||||||
|
@ -18,6 +18,7 @@ export const PATIENT_PRESCRIPTION_STATUS_UPDATE_API = MAIN_DOMAIN + "/api/admin
|
|||||||
export const SUBCRIPTIONS_LIST_API = MAIN_DOMAIN + "/api/plans/"
|
export const SUBCRIPTIONS_LIST_API = MAIN_DOMAIN + "/api/plans/"
|
||||||
|
|
||||||
|
|
||||||
|
export const PROVIDER_FILTER_LIST_API = MAIN_DOMAIN + "/api/admin/telemed-pro-list"
|
||||||
export const PROVIDER_LIST_API = MAIN_DOMAIN + "/api/admin/telemed-pro-list"
|
export const PROVIDER_LIST_API = MAIN_DOMAIN + "/api/admin/telemed-pro-list"
|
||||||
export const PROVIDER_INFO_API = MAIN_DOMAIN + "/api/admin/telemed-pro/"
|
export const PROVIDER_INFO_API = MAIN_DOMAIN + "/api/admin/telemed-pro/"
|
||||||
export const PROVIDER_UPDATE_API = MAIN_DOMAIN + "/api/admin/telemed-pro-update/"
|
export const PROVIDER_UPDATE_API = MAIN_DOMAIN + "/api/admin/telemed-pro-update/"
|
||||||
|
@ -161,6 +161,17 @@ const options = [
|
|||||||
class="text-no-wrap"
|
class="text-no-wrap"
|
||||||
>
|
>
|
||||||
<template #item.id="{ item }">{{ item.id }}</template>
|
<template #item.id="{ item }">{{ item.id }}</template>
|
||||||
|
<template #item.provider_name="{ item }">
|
||||||
|
<div class="d-flex flex-column ms-3">
|
||||||
|
<router-link
|
||||||
|
:to="{ name: 'admin-provider-profile', params: { id: item.provider_id } }"
|
||||||
|
class="highlighted"
|
||||||
|
>
|
||||||
|
<span class="d-block font-weight-medium text-truncate">{{ item.provider_name }}</span>
|
||||||
|
</router-link>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<template #item.duration="{ item }">{{ item.duration }}</template>
|
<template #item.duration="{ item }">{{ item.duration }}</template>
|
||||||
<!-- Actions -->
|
<!-- Actions -->
|
||||||
<template #item.actions="{ item }">
|
<template #item.actions="{ item }">
|
||||||
|
@ -25,9 +25,9 @@ const subcriptionLists = ref(['All'])
|
|||||||
const isLoading=ref(false)
|
const isLoading=ref(false)
|
||||||
|
|
||||||
const filter = ref({
|
const filter = ref({
|
||||||
gender: '',
|
gender: 'All',
|
||||||
state: '',
|
state: 'all',
|
||||||
plan: '',
|
plan: 'all',
|
||||||
})
|
})
|
||||||
// const gender =ref();
|
// const gender =ref();
|
||||||
// const city =ref();
|
// const city =ref();
|
||||||
|
@ -157,6 +157,17 @@ const options = [
|
|||||||
class="text-no-wrap"
|
class="text-no-wrap"
|
||||||
>
|
>
|
||||||
<template #item.id="{ item }">{{ item.id }}</template>
|
<template #item.id="{ item }">{{ item.id }}</template>
|
||||||
|
<template #item.patient_name="{ item }">
|
||||||
|
<div class="d-flex flex-column ms-3">
|
||||||
|
<router-link
|
||||||
|
:to="{ name: 'admin-patient-profile', params: { id: item.patient_id } }"
|
||||||
|
class="highlighted"
|
||||||
|
>
|
||||||
|
<span class="d-block font-weight-medium text-truncate">{{ item.patient_name }}</span>
|
||||||
|
</router-link>
|
||||||
|
<small>{{ item.post }}</small>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<template #item.duration="{ item }">{{ item.duration }}</template>
|
<template #item.duration="{ item }">{{ item.duration }}</template>
|
||||||
<!-- Actions -->
|
<!-- Actions -->
|
||||||
<template #item.actions="{ item }">
|
<template #item.actions="{ item }">
|
||||||
@ -192,3 +203,10 @@ const options = [
|
|||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</template>
|
</template>
|
||||||
|
<style scoped>
|
||||||
|
.highlighted {
|
||||||
|
/* Add your desired highlighting styles here */
|
||||||
|
font-weight: bold;
|
||||||
|
color: #a169ff; /* or any other color you prefer */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -247,9 +247,8 @@ const deleteItemConfirm = async() => {
|
|||||||
closeDelete()
|
closeDelete()
|
||||||
}
|
}
|
||||||
const getprovidersList = computed(async () => {
|
const getprovidersList = computed(async () => {
|
||||||
store.dispatch('updateIsLoading', true)
|
|
||||||
await store.dispatch('providersList')
|
console.log('getprovidersFilterList',store.getters.getProvidersList)
|
||||||
console.log('getProvidersList',store.getters.getProvidersList)
|
|
||||||
let list = store.getters.getProvidersList
|
let list = store.getters.getProvidersList
|
||||||
store.dispatch('updateIsLoading', false)
|
store.dispatch('updateIsLoading', false)
|
||||||
providersList.value = list
|
providersList.value = list
|
||||||
@ -257,27 +256,31 @@ const getprovidersList = computed(async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const getProviderFilter = async() => {
|
const getProviderFilter = async() => {
|
||||||
// console.log("filter", filter.value.plan, filter.value.gender, filter.value.state);
|
store.dispatch('updateIsLoading', true)
|
||||||
|
await store.dispatch('providersFilterList',{
|
||||||
|
gender: filter.value.gender.toLowerCase(),
|
||||||
|
state: filter.value.state,
|
||||||
|
availabilityFrom: filter.value.availabilityFrom,
|
||||||
|
availabilityTo:filter.value.availabilityTo,
|
||||||
|
|
||||||
// await store.dispatch('PatientFilter', {
|
})
|
||||||
// plan: filter.value.plan,
|
|
||||||
// gender: filter.value.gender,
|
store.dispatch('updateIsLoading', false)
|
||||||
// state: filter.value.state,
|
|
||||||
// })
|
|
||||||
// store.dispatch('updateIsLoading', false)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(async() => {
|
||||||
|
store.dispatch('updateIsLoading', true)
|
||||||
|
await store.dispatch('providersList')
|
||||||
|
store.dispatch('updateIsLoading', false)
|
||||||
|
|
||||||
})
|
})
|
||||||
const filter = ref({
|
const filter = ref({
|
||||||
practics_state:'',
|
practics_state:'',
|
||||||
gender: '',
|
gender: 'All',
|
||||||
state: '',
|
state: 'All',
|
||||||
specialty:'',
|
specialty:'',
|
||||||
availabilityFrom:'',
|
availabilityFrom:'All',
|
||||||
availabilityTo:''
|
availabilityTo:'All'
|
||||||
// plan: '',
|
// plan: '',
|
||||||
})
|
})
|
||||||
// const onSubcriptionChange = async(newvalue)=> {
|
// const onSubcriptionChange = async(newvalue)=> {
|
||||||
@ -336,28 +339,24 @@ const onDateRangeChange = async(newvalue)=> {
|
|||||||
|
|
||||||
const timeOptions = computed(() => {
|
const timeOptions = computed(() => {
|
||||||
const options = ['All'];
|
const options = ['All'];
|
||||||
for (let hour = 0; hour < 24; hour++) {
|
|
||||||
for (let minute = 0; minute < 60; minute += 30) {
|
|
||||||
let period = 'AM';
|
|
||||||
let displayHour = hour;
|
|
||||||
|
|
||||||
if (hour === 0) {
|
// Loop through the hours from 12 to 23 (for 12:00 PM to 11:00 PM)
|
||||||
displayHour = 12; // Convert 0 to 12 for 12:00 AM
|
for (let hour = 12; hour <= 23; hour++) {
|
||||||
} else if (hour === 12) {
|
// Loop through the minutes (0 and 30)
|
||||||
period = 'PM'; // 12:00 PM
|
for (let minute of [0, 30]) {
|
||||||
} else if (hour > 12) {
|
// Construct the time string
|
||||||
displayHour = hour - 12; // Convert to 12-hour format
|
const timeString = `${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}`;
|
||||||
period = 'PM';
|
|
||||||
}
|
|
||||||
|
|
||||||
const timeString = `${displayHour.toString().padStart(2, '0')}:${minute
|
|
||||||
.toString()
|
|
||||||
.padStart(2, '0')} ${period}`;
|
|
||||||
options.push(timeString);
|
options.push(timeString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add the time option for 24:00 (midnight)
|
||||||
|
options.push('24:00');
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -132,11 +132,18 @@ export const routes = [
|
|||||||
path: '/admin/patients/patient-profile/:id',
|
path: '/admin/patients/patient-profile/:id',
|
||||||
name: 'admin-patient-profile',
|
name: 'admin-patient-profile',
|
||||||
component: () => import('@/pages/patients/patient-profile.vue'),
|
component: () => import('@/pages/patients/patient-profile.vue'),
|
||||||
|
meta: {
|
||||||
|
activeParent: 'admin-patients'
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/admin/provider/provider-profile/:id',
|
path: '/admin/provider/provider-profile/:id',
|
||||||
name: 'admin-provider-profile',
|
name: 'admin-provider-profile',
|
||||||
component: () => import('@/pages/providers/provider-profile.vue'),
|
component: () => import('@/pages/providers/provider-profile.vue'),
|
||||||
|
meta: {
|
||||||
|
activeParent: 'admin-providers'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/admin/providers/patientprofile/:id',
|
path: '/admin/providers/patientprofile/:id',
|
||||||
|
@ -33,6 +33,7 @@ import {
|
|||||||
PATIENT_UPDATE_API,
|
PATIENT_UPDATE_API,
|
||||||
PROFILE_UPDATE_API,
|
PROFILE_UPDATE_API,
|
||||||
PROVIDER_DELETE_API,
|
PROVIDER_DELETE_API,
|
||||||
|
PROVIDER_FILTER_LIST_API,
|
||||||
PROVIDER_LIST_API,
|
PROVIDER_LIST_API,
|
||||||
PROVIDER_MEETING_LIST_API,
|
PROVIDER_MEETING_LIST_API,
|
||||||
PROVIDER_UPDATE_API,
|
PROVIDER_UPDATE_API,
|
||||||
@ -216,6 +217,7 @@ export default createStore({
|
|||||||
},
|
},
|
||||||
async PatientFilter({ commit,state }, payload) {
|
async PatientFilter({ commit,state }, payload) {
|
||||||
commit('setLoading', true)
|
commit('setLoading', true)
|
||||||
|
|
||||||
await axios.post(PATIENT_FILTER_LIST_API, {
|
await axios.post(PATIENT_FILTER_LIST_API, {
|
||||||
plan: payload.plan ? payload.plan: 'all' ,
|
plan: payload.plan ? payload.plan: 'all' ,
|
||||||
gender: payload.gender ? payload.gender: 'all',
|
gender: payload.gender ? payload.gender: 'all',
|
||||||
@ -341,10 +343,58 @@ export default createStore({
|
|||||||
console.error('Error:', error);
|
console.error('Error:', error);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
async providersFilterList({ commit }, payload) {
|
||||||
|
commit('setLoading', true)
|
||||||
|
if(payload.state == 'All')
|
||||||
|
payload.state = payload.state.toLowerCase();
|
||||||
|
if(payload.availabilityFrom == 'All')
|
||||||
|
payload.availabilityFrom = payload.availabilityFrom.toLowerCase();
|
||||||
|
if(payload.availabilityTo == 'All')
|
||||||
|
payload.availabilityTo = payload.availabilityTo.toLowerCase();
|
||||||
|
console.log(localStorage.getItem('admin_access_token'))
|
||||||
|
await axios.post(PROVIDER_FILTER_LIST_API, {
|
||||||
|
gender:payload.gender? payload.gender:'all',
|
||||||
|
state: payload.state? payload.state:'all',
|
||||||
|
availability_from: payload.availabilityFrom ? payload.availabilityFrom:'all',
|
||||||
|
availability_to:payload.availabilityTo?payload.availabilityTo : 'all'
|
||||||
|
}, {
|
||||||
|
headers: {
|
||||||
|
'Authorization': `Bearer ${localStorage.getItem('admin_access_token')}`,
|
||||||
|
}
|
||||||
|
}) .then(response => {
|
||||||
|
commit('setLoading', false)
|
||||||
|
console.log('Response:', response.data.patients);
|
||||||
|
let dataArray =[]
|
||||||
|
for (let data of response.data.patients) {
|
||||||
|
let dataObject = {}
|
||||||
|
dataObject.name = data.first_name + ' ' + data.last_name
|
||||||
|
dataObject.first_name = data.first_name
|
||||||
|
dataObject.last_name = data.last_name
|
||||||
|
dataObject.email = data.email
|
||||||
|
// dataObject.dob = data.dob
|
||||||
|
dataObject.phone_no = data.phone_number
|
||||||
|
dataObject.avatar = '',
|
||||||
|
dataObject.id = data.id,
|
||||||
|
dataArray.push(dataObject)
|
||||||
|
}
|
||||||
|
console.log(dataArray)
|
||||||
|
commit('setProvidersList',dataArray)
|
||||||
|
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
commit('setLoading', false)
|
||||||
|
console.error('Error:', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
async providersList({ commit }, payload) {
|
async providersList({ commit }, payload) {
|
||||||
commit('setLoading', true)
|
commit('setLoading', true)
|
||||||
console.log(localStorage.getItem('admin_access_token'))
|
console.log(localStorage.getItem('admin_access_token'))
|
||||||
await axios.post(PROVIDER_LIST_API, {}, {
|
await axios.post(PROVIDER_LIST_API, {
|
||||||
|
gender: 'all',
|
||||||
|
state: 'all',
|
||||||
|
availabilityFrom: 'all',
|
||||||
|
availabilityTo: 'all'
|
||||||
|
}, {
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': `Bearer ${localStorage.getItem('admin_access_token')}`,
|
'Authorization': `Bearer ${localStorage.getItem('admin_access_token')}`,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user