|
@@ -277,21 +277,30 @@
|
|
<div class="border-left border-right border-bottom p-3">
|
|
<div class="border-left border-right border-bottom p-3">
|
|
<div v-show="tab==='appointments'" class="appointments-tab">
|
|
<div v-show="tab==='appointments'" class="appointments-tab">
|
|
<div v-show="selectedDate">
|
|
<div v-show="selectedDate">
|
|
- <div class="d-flex align-items-end mb-3">
|
|
|
|
|
|
+ <div class="d-flex align-items-baseline mb-3">
|
|
<b class="large"><span class="text-secondary">Today:</span> @{{ selectedDate }}</b>
|
|
<b class="large"><span class="text-secondary">Today:</span> @{{ selectedDate }}</b>
|
|
- <div class="ml-auto d-inline-flex align-items-center">
|
|
|
|
- <label class="text-secondary mr-2 my-0 text-nowrap">Filter by status:</label>
|
|
|
|
- <select v-model="filterStatus"
|
|
|
|
- class="form-control form-control-sm">
|
|
|
|
|
|
+
|
|
|
|
+ <div v-if="events && events.length" class="d-inline-flex align-items-baseline flex-grow-1">
|
|
|
|
+ <label class="my-0 ml-4 mr-1">Pro:</label>
|
|
|
|
+ <select v-if="events && events.length" class="form-control form-control-sm max-width-300px" v-model="filterPro">
|
|
<option value="">All</option>
|
|
<option value="">All</option>
|
|
- <option value="PENDING">Pending</option>
|
|
|
|
- <option value="CONFIRMED">Confirmed</option>
|
|
|
|
- <option value="CANCELLED">Cancelled</option>
|
|
|
|
- <option value="COMPLETED">Completed</option>
|
|
|
|
|
|
+ <option v-for="(p, uid) in appointmentCountsByPro" :value="uid">@{{ p.name + ' (' + p.appointments + '/' + numEventsForDate + ')' }}</option>
|
|
</select>
|
|
</select>
|
|
|
|
+ <div class="ml-auto d-inline-flex align-items-center">
|
|
|
|
+ <label class="text-secondary mr-2 my-0 text-nowrap">Filter by status:</label>
|
|
|
|
+ <select v-model="filterStatus"
|
|
|
|
+ class="form-control form-control-sm">
|
|
|
|
+ <option value="">All</option>
|
|
|
|
+ <option value="PENDING">Pending</option>
|
|
|
|
+ <option value="CONFIRMED">Confirmed</option>
|
|
|
|
+ <option value="CANCELLED">Cancelled</option>
|
|
|
|
+ <option value="COMPLETED">Completed</option>
|
|
|
|
+ </select>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div v-for="event in events" class="align-items-end p-3 border rounded mb-3"
|
|
<div v-for="event in events" class="align-items-end p-3 border rounded mb-3"
|
|
|
|
+ v-if="!filterPro || filterPro === event.proUid"
|
|
:class="(event.dateYMD === selectedDate && (filterStatus === '' || filterStatus === event.status) ? 'd-flex' : 'd-none') + ' ' + (event.isClientShadowOfPro ? 'training-event' : '')">
|
|
:class="(event.dateYMD === selectedDate && (filterStatus === '' || filterStatus === event.status) ? 'd-flex' : 'd-none') + ' ' + (event.isClientShadowOfPro ? 'training-event' : '')">
|
|
<div class="patient-avatar mr-3 align-self-center">
|
|
<div class="patient-avatar mr-3 align-self-center">
|
|
<i v-if="event.isClientShadowOfPro" class="fa fa-graduation-cap training-icon"
|
|
<i v-if="event.isClientShadowOfPro" class="fa fa-graduation-cap training-icon"
|
|
@@ -611,6 +620,8 @@
|
|
measurementFilterStatus: 'ALL',
|
|
measurementFilterStatus: 'ALL',
|
|
measurements: {!! $pro->pro_type === 'ADMIN' ? '[]' : json_encode($pro->getMeasurements()) !!},
|
|
measurements: {!! $pro->pro_type === 'ADMIN' ? '[]' : json_encode($pro->getMeasurements()) !!},
|
|
appointmentsLoaded: false,
|
|
appointmentsLoaded: false,
|
|
|
|
+ appointmentCountsByPro: [],
|
|
|
|
+ filterPro: '',
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
formatDate: function (date) {
|
|
formatDate: function (date) {
|
|
@@ -734,7 +745,24 @@
|
|
let self = this;
|
|
let self = this;
|
|
$.get('/pro-dashboard-events/' + _date + '/' + _date, function (_data) {
|
|
$.get('/pro-dashboard-events/' + _date + '/' + _date, function (_data) {
|
|
self.events = _data;
|
|
self.events = _data;
|
|
- self.numEventsForDate = (_data && _data.length) ? 1 : 0;
|
|
|
|
|
|
+ self.numEventsForDate = (_data && _data.length) ? _data.length : 0;
|
|
|
|
+
|
|
|
|
+ // fill appointmentCountsByPro
|
|
|
|
+ self.appointmentCountsByPro = {};
|
|
|
|
+ if(_data && _data.length) {
|
|
|
|
+ for (let i = 0; i < _data.length; i++) {
|
|
|
|
+ if(!self.appointmentCountsByPro[_data[i].proUid]) {
|
|
|
|
+ self.appointmentCountsByPro[_data[i].proUid] = {
|
|
|
|
+ name: _data[i].proName,
|
|
|
|
+ appointments: 1
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ self.appointmentCountsByPro[_data[i].proUid].appointments++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
_callback.call(self);
|
|
_callback.call(self);
|
|
}, 'json');
|
|
}, 'json');
|
|
},
|
|
},
|