PackageEmployeeFormField.vue
2 years ago
PackageInfoFormField.vue
2 years ago
PackageListFormField.vue
2 years ago
PackageLocationFormField.vue
2 years ago
PackageRulesFormField.vue
2 years ago
PackageLocationFormField.vue
68 lines
| 1 | <template> |
| 2 | <el-form-item |
| 3 | :label="labelLocation || `${capitalizeFirstLetter($root.labels.location)}:`" |
| 4 | :class="$root.settings.customization.forms ? `am-select-${classIdentifier}`: ''" |
| 5 | > |
| 6 | <el-select |
| 7 | v-model="selectedPackage.bookable[activeBookableIndex].locationId" |
| 8 | :clearable="true" |
| 9 | placeholder="" |
| 10 | :popper-class="$root.settings.customization.forms ? `am-dropdown-${classIdentifier}` : ''" |
| 11 | @change="changeFormItem" |
| 12 | > |
| 13 | <el-option |
| 14 | v-for="location in filteredLocation" |
| 15 | :key="location.id" |
| 16 | :label="location.name" |
| 17 | :value="location.id" |
| 18 | > |
| 19 | </el-option> |
| 20 | </el-select> |
| 21 | </el-form-item> |
| 22 | </template> |
| 23 | |
| 24 | <script> |
| 25 | import helperMixin from '../../../../js/backend/mixins/helperMixin' |
| 26 | |
| 27 | export default { |
| 28 | name: 'packageLocationFormField', |
| 29 | |
| 30 | mixins: [helperMixin], |
| 31 | |
| 32 | props: { |
| 33 | selectedPackage: { |
| 34 | type: Object, |
| 35 | default: () => {} |
| 36 | }, |
| 37 | activeBookableIndex: { |
| 38 | type: Number, |
| 39 | default: 0 |
| 40 | }, |
| 41 | filteredLocation: { |
| 42 | type: Array, |
| 43 | default: () => [] |
| 44 | }, |
| 45 | classIdentifier: { |
| 46 | type: String, |
| 47 | default: '' |
| 48 | }, |
| 49 | formField: { |
| 50 | type: Object, |
| 51 | default: () => {} |
| 52 | } |
| 53 | }, |
| 54 | |
| 55 | data () { |
| 56 | return { |
| 57 | labelLocation: this.formField.labels.location.value |
| 58 | } |
| 59 | }, |
| 60 | |
| 61 | methods: { |
| 62 | changeFormItem () { |
| 63 | this.$emit('changeFormItem') |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | </script> |
| 68 |