ameliabooking
/
assets
/
views
/
frontend
/
booking
/
components
/
formFields
/
ServiceFormField.vue
AddExtraFormField.vue
5 years ago
BringingFormField.vue
3 years ago
CalendarHeadingFormField.vue
5 years ago
EmployeeFormField.vue
5 years ago
LocationFormField.vue
3 years ago
PackageFormField.vue
5 years ago
PackageHeadingFormField.vue
5 years ago
RecurringSetupHeadingFormField.vue
5 years ago
ServiceFormField.vue
5 years ago
ServiceHeadingFormField.vue
5 years ago
ServicePackageFormField.vue
3 years ago
ServiceFormField.vue
155 lines
| 1 | <template> |
| 2 | <!-- Service --> |
| 3 | <el-form-item |
| 4 | v-if="showServices" |
| 5 | :label="serviceLabel || capitalizeFirstLetter($root.labels.service) + ':'" |
| 6 | prop="serviceId" |
| 7 | class="am-select-service-option" |
| 8 | :class="$root.settings.customization.forms ? `am-select-${classIdentifier}`: ''" |
| 9 | > |
| 10 | <el-select |
| 11 | v-model="appointment.serviceId" |
| 12 | :clearable="true" |
| 13 | :loading=!fetched |
| 14 | :popper-class="$root.settings.customization.forms ? `am-dropdown-${classIdentifier}` : ''" |
| 15 | id="serviceId" |
| 16 | placeholder="" |
| 17 | @change="changeService" |
| 18 | > |
| 19 | <el-option |
| 20 | v-for="service in servicesFiltered" |
| 21 | :key="service.id" |
| 22 | :label="service.name" |
| 23 | :value="service.id" |
| 24 | > |
| 25 | </el-option> |
| 26 | </el-select> |
| 27 | </el-form-item> |
| 28 | <!-- /Service --> |
| 29 | </template> |
| 30 | |
| 31 | <script> |
| 32 | import entitiesMixin from '../../../../../js/common/mixins/entitiesMixin' |
| 33 | import helperMixin from '../../../../../js/backend/mixins/helperMixin' |
| 34 | |
| 35 | export default { |
| 36 | name: 'serviceFormField', |
| 37 | |
| 38 | mixins: [entitiesMixin, helperMixin], |
| 39 | |
| 40 | props: { |
| 41 | fetched: { |
| 42 | type: Boolean, |
| 43 | default: false |
| 44 | }, |
| 45 | showServices: { |
| 46 | type: Boolean, |
| 47 | default: false |
| 48 | }, |
| 49 | showLocations: { |
| 50 | type: Boolean, |
| 51 | default: false |
| 52 | }, |
| 53 | showEmployees: { |
| 54 | type: Boolean, |
| 55 | default: false |
| 56 | }, |
| 57 | group: { |
| 58 | type: Object, |
| 59 | default: () => { |
| 60 | return { |
| 61 | allowed: false, |
| 62 | enabled: false, |
| 63 | count: 1, |
| 64 | options: [] |
| 65 | } |
| 66 | } |
| 67 | }, |
| 68 | selectedExtras: { |
| 69 | type: Array, |
| 70 | default: () => [] |
| 71 | }, |
| 72 | appointment: { |
| 73 | type: Object, |
| 74 | default: () => { |
| 75 | return { |
| 76 | bookingStart: '', |
| 77 | bookingStartTime: '', |
| 78 | bookings: [{ |
| 79 | customer: { |
| 80 | email: '', |
| 81 | externalId: null, |
| 82 | firstName: '', |
| 83 | id: null, |
| 84 | lastName: '', |
| 85 | phone: '' |
| 86 | }, |
| 87 | customFields: {}, |
| 88 | customerId: 0, |
| 89 | extras: [], |
| 90 | persons: 1 |
| 91 | }], |
| 92 | duration: 0, |
| 93 | group: false, |
| 94 | notifyParticipants: this.$root.settings.notifications.notifyCustomers, |
| 95 | payment: { |
| 96 | amount: 0, |
| 97 | gateway: '', |
| 98 | data: {} |
| 99 | }, |
| 100 | categoryId: null, |
| 101 | providerId: 0, |
| 102 | serviceId: null, |
| 103 | locationId: null |
| 104 | } |
| 105 | } |
| 106 | }, |
| 107 | options: { |
| 108 | type: Object, |
| 109 | default: () => { |
| 110 | return { |
| 111 | availableEntitiesIds: { |
| 112 | categories: [], |
| 113 | employees: [], |
| 114 | locations: [], |
| 115 | services: [] |
| 116 | }, |
| 117 | entitiesRelations: {}, |
| 118 | entities: { |
| 119 | packages: [], |
| 120 | services: [], |
| 121 | employees: [], |
| 122 | locations: [], |
| 123 | customFields: [] |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | }, |
| 128 | classIdentifier: { |
| 129 | type: String, |
| 130 | default: '' |
| 131 | }, |
| 132 | formField: { |
| 133 | type: Object, |
| 134 | default: () => {} |
| 135 | } |
| 136 | }, |
| 137 | |
| 138 | mounted () {}, |
| 139 | |
| 140 | data () { |
| 141 | return { |
| 142 | serviceLabel: this.formField.labels.service.value |
| 143 | } |
| 144 | }, |
| 145 | |
| 146 | methods: { |
| 147 | changeService () { |
| 148 | const fieldObj = { |
| 149 | identifier: 'changeService' |
| 150 | } |
| 151 | this.$emit('change', fieldObj) |
| 152 | } |
| 153 | } |
| 154 | } |
| 155 | </script> |