mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
household member editor: display when a concerned person already belongs to a household
This commit is contained in:
parent
da12aedb53
commit
13faf6fe5a
@ -9,7 +9,7 @@
|
||||
<div v-else>
|
||||
<p>
|
||||
{{ $t('household_members_editor.concerned.persons_will_be_moved') }} :
|
||||
<span v-for="c in concerned">
|
||||
<span v-for="c in concerned" :key=c.person.id>
|
||||
<person-render-box render="badge" :options="{addLink: false}" :person="c.person"></person-render-box>
|
||||
<button class="btn" @click="removePerson(c.person)" v-if="c.allowRemove" style="padding-left:0;">
|
||||
<span class="fa-stack fa-lg" :title="$t('household_members_editor.concerned.remove_concerned')">
|
||||
@ -19,6 +19,16 @@
|
||||
</button>
|
||||
</span>
|
||||
</p>
|
||||
<div class="alert alert-info" v-if="concernedPersonsWithHouseholds.length > 0">
|
||||
<p>{{ $t('household_members_editor.concerned.persons_with_household') }}</p>
|
||||
<ul v-for="c in concernedPersonsWithHouseholds" :key=c.person.id>
|
||||
<li>
|
||||
{{ $t('household_members_editor.concerned.person') }} {{c.person.text}} {{$t('household_members_editor.concerned.already_belongs_to_household') }}
|
||||
<a target="_blank" :href="this.makeHouseholdLink(c.person.current_household_id)">{{c.person.current_household_id}}</a>.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<ul class="record_actions">
|
||||
@ -59,7 +69,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
...mapState([
|
||||
'concerned'
|
||||
'concerned', 'household'
|
||||
]),
|
||||
...mapGetters([
|
||||
'persons',
|
||||
@ -67,6 +77,11 @@ export default {
|
||||
noPerson () {
|
||||
return this.$store.getters.persons.length === 0;
|
||||
},
|
||||
concernedPersonsWithHouseholds () {
|
||||
return this.$store.state.concerned.filter(c =>
|
||||
c.person.current_household_id !== null && c.person.current_household_id !== this.$store.state.household.id
|
||||
);
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -92,6 +107,9 @@ export default {
|
||||
console.log('remove person in concerned', person);
|
||||
this.$store.dispatch('removePerson', person);
|
||||
},
|
||||
makeHouseholdLink(id) {
|
||||
return `/fr/person/household/${id}/summary`
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -46,6 +46,9 @@ const appMessages = {
|
||||
move_to: "Déplacer vers",
|
||||
persons_leaving: "Usagers quittant leurs ménages",
|
||||
no_person_in_position: "Aucun usager ne sera ajouté à cette position",
|
||||
persons_with_household: "Attention, usagers avec ménages",
|
||||
person: "L'usager",
|
||||
already_belongs_to_household: "appartient déjà au ménage"
|
||||
},
|
||||
positioning: {
|
||||
persons_to_positionnate: 'Usagers à positionner',
|
||||
|
@ -307,7 +307,7 @@ const store = createStore({
|
||||
comment: "",
|
||||
});
|
||||
} else {
|
||||
console.err("person already included");
|
||||
console.error("person already included");
|
||||
}
|
||||
},
|
||||
markPosition(state, { person_id, position_id}) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user