diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location.vue index 69913323c..dafd3872a 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location.vue @@ -16,6 +16,8 @@ :placeholder="$t('activity.choose_location')" :custom-label="customLabel" :options="locations" + group-values="locations" + group-label="locationGroup" v-model="location" > @@ -69,10 +71,17 @@ export default { const concernedThirdPartiesLocation = this.makeConcernedThirdPartiesLocation(thirdpartyLocationType); this.locations = [ - personLocation, - ...concernedPersonsLocation, - ...concernedThirdPartiesLocation, - ...response.results, + { + locationGroup: 'Localisation du parcours', + locations: [personLocation] + }, + { + locationGroup: 'Parties concernées', + locations: [...concernedPersonsLocation, ...concernedThirdPartiesLocation]}, + { + locationGroup: 'Autres localisations', + locations: response.results + } ]; if (window.default_location_id) { let location = this.locations.filter( @@ -90,7 +99,7 @@ export default { }, methods: { labelAccompanyingCourseLocation(value) { - return `${value.address.text} (Localisation du parcours)` + return `${value.address.text}` }, customLabel(value) { return value.name ? @@ -106,6 +115,7 @@ export default { if (e.type === 'person' && e.current_household_address !== null){ locations.push({ type: 'location', + id: -this.suggestedEntities.indexOf(e)*10, onthefly: true, name: e.text, address: { @@ -122,9 +132,11 @@ export default { let locations = []; this.suggestedEntities.forEach( (e) => { + console.log(this.suggestedEntities.indexOf(e)) if (e.type === 'thirdparty' && e.address !== null){ locations.push({ type: 'location', + id: -this.suggestedEntities.indexOf(e)*10, onthefly: true, name: e.text, address: { id: e.address.address_id }, @@ -139,6 +151,7 @@ export default { const accPeriodLocation = this.activity.accompanyingPeriod.location; return { type: 'location', + id: -1, onthefly: true, name: '__AccompanyingCourseLocation__', address: {