fixes
This commit is contained in:
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>
|
||||
|
Reference in New Issue
Block a user