nuVistA/htdocs/RouteSchedule.vue

42 lines
1.2 KiB
Vue
Raw Normal View History

2022-09-22 07:10:08 -04:00
<template>
2023-05-06 12:05:13 -04:00
<Subtitle value="Schedule" />
2023-05-16 22:04:37 -04:00
<div class="card mb-3 shadow">
<div class="card-header d-flex justify-content-between align-items-center">
<span>Schedule</span>
<router-link to="/settings">Select clinics<template v-if="selection.length > 0"> ({{selection.length}})</template></router-link>
<DateRangePicker range="1D" direction="+1" v-model:date="date" v-model:date_end="date_end" />
2022-09-22 07:10:08 -04:00
</div>
2023-05-16 22:04:37 -04:00
<div class="card-body">
<ViewSchedule :client="client" :selection="selection" :date_begin="date" :date_end="new Date(date_end.getTime() - 1)" />
2022-09-22 07:10:08 -04:00
</div>
</div>
</template>
<script>
2023-05-06 12:05:13 -04:00
import Subtitle from './Subtitle.vue';
2022-09-22 07:10:08 -04:00
import DateRangePicker from './DateRangePicker.vue';
import ViewSchedule from './ViewSchedule.vue';
function dateonly(date) {
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
}
export default {
components: {
2023-05-16 22:04:37 -04:00
Subtitle, DateRangePicker, ViewSchedule
2022-09-22 07:10:08 -04:00
},
props: {
client: Object
},
data() {
return {
date: dateonly(new Date()),
date_end: dateonly(new Date())
};
},
2022-09-28 01:28:11 -04:00
computed: {
2023-05-16 22:04:37 -04:00
selection() { return (this.client) && (this.client.remotestate.resources) ? (this.client.remotestate.resources.split(',').filter(x => x) || []) : [] }
2022-09-22 07:10:08 -04:00
}
};
</script>