mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
addNewPersons() method is called out of addPerson component
note: this allow to use same addPersons component to add participations, requestor, or interlocutors
This commit is contained in:
parent
0f59be04a7
commit
b24eb93c57
@ -23,7 +23,10 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<add-persons buttonTitle="persons_associated.add_persons"></add-persons>
|
<add-persons
|
||||||
|
buttonTitle="persons_associated.add_persons"
|
||||||
|
@addNewPersons="addNewPersons">
|
||||||
|
</add-persons>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -45,11 +48,20 @@ export default {
|
|||||||
}),
|
}),
|
||||||
methods: {
|
methods: {
|
||||||
removeParticipation(item) {
|
removeParticipation(item) {
|
||||||
this.$store.dispatch('removeParticipation', item)
|
this.$store.dispatch('removeParticipation', item);
|
||||||
},
|
},
|
||||||
closeParticipation(item) {
|
closeParticipation(item) {
|
||||||
console.log('@@ CLICK close participation: item', item);
|
console.log('@@ CLICK close participation: item', item);
|
||||||
this.$store.dispatch('closeParticipation', item)
|
this.$store.dispatch('closeParticipation', item);
|
||||||
|
},
|
||||||
|
addNewPersons({ selected, modal }) {
|
||||||
|
console.log('@@@ CLICK button addNewPersons', selected);
|
||||||
|
selected.forEach(function(item) {
|
||||||
|
//console.log('# dispatch action for each item', item);
|
||||||
|
this.$store.dispatch('addParticipation', item);
|
||||||
|
}, this
|
||||||
|
);
|
||||||
|
modal.showModal = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<add-persons buttonTitle="requestor.add_requestor"></add-persons>
|
<add-persons
|
||||||
|
buttonTitle="requestor.add_requestor"
|
||||||
|
@addNewPersons="addNewPersons">
|
||||||
|
</add-persons>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -59,6 +62,18 @@ export default {
|
|||||||
accompanyingCourse() {
|
accompanyingCourse() {
|
||||||
return this.$store.state.accompanyingCourse
|
return this.$store.state.accompanyingCourse
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
addNewPersons({ selected, modal }) {
|
||||||
|
console.log('@@@ CLICK button addNewPersons', selected);
|
||||||
|
selected.forEach(function(item) {
|
||||||
|
//console.log('# dispatch action for each item', item);
|
||||||
|
console.log('HU-HUE, we want add new requestor !!', item);
|
||||||
|
//this.$store.dispatch('addRequestor', item);
|
||||||
|
}, this
|
||||||
|
);
|
||||||
|
modal.showModal = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -55,7 +55,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:footer>
|
<template v-slot:footer>
|
||||||
<button class="sc-button green" @click="addNewPersons">
|
<button class="sc-button green"
|
||||||
|
@click.prevent="$emit('addNewPersons', { selected, modal })">
|
||||||
<i class="fa fa-plus fa-fw"></i>{{ $t('action.add')}}
|
<i class="fa fa-plus fa-fw"></i>{{ $t('action.add')}}
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
@ -119,16 +120,8 @@ export default {
|
|||||||
this.$nextTick(function() {
|
this.$nextTick(function() {
|
||||||
this.$refs.search.focus();
|
this.$refs.search.focus();
|
||||||
})
|
})
|
||||||
},
|
|
||||||
addNewPersons() {
|
|
||||||
console.log('@@@ CLICK button addNewPersons')
|
|
||||||
this.selected.forEach(function(item) {
|
|
||||||
//console.log('# dispatch action for each item', item);
|
|
||||||
this.$store.dispatch('addParticipation', item);
|
|
||||||
}, this
|
|
||||||
);
|
|
||||||
this.modal.showModal = false;
|
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
emits: ['addNewPersons'],
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user