fixes
This commit is contained in:
parent
fc0c654595
commit
16c7ea922b
@ -4,6 +4,7 @@ export const ADMIN_LOGIN_API = MAIN_DOMAIN + "/api/admin/login"
|
||||
|
||||
export const PATIENT_LIST_API = MAIN_DOMAIN + "/api/admin/patient-list"
|
||||
export const PATIENT_INFO_API = MAIN_DOMAIN + "/api/admin/patient/"
|
||||
export const PATIENT_MEETING_LIST_API = MAIN_DOMAIN + "/api/admin/get-meeting-history/"
|
||||
export const PATIENT_UPDATE_API = MAIN_DOMAIN + "/api/admin/patient-update/"
|
||||
export const PATIENT_DELETE_API = MAIN_DOMAIN + "/api/admin/patient-delete/"
|
||||
|
||||
|
140
resources/js/pages/patients/meetings.vue
Normal file
140
resources/js/pages/patients/meetings.vue
Normal file
@ -0,0 +1,140 @@
|
||||
<script setup>
|
||||
import { onBeforeMount, onMounted, onUnmounted } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useStore } from 'vuex';
|
||||
const store = useStore()
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const editDialog = ref(false)
|
||||
const deleteDialog = ref(false)
|
||||
const search = ref('')
|
||||
const appointmentId = ref('');
|
||||
const defaultItem = ref({
|
||||
id: -1,
|
||||
avatar: '',
|
||||
name: '',
|
||||
email: '',
|
||||
dob: '',
|
||||
phone_no: '',
|
||||
|
||||
})
|
||||
|
||||
const editedItem = ref(defaultItem.value)
|
||||
const editedIndex = ref(-1)
|
||||
const patientMeetingList = ref([])
|
||||
const isLoading=ref(false)
|
||||
// status options
|
||||
const selectedOptions = [
|
||||
{
|
||||
text: 'Active',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
text: 'InActive',
|
||||
value: 2,
|
||||
},
|
||||
|
||||
]
|
||||
|
||||
const refVForm = ref(null)
|
||||
|
||||
onBeforeMount(async () => {});
|
||||
onMounted(async () => {
|
||||
appointmentId.value = route.params.id;
|
||||
console.log("appointmentId",appointmentId.value);
|
||||
});
|
||||
onUnmounted(async () => {});
|
||||
|
||||
// headers
|
||||
const headers = [
|
||||
{
|
||||
title: 'Appiontment Id',
|
||||
key: 'id',
|
||||
},
|
||||
{
|
||||
title: 'Patient',
|
||||
key: 'patient_name',
|
||||
},
|
||||
{ key: 'appointment_date', sortable: false, title: 'Date' },
|
||||
{ key: 'start_time', title: 'Start Time' },
|
||||
{ key: 'end_time', title: 'End Time' },
|
||||
{ key: 'duration', title: 'Duration' },
|
||||
|
||||
|
||||
// {
|
||||
// title: 'ACTIONS',
|
||||
// key: 'actions',
|
||||
// },
|
||||
]
|
||||
|
||||
|
||||
|
||||
const getPatientMeetingList = computed(async () => {
|
||||
patientMeetingList.value = [];
|
||||
store.dispatch('updateIsLoading', true)
|
||||
await store.dispatch('patientMeetingList', {
|
||||
id: appointmentId.value
|
||||
})
|
||||
console.log('patientMeetingList',store.getters.getPatientMeetingList)
|
||||
let list = store.getters.getPatientMeetingList
|
||||
store.dispatch('updateIsLoading', false)
|
||||
patientMeetingList.value = list
|
||||
return patientMeetingList.value
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
<v-row>
|
||||
<v-col cols="12" md="12" v-if="getPatientMeetingList">
|
||||
<VCard title="Meetings">
|
||||
<VCardText >
|
||||
<VRow>
|
||||
<VCol
|
||||
cols="12"
|
||||
offset-md="8"
|
||||
md="4"
|
||||
>
|
||||
<VTextField
|
||||
v-model="search"
|
||||
label="Search"
|
||||
placeholder="Search ..."
|
||||
append-inner-icon="ri-search-line"
|
||||
single-line
|
||||
hide-details
|
||||
dense
|
||||
outlined
|
||||
/>
|
||||
</VCol>
|
||||
</VRow>
|
||||
</VCardText>
|
||||
<VDataTable
|
||||
:headers="headers"
|
||||
:items="patientMeetingList"
|
||||
:search="search"
|
||||
:items-per-page="5"
|
||||
class="text-no-wrap"
|
||||
>
|
||||
<template #item.id="{ item }">
|
||||
{{ item.id }}
|
||||
</template>
|
||||
|
||||
<!-- Actions -->
|
||||
<template #item.actions="{ item }">
|
||||
<div class="d-flex gap-1">
|
||||
|
||||
</div>
|
||||
</template>
|
||||
</VDataTable>
|
||||
</VCard>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<!-- 👉 Delete Dialog -->
|
||||
|
||||
</template>
|
@ -1,7 +1,10 @@
|
||||
<script setup>
|
||||
import { onBeforeMount, onMounted, onUnmounted } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useStore } from 'vuex';
|
||||
const store = useStore()
|
||||
// const route = useRoute()
|
||||
const router = useRouter()
|
||||
const editDialog = ref(false)
|
||||
const deleteDialog = ref(false)
|
||||
const search = ref('')
|
||||
@ -53,7 +56,7 @@ const formatPhoneNumber = () => {
|
||||
};
|
||||
// headers
|
||||
const headers = [
|
||||
{
|
||||
{
|
||||
title: 'ID',
|
||||
key: 'id',
|
||||
},
|
||||
@ -73,6 +76,8 @@ const headers = [
|
||||
title: 'Phone',
|
||||
key: 'phone_no',
|
||||
},
|
||||
|
||||
|
||||
|
||||
{
|
||||
title: 'ACTIONS',
|
||||
@ -133,6 +138,11 @@ const closeDelete = () => {
|
||||
editedItem.value = { ...defaultItem.value }
|
||||
}
|
||||
|
||||
const getMettings = (Item) => {
|
||||
console.log("item", Item);
|
||||
router.push('/admin/patient/meetings/'+Item.id);
|
||||
}
|
||||
|
||||
const save = async () => {
|
||||
const { valid } = await refVForm.value.validate()
|
||||
console.log(valid)
|
||||
@ -172,7 +182,7 @@ const getPatientList = computed(async () => {
|
||||
console.log('patientList',store.getters.getPatientList)
|
||||
let list = store.getters.getPatientList
|
||||
store.dispatch('updateIsLoading', false)
|
||||
patientList.value = list
|
||||
patientList.value = list
|
||||
return patientList.value
|
||||
});
|
||||
|
||||
@ -267,6 +277,12 @@ onMounted(() => {
|
||||
>
|
||||
<VIcon icon="ri-delete-bin-line" />
|
||||
</IconBtn>
|
||||
<IconBtn
|
||||
size="small"
|
||||
@click="getMettings(item)"
|
||||
>
|
||||
<VIcon icon="ri-time-line" />
|
||||
</IconBtn>
|
||||
</div>
|
||||
</template>
|
||||
</VDataTable>
|
||||
|
@ -43,6 +43,11 @@ export const routes = [
|
||||
name: 'admin-patients',
|
||||
component: () => import('@/pages/patients/patients.vue'),
|
||||
},
|
||||
{
|
||||
path: '/admin/patient/meetings/:id',
|
||||
name: 'admin-patient-meeitngs',
|
||||
component: () => import('@/pages/patients/meetings.vue'),
|
||||
},
|
||||
{
|
||||
path: '/admin/providers',
|
||||
name: 'admin-providers',
|
||||
|
@ -7,15 +7,20 @@ import {
|
||||
LABS_UPDATE_API,
|
||||
PATIENT_DELETE_API,
|
||||
PATIENT_LIST_API,
|
||||
PATIENT_MEETING_LIST_API,
|
||||
PATIENT_UPDATE_API,
|
||||
PROVIDER_DELETE_API,
|
||||
PROVIDER_LIST_API,
|
||||
PROVIDER_UPDATE_API
|
||||
} from './constants.js';
|
||||
|
||||
|
||||
|
||||
export default createStore({
|
||||
state: {
|
||||
isLoading: false,
|
||||
patientList:[],
|
||||
patientMeetingList:[],
|
||||
providersList:[],
|
||||
labsList:[]
|
||||
},
|
||||
@ -27,6 +32,9 @@ export default createStore({
|
||||
setPtientList(state, payload) {
|
||||
state.patientList = payload
|
||||
},
|
||||
setPtientMeetingList(state, payload) {
|
||||
state.patientMeetingList = payload
|
||||
},
|
||||
setProvidersList(state, payload) {
|
||||
state.providersList = payload
|
||||
},
|
||||
@ -71,6 +79,24 @@ export default createStore({
|
||||
console.error('Error:', error);
|
||||
});
|
||||
},
|
||||
async patientMeetingList({ commit }, payload) {
|
||||
commit('setLoading', true)
|
||||
console.log(localStorage.getItem('admin_access_token'))
|
||||
await axios.post(PATIENT_MEETING_LIST_API+payload.id, {}, {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${localStorage.getItem('admin_access_token')}`,
|
||||
}
|
||||
}) .then(response => {
|
||||
commit('setLoading', false)
|
||||
console.log('Meeting Response:', response.data.patients);
|
||||
commit('setPtientMeetingList',response.data.patients);
|
||||
|
||||
})
|
||||
.catch(error => {
|
||||
commit('setLoading', false)
|
||||
console.error('Error:', error);
|
||||
});
|
||||
},
|
||||
async patientUpdate({ commit }, payload) {
|
||||
commit('setLoading', true)
|
||||
await axios.post(PATIENT_UPDATE_API+payload.id, {
|
||||
@ -258,6 +284,10 @@ export default createStore({
|
||||
getPatientList(state){
|
||||
return state.patientList
|
||||
},
|
||||
getPatientMeetingList(state){
|
||||
return state.patientMeetingList
|
||||
},
|
||||
|
||||
getProvidersList(state){
|
||||
return state.providersList
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user