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_LIST_API = MAIN_DOMAIN + "/api/admin/patient-list"
|
||||||
export const PATIENT_INFO_API = MAIN_DOMAIN + "/api/admin/patient/"
|
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_UPDATE_API = MAIN_DOMAIN + "/api/admin/patient-update/"
|
||||||
export const PATIENT_DELETE_API = MAIN_DOMAIN + "/api/admin/patient-delete/"
|
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>
|
<script setup>
|
||||||
import { onBeforeMount, onMounted, onUnmounted } from 'vue';
|
import { onBeforeMount, onMounted, onUnmounted } from 'vue';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
import { useStore } from 'vuex';
|
import { useStore } from 'vuex';
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
|
// const route = useRoute()
|
||||||
|
const router = useRouter()
|
||||||
const editDialog = ref(false)
|
const editDialog = ref(false)
|
||||||
const deleteDialog = ref(false)
|
const deleteDialog = ref(false)
|
||||||
const search = ref('')
|
const search = ref('')
|
||||||
@ -53,7 +56,7 @@ const formatPhoneNumber = () => {
|
|||||||
};
|
};
|
||||||
// headers
|
// headers
|
||||||
const headers = [
|
const headers = [
|
||||||
{
|
{
|
||||||
title: 'ID',
|
title: 'ID',
|
||||||
key: 'id',
|
key: 'id',
|
||||||
},
|
},
|
||||||
@ -74,6 +77,8 @@ const headers = [
|
|||||||
key: 'phone_no',
|
key: 'phone_no',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
title: 'ACTIONS',
|
title: 'ACTIONS',
|
||||||
key: 'actions',
|
key: 'actions',
|
||||||
@ -133,6 +138,11 @@ const closeDelete = () => {
|
|||||||
editedItem.value = { ...defaultItem.value }
|
editedItem.value = { ...defaultItem.value }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getMettings = (Item) => {
|
||||||
|
console.log("item", Item);
|
||||||
|
router.push('/admin/patient/meetings/'+Item.id);
|
||||||
|
}
|
||||||
|
|
||||||
const save = async () => {
|
const save = async () => {
|
||||||
const { valid } = await refVForm.value.validate()
|
const { valid } = await refVForm.value.validate()
|
||||||
console.log(valid)
|
console.log(valid)
|
||||||
@ -172,7 +182,7 @@ const getPatientList = computed(async () => {
|
|||||||
console.log('patientList',store.getters.getPatientList)
|
console.log('patientList',store.getters.getPatientList)
|
||||||
let list = store.getters.getPatientList
|
let list = store.getters.getPatientList
|
||||||
store.dispatch('updateIsLoading', false)
|
store.dispatch('updateIsLoading', false)
|
||||||
patientList.value = list
|
patientList.value = list
|
||||||
return patientList.value
|
return patientList.value
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -267,6 +277,12 @@ onMounted(() => {
|
|||||||
>
|
>
|
||||||
<VIcon icon="ri-delete-bin-line" />
|
<VIcon icon="ri-delete-bin-line" />
|
||||||
</IconBtn>
|
</IconBtn>
|
||||||
|
<IconBtn
|
||||||
|
size="small"
|
||||||
|
@click="getMettings(item)"
|
||||||
|
>
|
||||||
|
<VIcon icon="ri-time-line" />
|
||||||
|
</IconBtn>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</VDataTable>
|
</VDataTable>
|
||||||
|
@ -43,6 +43,11 @@ export const routes = [
|
|||||||
name: 'admin-patients',
|
name: 'admin-patients',
|
||||||
component: () => import('@/pages/patients/patients.vue'),
|
component: () => import('@/pages/patients/patients.vue'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/admin/patient/meetings/:id',
|
||||||
|
name: 'admin-patient-meeitngs',
|
||||||
|
component: () => import('@/pages/patients/meetings.vue'),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/admin/providers',
|
path: '/admin/providers',
|
||||||
name: 'admin-providers',
|
name: 'admin-providers',
|
||||||
|
@ -7,15 +7,20 @@ import {
|
|||||||
LABS_UPDATE_API,
|
LABS_UPDATE_API,
|
||||||
PATIENT_DELETE_API,
|
PATIENT_DELETE_API,
|
||||||
PATIENT_LIST_API,
|
PATIENT_LIST_API,
|
||||||
|
PATIENT_MEETING_LIST_API,
|
||||||
PATIENT_UPDATE_API,
|
PATIENT_UPDATE_API,
|
||||||
PROVIDER_DELETE_API,
|
PROVIDER_DELETE_API,
|
||||||
PROVIDER_LIST_API,
|
PROVIDER_LIST_API,
|
||||||
PROVIDER_UPDATE_API
|
PROVIDER_UPDATE_API
|
||||||
} from './constants.js';
|
} from './constants.js';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default createStore({
|
export default createStore({
|
||||||
state: {
|
state: {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
patientList:[],
|
patientList:[],
|
||||||
|
patientMeetingList:[],
|
||||||
providersList:[],
|
providersList:[],
|
||||||
labsList:[]
|
labsList:[]
|
||||||
},
|
},
|
||||||
@ -27,6 +32,9 @@ export default createStore({
|
|||||||
setPtientList(state, payload) {
|
setPtientList(state, payload) {
|
||||||
state.patientList = payload
|
state.patientList = payload
|
||||||
},
|
},
|
||||||
|
setPtientMeetingList(state, payload) {
|
||||||
|
state.patientMeetingList = payload
|
||||||
|
},
|
||||||
setProvidersList(state, payload) {
|
setProvidersList(state, payload) {
|
||||||
state.providersList = payload
|
state.providersList = payload
|
||||||
},
|
},
|
||||||
@ -71,6 +79,24 @@ export default createStore({
|
|||||||
console.error('Error:', error);
|
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) {
|
async patientUpdate({ commit }, payload) {
|
||||||
commit('setLoading', true)
|
commit('setLoading', true)
|
||||||
await axios.post(PATIENT_UPDATE_API+payload.id, {
|
await axios.post(PATIENT_UPDATE_API+payload.id, {
|
||||||
@ -258,6 +284,10 @@ export default createStore({
|
|||||||
getPatientList(state){
|
getPatientList(state){
|
||||||
return state.patientList
|
return state.patientList
|
||||||
},
|
},
|
||||||
|
getPatientMeetingList(state){
|
||||||
|
return state.patientMeetingList
|
||||||
|
},
|
||||||
|
|
||||||
getProvidersList(state){
|
getProvidersList(state){
|
||||||
return state.providersList
|
return state.providersList
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user