new Multitab CombinePeople, start Function

This commit is contained in:
ma0068
2025-10-22 10:23:24 +02:00
parent 4495632393
commit 6337869098
4 changed files with 83 additions and 1 deletions
@@ -0,0 +1,57 @@
export default {
name: "TabCombinePeople",
inject: {
cisRoot: {
from: 'cisRoot'
},
},
props: {
modelValue: Object,
},
computed: {
personIds(){
if (this.modelValue.person_id) {
return [this.modelValue.person_id];
}
return this.modelValue.map(e => e.person_id);
}
},
methods: {
combinePeople(){
let person1_id = this.personIds[0];
let person2_id = this.personIds[1];
if(person1_id == person2_id) {
return this.$fhcAlert.alertError("gleiche Person, keine Zusammenlegeung möglich");
}
let linkCombinePeople = this.cisRoot + 'vilesci/stammdaten/personen_wartung.php?person_id_1=' + person1_id + '&person_id_2='+ person2_id;
console.log(linkCombinePeople);
window.open(linkCombinePeople, '_blank');
}
},
data(){
return {}
},
template: /*html*/ `
<div class="stv-details-combine-people h-100 pb-3">
<h4>Personen zusammenlegen</h4>
{{personIds}}
<div v-if="this.modelValue.length">
<p v-if="this.modelValue.length == 2">
<button class="btn btn-primary" @click="combinePeople"> Zusammenlegen</button>
</p>
<p v-else">
ungültige Anzahl: {{this.modelValue.length}}
</p>
</div>
</div>
`
};