DialogAttendee.vue
1 year ago
DialogAttendees.vue
1 year ago
DialogEvent.vue
1 year ago
EventListItem.vue
1 year ago
Events.vue
1 year ago
EventListItem.vue
227 lines
| 1 | <template> |
| 2 | <div class="am-event-data"> |
| 3 | <el-row> |
| 4 | <el-col :lg="11"> |
| 5 | <el-row :gutter="10" class="am-events-flex-row-middle-align"> |
| 6 | |
| 7 | <!-- Checkbox --> |
| 8 | <el-col :lg="6" :sm="6"> |
| 9 | <span class="am-event-checkbox"> |
| 10 | <!-- Time --> |
| 11 | <span v-if="singleDatesViewActive" class="am-event-time"> |
| 12 | {{ handleDateTimeFormat(evt.periodStart)[1] }} - {{ handleDateTimeFormat(evt.periodEnd)[1] }} |
| 13 | </span> |
| 14 | <span v-if="groupDatesViewActive" class="am-event-time"> |
| 15 | <span>{{ handleDateTimeFormat(evt.periods[0].periodStart)[0] }}</span> |
| 16 | <br> |
| 17 | <span>{{ handleDateTimeFormat(evt.periods[0].periodStart)[1] }}</span> |
| 18 | </span> |
| 19 | </span> |
| 20 | </el-col> |
| 21 | |
| 22 | <!-- Event Name --> |
| 23 | <el-col :lg="7" :sm="9"> |
| 24 | <p class="am-col-title">{{ $root.labels.event_name }}</p> |
| 25 | <h4> |
| 26 | {{ evt.name }} |
| 27 | <span class="am-event-data-id"> ({{ $root.labels.id }}: {{ evt.id }})</span> |
| 28 | </h4> |
| 29 | </el-col> |
| 30 | |
| 31 | <!-- Location --> |
| 32 | <el-col :lg="4" :sm="4" :xs="12" class="am-event-location"> |
| 33 | <p class="am-col-title">{{ $root.labels.event_location }}</p> |
| 34 | <p><span class="am-semi-strong">{{ evt.location }}</span></p> |
| 35 | </el-col> |
| 36 | |
| 37 | <!-- Organizer --> |
| 38 | <el-col :lg="3" :sm="4" :xs="12"> |
| 39 | <h4>{{ getEventOrganizerName(evt.organizerId) }}</h4> |
| 40 | </el-col> |
| 41 | |
| 42 | <!-- Spots --> |
| 43 | <el-col :lg="3" :sm="3" :xs="12"> |
| 44 | <p class="am-col-title am-event-spots">{{ $root.labels.booked + ':' }}</p> |
| 45 | <div class="am-event-spots" :style="{display: 'flex', justifyContent: 'space-evenly'}"> |
| 46 | <span class="am-semi-strong">{{ evt.maxCapacity - evt.places }} / {{ evt.maxCapacity }}</span> |
| 47 | <el-tooltip placement="top"> |
| 48 | <div style='text-align: left;' v-html="ticketsTooltipContent(evt.customTickets)" slot="content"></div> |
| 49 | <img |
| 50 | v-if="ticketsTooltipContent(evt.customTickets) !== ''" |
| 51 | :src="$root.getUrl + 'public/img/am-package.svg'" |
| 52 | /> |
| 53 | </el-tooltip> |
| 54 | </div> |
| 55 | </el-col> |
| 56 | |
| 57 | <!-- Recurring --> |
| 58 | <el-col :lg="4" :sm="4" :xs="12"> |
| 59 | <p class="am-col-title">{{ $root.labels.event_recurring }}</p> |
| 60 | <div class="am-event-recurring"> |
| 61 | <p v-if="evt.recurring" class="am-recurring-label"> |
| 62 | <img :src="$root.getUrl + 'public/img/loop.svg'"> {{ $root.labels.yes }} |
| 63 | </p> |
| 64 | <p v-else>{{ $root.labels.no }}</p> |
| 65 | </div> |
| 66 | </el-col> |
| 67 | |
| 68 | </el-row> |
| 69 | </el-col> |
| 70 | |
| 71 | <el-col :lg="13"> |
| 72 | <el-row :gutter="10" class="am-events-flex-row-middle-align"> |
| 73 | |
| 74 | <!-- Booking Opens --> |
| 75 | <el-col :lg="6" :sm="10" :xs="12"> |
| 76 | <p class="am-col-title">{{ $root.labels.event_booking_opens }}</p> |
| 77 | <el-tooltip |
| 78 | class="item" |
| 79 | effect="dark" |
| 80 | content="Open" |
| 81 | placement="top" |
| 82 | :disabled="!evt.bookingOpens" |
| 83 | > |
| 84 | <p :class="{ 'am-event-open': evt.opened && evt.status === 'approved' }"> |
| 85 | <span class="am-semi-strong">{{ handleDateTimeFormat(evt.bookingOpens ? evt.bookingOpens : evt.created)[0] }}</span> |
| 86 | @ <span class="am-semi-strong"> {{ handleDateTimeFormat(evt.bookingOpens ? evt.bookingOpens : evt.created)[1] }}</span> |
| 87 | </p> |
| 88 | </el-tooltip> |
| 89 | </el-col> |
| 90 | |
| 91 | <!-- Booking Closes --> |
| 92 | <el-col :lg="6" :sm="10" :xs="12"> |
| 93 | <p class="am-col-title">{{ $root.labels.event_booking_closes }}</p> |
| 94 | <el-tooltip |
| 95 | class="item" |
| 96 | effect="dark" |
| 97 | content="Closed" |
| 98 | placement="top" |
| 99 | :disabled="!evt.bookingCloses" |
| 100 | > |
| 101 | <p :class="{ 'am-event-closed': evt.closed && evt.status === 'approved' }"> |
| 102 | <span class="am-semi-strong">{{ handleDateTimeFormat(evt.bookingCloses ? evt.bookingCloses : (singleDatesViewActive ? evt.periodStart : evt.periods[0].periodStart))[0] }}</span> |
| 103 | @ <span class="am-semi-strong"> {{ handleDateTimeFormat(evt.bookingCloses ? evt.bookingCloses : (singleDatesViewActive ? evt.periodStart : evt.periods[0].periodStart))[1] }}</span> |
| 104 | </p> |
| 105 | </el-tooltip> |
| 106 | </el-col> |
| 107 | |
| 108 | <!-- Event Status --> |
| 109 | <el-col :lg="3" :sm="4" :xs="24"> |
| 110 | <p class="am-col-title">{{ $root.labels.status_colon }}</p> |
| 111 | <span :class="'am-customer-status ' + getEventStatus(evt).class"> |
| 112 | {{ getEventStatus(evt).label }} |
| 113 | </span> |
| 114 | <span v-if="evt.status === 'full' && waitingListEnabled && evt.waitingList.enabled" class="am-customer-status waiting-list"> |
| 115 | {{ $root.labels.waiting_list }} |
| 116 | </span> |
| 117 | </el-col> |
| 118 | |
| 119 | <!-- Event Actions --> |
| 120 | <el-col v-if="canManage()" :lg="9" :sm="10" :xs="24" class="am-align-right"> |
| 121 | <div class="am-event-actions" @click.stop> |
| 122 | |
| 123 | <!-- View Attendees --> |
| 124 | <el-button @click="showDialogAttendees(evt.id)" v-if="canManage()" :disabled="!canManage()"> |
| 125 | {{ $root.labels.event_attendees}} |
| 126 | </el-button> |
| 127 | |
| 128 | <!-- Edit Button --> |
| 129 | <el-button @click="showDialogEditEvent(evt.id)" v-if="canManage()" :disabled="!canManage()"> |
| 130 | {{ $root.labels.edit }} |
| 131 | </el-button> |
| 132 | </div> |
| 133 | |
| 134 | </el-col> |
| 135 | |
| 136 | <!-- Zoom Link (For Customer) --> |
| 137 | <el-col |
| 138 | v-if="$root.settings.role === 'customer' && $root.settings.zoom.enabled && evt.zoomMeeting" |
| 139 | :lg="9" :sm="10" :xs="24" |
| 140 | class="am-align-right" |
| 141 | > |
| 142 | <p class="am-col-title">{{ $root.labels.zoom_join_link }}</p> |
| 143 | <a class="am-link" style="float: left" :href="evt.zoomMeeting.joinUrl"> |
| 144 | {{ evt.zoomMeeting.joinUrl }} |
| 145 | </a> |
| 146 | </el-col> |
| 147 | <!-- /Zoom Link (For Customer) --> |
| 148 | |
| 149 | </el-row> |
| 150 | </el-col> |
| 151 | </el-row> |
| 152 | </div> |
| 153 | </template> |
| 154 | |
| 155 | <script> |
| 156 | import backendEventMixin from '../../../js/backend/mixins/eventMixin' |
| 157 | import commonEventMixin from '../../../js/common/mixins/eventMixin' |
| 158 | import dateMixin from '../../../js/common/mixins/dateMixin' |
| 159 | import durationMixin from '../../../js/common/mixins/durationMixin' |
| 160 | import entitiesMixin from '../../../js/common/mixins/entitiesMixin' |
| 161 | import helperMixin from '../../../js/backend/mixins/helperMixin' |
| 162 | import imageMixin from '../../../js/common/mixins/imageMixin' |
| 163 | import notifyMixin from '../../../js/backend/mixins/notifyMixin' |
| 164 | import customerMixin from '../../../js/backend/mixins/customerMixin' |
| 165 | |
| 166 | export default { |
| 167 | mixins: [entitiesMixin, imageMixin, dateMixin, durationMixin, notifyMixin, helperMixin, backendEventMixin, commonEventMixin, customerMixin], |
| 168 | |
| 169 | props: { |
| 170 | evt: null, |
| 171 | singleDatesViewActive: true, |
| 172 | groupDatesViewActive: false, |
| 173 | employees: { |
| 174 | type: Array, |
| 175 | required: true |
| 176 | } |
| 177 | }, |
| 178 | |
| 179 | data () { |
| 180 | return { |
| 181 | event: null, |
| 182 | customer: null, |
| 183 | waitingListEnabled: false |
| 184 | } |
| 185 | }, |
| 186 | |
| 187 | mounted () { |
| 188 | this.waitingListEnabled = this.$root.settings.appointments.waitingListEvents.enabled |
| 189 | }, |
| 190 | |
| 191 | methods: { |
| 192 | showDialogEditEvent (id) { |
| 193 | this.$emit('showDialogEditEvent', id) |
| 194 | }, |
| 195 | |
| 196 | showDialogAttendees (id) { |
| 197 | this.$emit('showDialogAttendees', id) |
| 198 | }, |
| 199 | |
| 200 | getEventOrganizerName (organizerId) { |
| 201 | let organizerName = '' |
| 202 | if (organizerId) { |
| 203 | let organizer = this.employees.filter(empl => empl.id === organizerId) |
| 204 | organizerName = organizer.length ? (organizer[0].firstName + ' ' + organizer[0].lastName) : '' |
| 205 | } |
| 206 | |
| 207 | return organizerName || '/' |
| 208 | }, |
| 209 | |
| 210 | ticketsTooltipContent (tickets) { |
| 211 | let content = 'Tickets: ' |
| 212 | |
| 213 | for (let i = 0; i < tickets.length; i++) { |
| 214 | content += tickets[i].sold !== 0 ? (tickets[i].name + ' x ' + tickets[i].sold + (tickets.length - 1 !== i ? ', ' : '')) : '' |
| 215 | } |
| 216 | if (content.charAt(content.length - 2) === ',') content = content.slice(0, content.length - 2) |
| 217 | |
| 218 | return content !== 'Tickets: ' ? content : '' |
| 219 | }, |
| 220 | |
| 221 | canManage () { |
| 222 | return this.$root.settings.role !== 'customer' && (this.$root.settings.role === 'admin' || this.$root.settings.role === 'manager' || (this.$root.settings.role === 'provider' && this.$root.settings.roles.allowWriteEvents)) |
| 223 | } |
| 224 | } |
| 225 | } |
| 226 | </script> |
| 227 |