mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-07 13:59:43 +00:00
Clean skeleton (and add Junie guidelines)
This commit is contained in:
@@ -1,53 +1,53 @@
|
||||
<template>
|
||||
<ol class="breadcrumb">
|
||||
<li
|
||||
v-for="s in steps"
|
||||
:key="s"
|
||||
class="breadcrumb-item"
|
||||
:class="{ active: step === s }"
|
||||
>
|
||||
{{ $t("household_members_editor.app.steps." + s) }}
|
||||
</li>
|
||||
</ol>
|
||||
<concerned v-if="step === 'concerned'" />
|
||||
<household v-if="step === 'household'" @ready-to-go="goToNext" />
|
||||
<household-address v-if="step === 'household_address'" />
|
||||
<positioning v-if="step === 'positioning'" />
|
||||
<dates v-if="step === 'confirm'" />
|
||||
<confirmation v-if="step === 'confirm'" />
|
||||
<ol class="breadcrumb">
|
||||
<li
|
||||
v-for="s in steps"
|
||||
:key="s"
|
||||
class="breadcrumb-item"
|
||||
:class="{ active: step === s }"
|
||||
>
|
||||
{{ $t("household_members_editor.app.steps." + s) }}
|
||||
</li>
|
||||
</ol>
|
||||
<concerned v-if="step === 'concerned'" />
|
||||
<household v-if="step === 'household'" @ready-to-go="goToNext" />
|
||||
<household-address v-if="step === 'household_address'" />
|
||||
<positioning v-if="step === 'positioning'" />
|
||||
<dates v-if="step === 'confirm'" />
|
||||
<confirmation v-if="step === 'confirm'" />
|
||||
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
<li class="cancel" v-if="step !== 'concerned'">
|
||||
<button class="btn btn-cancel" @click="goToPrevious">
|
||||
{{ $t("household_members_editor.app.previous") }}
|
||||
</button>
|
||||
</li>
|
||||
<li class="cancel" v-else-if="hasReturnPath">
|
||||
<button class="btn btn-cancel" @click="goToPrevious">
|
||||
{{ $t("household_members_editor.app.cancel") }}
|
||||
</button>
|
||||
</li>
|
||||
<li v-if="step !== 'confirm'">
|
||||
<button
|
||||
class="btn btn-action"
|
||||
@click="goToNext"
|
||||
:disabled="!isNextAllowed"
|
||||
>
|
||||
{{ $t("household_members_editor.app.next") }} <i
|
||||
class="fa fa-arrow-right"
|
||||
/>
|
||||
</button>
|
||||
</li>
|
||||
<li v-else>
|
||||
<button
|
||||
class="btn btn-save"
|
||||
@click="confirm"
|
||||
:disabled="hasWarnings || !lastStepIsSaveAllowed"
|
||||
>
|
||||
{{ $t("household_members_editor.app.save") }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
<li class="cancel" v-if="step !== 'concerned'">
|
||||
<button class="btn btn-cancel" @click="goToPrevious">
|
||||
{{ $t("household_members_editor.app.previous") }}
|
||||
</button>
|
||||
</li>
|
||||
<li class="cancel" v-else-if="hasReturnPath">
|
||||
<button class="btn btn-cancel" @click="goToPrevious">
|
||||
{{ $t("household_members_editor.app.cancel") }}
|
||||
</button>
|
||||
</li>
|
||||
<li v-if="step !== 'confirm'">
|
||||
<button
|
||||
class="btn btn-action"
|
||||
@click="goToNext"
|
||||
:disabled="!isNextAllowed"
|
||||
>
|
||||
{{ $t("household_members_editor.app.next") }} <i
|
||||
class="fa fa-arrow-right"
|
||||
/>
|
||||
</button>
|
||||
</li>
|
||||
<li v-else>
|
||||
<button
|
||||
class="btn btn-save"
|
||||
@click="confirm"
|
||||
:disabled="hasWarnings || !lastStepIsSaveAllowed"
|
||||
>
|
||||
{{ $t("household_members_editor.app.save") }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -60,123 +60,123 @@ import Confirmation from "./components/Confirmation.vue";
|
||||
import Positioning from "./components/Positioning";
|
||||
|
||||
export default {
|
||||
name: "App",
|
||||
components: {
|
||||
Positioning,
|
||||
Concerned,
|
||||
Household,
|
||||
HouseholdAddress,
|
||||
Dates,
|
||||
Confirmation,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
step: "concerned",
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
hasWarnings: (state) =>
|
||||
state.warnings.length > 0 || state.errors.length > 0,
|
||||
}),
|
||||
steps() {
|
||||
let s = ["concerned", "household"];
|
||||
|
||||
if (this.$store.getters.isHouseholdNew) {
|
||||
s.push("household_address");
|
||||
}
|
||||
|
||||
if (!this.$store.getters.isModeLeave) {
|
||||
s.push("positioning");
|
||||
}
|
||||
|
||||
s.push("confirm");
|
||||
|
||||
return s;
|
||||
name: "App",
|
||||
components: {
|
||||
Positioning,
|
||||
Concerned,
|
||||
Household,
|
||||
HouseholdAddress,
|
||||
Dates,
|
||||
Confirmation,
|
||||
},
|
||||
hasReturnPath() {
|
||||
let params = new URLSearchParams(window.location.search);
|
||||
data() {
|
||||
return {
|
||||
step: "concerned",
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
hasWarnings: (state) =>
|
||||
state.warnings.length > 0 || state.errors.length > 0,
|
||||
}),
|
||||
steps() {
|
||||
let s = ["concerned", "household"];
|
||||
|
||||
return params.has("returnPath");
|
||||
},
|
||||
// return true if the next step is allowed
|
||||
isNextAllowed() {
|
||||
switch (this.$data.step) {
|
||||
case "concerned":
|
||||
return this.$store.state.concerned.length > 0;
|
||||
case "household":
|
||||
return this.$store.state.mode !== null;
|
||||
case "household_address":
|
||||
return (
|
||||
this.$store.getters.hasHouseholdAddress ||
|
||||
this.$store.getters.isHouseholdForceNoAddress
|
||||
);
|
||||
case "positioning":
|
||||
return (
|
||||
this.$store.getters.hasHouseholdOrLeave &&
|
||||
this.$store.getters.hasPersonsWellPositionnated
|
||||
);
|
||||
}
|
||||
if (this.$store.getters.isHouseholdNew) {
|
||||
s.push("household_address");
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
lastStepIsSaveAllowed() {
|
||||
let r =
|
||||
!this.$store.getters.isHouseholdNew ||
|
||||
(this.$store.state.numberOfChildren !== null &&
|
||||
this.$store.state.householdCompositionType !== null);
|
||||
console.log("is saved allowed ?", r);
|
||||
if (!this.$store.getters.isModeLeave) {
|
||||
s.push("positioning");
|
||||
}
|
||||
|
||||
return r;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
goToNext() {
|
||||
console.log("go to next");
|
||||
switch (this.$data.step) {
|
||||
case "concerned":
|
||||
this.$data.step = "household";
|
||||
break;
|
||||
case "household":
|
||||
if (this.$store.getters.isHouseholdNew) {
|
||||
this.$data.step = "household_address";
|
||||
break;
|
||||
} else if (this.$store.getters.isModeLeave) {
|
||||
this.$data.step = "confirm";
|
||||
break;
|
||||
} else {
|
||||
this.$data.step = "positioning";
|
||||
break;
|
||||
}
|
||||
case "household_address":
|
||||
this.$data.step = "positioning";
|
||||
break;
|
||||
case "positioning":
|
||||
this.$data.step = "confirm";
|
||||
break;
|
||||
}
|
||||
},
|
||||
goToPrevious() {
|
||||
if (this.$data.step === "concerned") {
|
||||
let params = new URLSearchParams(window.location.search);
|
||||
if (params.has("returnPath")) {
|
||||
window.location.replace(params.get("returnPath"));
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
s.push("confirm");
|
||||
|
||||
let s = this.steps;
|
||||
let index = s.indexOf(this.$data.step);
|
||||
if (s[index - 1] === undefined) {
|
||||
throw Error("step not found");
|
||||
}
|
||||
return s;
|
||||
},
|
||||
hasReturnPath() {
|
||||
let params = new URLSearchParams(window.location.search);
|
||||
|
||||
this.$data.step = s[index - 1];
|
||||
return params.has("returnPath");
|
||||
},
|
||||
// return true if the next step is allowed
|
||||
isNextAllowed() {
|
||||
switch (this.$data.step) {
|
||||
case "concerned":
|
||||
return this.$store.state.concerned.length > 0;
|
||||
case "household":
|
||||
return this.$store.state.mode !== null;
|
||||
case "household_address":
|
||||
return (
|
||||
this.$store.getters.hasHouseholdAddress ||
|
||||
this.$store.getters.isHouseholdForceNoAddress
|
||||
);
|
||||
case "positioning":
|
||||
return (
|
||||
this.$store.getters.hasHouseholdOrLeave &&
|
||||
this.$store.getters.hasPersonsWellPositionnated
|
||||
);
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
lastStepIsSaveAllowed() {
|
||||
let r =
|
||||
!this.$store.getters.isHouseholdNew ||
|
||||
(this.$store.state.numberOfChildren !== null &&
|
||||
this.$store.state.householdCompositionType !== null);
|
||||
console.log("is saved allowed ?", r);
|
||||
|
||||
return r;
|
||||
},
|
||||
},
|
||||
confirm() {
|
||||
this.$store.dispatch("confirm");
|
||||
methods: {
|
||||
goToNext() {
|
||||
console.log("go to next");
|
||||
switch (this.$data.step) {
|
||||
case "concerned":
|
||||
this.$data.step = "household";
|
||||
break;
|
||||
case "household":
|
||||
if (this.$store.getters.isHouseholdNew) {
|
||||
this.$data.step = "household_address";
|
||||
break;
|
||||
} else if (this.$store.getters.isModeLeave) {
|
||||
this.$data.step = "confirm";
|
||||
break;
|
||||
} else {
|
||||
this.$data.step = "positioning";
|
||||
break;
|
||||
}
|
||||
case "household_address":
|
||||
this.$data.step = "positioning";
|
||||
break;
|
||||
case "positioning":
|
||||
this.$data.step = "confirm";
|
||||
break;
|
||||
}
|
||||
},
|
||||
goToPrevious() {
|
||||
if (this.$data.step === "concerned") {
|
||||
let params = new URLSearchParams(window.location.search);
|
||||
if (params.has("returnPath")) {
|
||||
window.location.replace(params.get("returnPath"));
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
let s = this.steps;
|
||||
let index = s.indexOf(this.$data.step);
|
||||
if (s[index - 1] === undefined) {
|
||||
throw Error("step not found");
|
||||
}
|
||||
|
||||
this.$data.step = s[index - 1];
|
||||
},
|
||||
confirm() {
|
||||
this.$store.dispatch("confirm");
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@@ -1,74 +1,88 @@
|
||||
<template>
|
||||
<h2 class="mt-4">
|
||||
{{ $t("household_members_editor.concerned.title") }}
|
||||
</h2>
|
||||
<h2 class="mt-4">
|
||||
{{ $t("household_members_editor.concerned.title") }}
|
||||
</h2>
|
||||
|
||||
<div v-if="noPerson">
|
||||
<div class="alert alert-info">
|
||||
{{ $t("household_members_editor.concerned.add_at_least_onePerson") }}
|
||||
<div v-if="noPerson">
|
||||
<div class="alert alert-info">
|
||||
{{
|
||||
$t("household_members_editor.concerned.add_at_least_onePerson")
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<p>
|
||||
{{
|
||||
$t("household_members_editor.concerned.persons_will_be_moved")
|
||||
}} :
|
||||
</p>
|
||||
<div v-else>
|
||||
<p>
|
||||
{{
|
||||
$t("household_members_editor.concerned.persons_will_be_moved")
|
||||
}} :
|
||||
</p>
|
||||
|
||||
<ul class="list-suggest remove-items inline">
|
||||
<li v-for="c in concerned" :key="c.person.id" @click="removeConcerned(c)">
|
||||
<span><person-text :person="c.person" /></span>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="list-suggest remove-items inline">
|
||||
<li
|
||||
v-for="c in concerned"
|
||||
:key="c.person.id"
|
||||
@click="removeConcerned(c)"
|
||||
>
|
||||
<span><person-text :person="c.person" /></span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<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>
|
||||
{{ 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
|
||||
>.
|
||||
<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>
|
||||
{{ 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">
|
||||
<li class="add-persons">
|
||||
<add-persons
|
||||
button-title="household_members_editor.concerned.add_persons"
|
||||
modal-title="household_members_editor.concerned.search"
|
||||
:key="addPersons.key"
|
||||
:options="addPersons.options"
|
||||
@add-new-persons="addNewPersons"
|
||||
ref="addPersons"
|
||||
>
|
||||
<!-- to cast child method -->
|
||||
</add-persons>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul class="record_actions">
|
||||
<li class="add-persons">
|
||||
<add-persons
|
||||
button-title="household_members_editor.concerned.add_persons"
|
||||
modal-title="household_members_editor.concerned.search"
|
||||
:key="addPersons.key"
|
||||
:options="addPersons.options"
|
||||
@add-new-persons="addNewPersons"
|
||||
ref="addPersons"
|
||||
>
|
||||
<!-- to cast child method -->
|
||||
</add-persons>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
.move_to {
|
||||
.move_hint {
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
padding: 0.4rem 0.5rem;
|
||||
}
|
||||
.move_hint {
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
padding: 0.4rem 0.5rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -78,61 +92,62 @@ import AddPersons from "ChillPersonAssets/vuejs/_components/AddPersons.vue";
|
||||
import PersonText from "ChillPersonAssets/vuejs/_components/Entity/PersonText.vue";
|
||||
|
||||
export default {
|
||||
name: "Concerned",
|
||||
components: {
|
||||
AddPersons,
|
||||
PersonText,
|
||||
},
|
||||
computed: {
|
||||
...mapState(["concerned", "household"]),
|
||||
...mapGetters(["persons"]),
|
||||
noPerson() {
|
||||
return this.$store.getters.persons.length === 0;
|
||||
name: "Concerned",
|
||||
components: {
|
||||
AddPersons,
|
||||
PersonText,
|
||||
},
|
||||
concernedPersonsWithHouseholds() {
|
||||
if (this.$store.state.household) {
|
||||
return this.$store.state.concerned.filter(
|
||||
(c) =>
|
||||
c.person.current_household_id !== null &&
|
||||
c.person.current_household_id !== this.$store.state.household.id,
|
||||
);
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addPersons: {
|
||||
key: "household_members_editor_concerned",
|
||||
options: {
|
||||
type: ["person"],
|
||||
priority: null,
|
||||
uniq: false,
|
||||
computed: {
|
||||
...mapState(["concerned", "household"]),
|
||||
...mapGetters(["persons"]),
|
||||
noPerson() {
|
||||
return this.$store.getters.persons.length === 0;
|
||||
},
|
||||
concernedPersonsWithHouseholds() {
|
||||
if (this.$store.state.household) {
|
||||
return this.$store.state.concerned.filter(
|
||||
(c) =>
|
||||
c.person.current_household_id !== null &&
|
||||
c.person.current_household_id !==
|
||||
this.$store.state.household.id,
|
||||
);
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
addNewPersons({ selected, modal }) {
|
||||
selected.forEach(function (item) {
|
||||
this.$store.dispatch("addConcerned", item.result);
|
||||
}, this);
|
||||
this.$refs.addPersons.resetSearch(); // to cast child method
|
||||
modal.showModal = false;
|
||||
},
|
||||
removeConcerned(concerned) {
|
||||
console.log("removedconcerned", concerned);
|
||||
data() {
|
||||
return {
|
||||
addPersons: {
|
||||
key: "household_members_editor_concerned",
|
||||
options: {
|
||||
type: ["person"],
|
||||
priority: null,
|
||||
uniq: false,
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
addNewPersons({ selected, modal }) {
|
||||
selected.forEach(function (item) {
|
||||
this.$store.dispatch("addConcerned", item.result);
|
||||
}, this);
|
||||
this.$refs.addPersons.resetSearch(); // to cast child method
|
||||
modal.showModal = false;
|
||||
},
|
||||
removeConcerned(concerned) {
|
||||
console.log("removedconcerned", concerned);
|
||||
|
||||
if (!concerned.allowRemove) {
|
||||
return;
|
||||
}
|
||||
if (!concerned.allowRemove) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.$store.dispatch("removePerson", concerned.person);
|
||||
this.$store.dispatch("removePerson", concerned.person);
|
||||
},
|
||||
makeHouseholdLink(id) {
|
||||
return `/fr/person/household/${id}/summary`;
|
||||
},
|
||||
},
|
||||
makeHouseholdLink(id) {
|
||||
return `/fr/person/household/${id}/summary`;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@@ -1,20 +1,20 @@
|
||||
<template>
|
||||
<div v-if="hasWarning" class="alert alert-warning">
|
||||
{{ $t("household_members_editor.confirmation.there_are_warnings") }}
|
||||
</div>
|
||||
<div v-if="hasWarning" class="alert alert-warning">
|
||||
{{ $t("household_members_editor.confirmation.there_are_warnings") }}
|
||||
</div>
|
||||
|
||||
<p v-if="hasWarning">
|
||||
{{ $t("household_members_editor.confirmation.check_those_items") }}
|
||||
</p>
|
||||
<p v-if="hasWarning">
|
||||
{{ $t("household_members_editor.confirmation.check_those_items") }}
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li v-for="(msg, i) in warnings" class="warning" :key="i">
|
||||
{{ $t(msg.m, msg.a) }}
|
||||
</li>
|
||||
<li v-for="(msg, i) in errors" class="error" :key="i">
|
||||
{{ msg }}
|
||||
</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li v-for="(msg, i) in warnings" class="warning" :key="i">
|
||||
{{ $t(msg.m, msg.a) }}
|
||||
</li>
|
||||
<li v-for="(msg, i) in errors" class="error" :key="i">
|
||||
{{ msg }}
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
@@ -23,14 +23,14 @@
|
||||
import { mapState } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "Confirmation",
|
||||
computed: {
|
||||
...mapState({
|
||||
hasWarnings: (state) =>
|
||||
state.warnings.length > 0 || state.errors.length > 0,
|
||||
warnings: (state) => state.warnings,
|
||||
errors: (state) => state.errors,
|
||||
}),
|
||||
},
|
||||
name: "Confirmation",
|
||||
computed: {
|
||||
...mapState({
|
||||
hasWarnings: (state) =>
|
||||
state.warnings.length > 0 || state.errors.length > 0,
|
||||
warnings: (state) => state.warnings,
|
||||
errors: (state) => state.errors,
|
||||
}),
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@@ -1,35 +1,37 @@
|
||||
<template>
|
||||
<div class="flex-table mb-5" v-if="hasHousehold">
|
||||
<div class="item-bloc">
|
||||
<household-render-box :household="fakeHouseholdWithConcerned" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-table" v-if="isModeLeave">
|
||||
<div class="item-bloc">
|
||||
<section>
|
||||
<div class="item-row">
|
||||
<div class="item-col">
|
||||
<div class="h4">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fa fa-home fa-stack-1x" />
|
||||
<i class="fa fa-ban fa-stack-2x text-danger" />
|
||||
</span>
|
||||
{{
|
||||
$t("household_members_editor.household.leave_without_household")
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-table mb-5" v-if="hasHousehold">
|
||||
<div class="item-bloc">
|
||||
<household-render-box :household="fakeHouseholdWithConcerned" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-table" v-if="isModeLeave">
|
||||
<div class="item-bloc">
|
||||
<section>
|
||||
<div class="item-row">
|
||||
<div class="item-col">
|
||||
<div class="h4">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fa fa-home fa-stack-1x" />
|
||||
<i class="fa fa-ban fa-stack-2x text-danger" />
|
||||
</span>
|
||||
{{
|
||||
$t(
|
||||
"household_members_editor.household.leave_without_household",
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-row">
|
||||
{{
|
||||
$t(
|
||||
"household_members_editor.household.will_leave_any_household_explanation",
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="item-row">
|
||||
{{
|
||||
$t(
|
||||
"household_members_editor.household.will_leave_any_household_explanation",
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -37,17 +39,17 @@ import { mapGetters } from "vuex";
|
||||
import HouseholdRenderBox from "ChillPersonAssets/vuejs/_components/Entity/HouseholdRenderBox.vue";
|
||||
|
||||
export default {
|
||||
name: "CurrentHousehold",
|
||||
components: {
|
||||
HouseholdRenderBox,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
"hasHousehold",
|
||||
"fakeHouseholdWithConcerned",
|
||||
"isModeLeave",
|
||||
]),
|
||||
},
|
||||
name: "CurrentHousehold",
|
||||
components: {
|
||||
HouseholdRenderBox,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
"hasHousehold",
|
||||
"fakeHouseholdWithConcerned",
|
||||
"isModeLeave",
|
||||
]),
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@@ -1,83 +1,83 @@
|
||||
<template>
|
||||
<current-household />
|
||||
<current-household />
|
||||
|
||||
<h2>{{ $t("household_members_editor.dates.dates_title") }}</h2>
|
||||
<h2>{{ $t("household_members_editor.dates.dates_title") }}</h2>
|
||||
|
||||
<div class="mb-3 row">
|
||||
<label for="start_date" class="col-form-label col-sm-4 required">
|
||||
{{ $t("household_members_editor.dates.start_date") }}
|
||||
</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="date" v-model="startDate" class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="this.isHouseholdNew">
|
||||
<h2>{{ $t("household_members_editor.composition.composition") }}</h2>
|
||||
<div class="mb-3 row">
|
||||
<label class="col-form-label col-sm-4 required">{{
|
||||
$t("household_members_editor.composition.household_composition")
|
||||
}}</label>
|
||||
<div class="col-sm-8">
|
||||
<select
|
||||
v-model="householdCompositionType"
|
||||
class="form-select form-control"
|
||||
>
|
||||
<option
|
||||
v-for="t in householdCompositionTypes"
|
||||
:key="t.id"
|
||||
:value="t.id"
|
||||
>
|
||||
{{ localizeString(t.label) }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<label for="start_date" class="col-form-label col-sm-4 required">
|
||||
{{ $t("household_members_editor.dates.start_date") }}
|
||||
</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="date" v-model="startDate" class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 row">
|
||||
<label class="col-form-label col-sm-4 required">{{
|
||||
$t("household_members_editor.composition.number_of_children")
|
||||
}}</label>
|
||||
<div class="col-sm-8">
|
||||
<input
|
||||
type="number"
|
||||
v-model="numberOfChildren"
|
||||
min="0"
|
||||
max="30"
|
||||
class="form-control"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div v-if="this.isHouseholdNew">
|
||||
<h2>{{ $t("household_members_editor.composition.composition") }}</h2>
|
||||
<div class="mb-3 row">
|
||||
<label class="col-form-label col-sm-4 required">{{
|
||||
$t("household_members_editor.composition.household_composition")
|
||||
}}</label>
|
||||
<div class="col-sm-8">
|
||||
<select
|
||||
v-model="householdCompositionType"
|
||||
class="form-select form-control"
|
||||
>
|
||||
<option
|
||||
v-for="t in householdCompositionTypes"
|
||||
:key="t.id"
|
||||
:value="t.id"
|
||||
>
|
||||
{{ localizeString(t.label) }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 row">
|
||||
<label class="col-form-label col-sm-4 required">{{
|
||||
$t("household_members_editor.composition.number_of_children")
|
||||
}}</label>
|
||||
<div class="col-sm-8">
|
||||
<input
|
||||
type="number"
|
||||
v-model="numberOfChildren"
|
||||
min="0"
|
||||
max="30"
|
||||
class="form-control"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="this.displayDependents" class="mb-3 row">
|
||||
<label class="col-form-label col-sm-4 required">{{
|
||||
$t("household_members_editor.composition.number_of_dependents")
|
||||
}}</label>
|
||||
<div class="col-sm-8">
|
||||
<input
|
||||
type="number"
|
||||
v-model="numberOfDependents"
|
||||
min="0"
|
||||
max="30"
|
||||
class="form-control"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="this.displayDependents" class="mb-3 row">
|
||||
<label class="col-form-label col-sm-4 required">{{
|
||||
$t(
|
||||
"household_members_editor.composition.number_of_dependents_with_disabilities",
|
||||
)
|
||||
}}</label>
|
||||
<div class="col-sm-8">
|
||||
<input
|
||||
type="number"
|
||||
v-model="numberOfDependentsWithDisabilities"
|
||||
min="0"
|
||||
max="30"
|
||||
class="form-control"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="this.displayDependents" class="mb-3 row">
|
||||
<label class="col-form-label col-sm-4 required">{{
|
||||
$t("household_members_editor.composition.number_of_dependents")
|
||||
}}</label>
|
||||
<div class="col-sm-8">
|
||||
<input
|
||||
type="number"
|
||||
v-model="numberOfDependents"
|
||||
min="0"
|
||||
max="30"
|
||||
class="form-control"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="this.displayDependents" class="mb-3 row">
|
||||
<label class="col-form-label col-sm-4 required">{{
|
||||
$t(
|
||||
"household_members_editor.composition.number_of_dependents_with_disabilities",
|
||||
)
|
||||
}}</label>
|
||||
<div class="col-sm-8">
|
||||
<input
|
||||
type="number"
|
||||
v-model="numberOfDependentsWithDisabilities"
|
||||
min="0"
|
||||
max="30"
|
||||
class="form-control"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -86,71 +86,74 @@ import { mapGetters, mapState } from "vuex";
|
||||
import { localizeString } from "ChillMainAssets/lib/localizationHelper/localizationHelper";
|
||||
|
||||
export default {
|
||||
name: "Dates",
|
||||
methods: { localizeString },
|
||||
components: {
|
||||
CurrentHousehold,
|
||||
},
|
||||
computed: {
|
||||
...mapState(["householdCompositionTypes"]),
|
||||
...mapGetters(["isHouseholdNew"]),
|
||||
displayDependents: {
|
||||
get() {
|
||||
return window.household_members_editor_data.displayDependents;
|
||||
},
|
||||
name: "Dates",
|
||||
methods: { localizeString },
|
||||
components: {
|
||||
CurrentHousehold,
|
||||
},
|
||||
householdCompositionType: {
|
||||
get() {
|
||||
if (this.$store.state.householdCompositionType !== null) {
|
||||
return this.$store.state.householdCompositionType.id;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
set(value) {
|
||||
this.$store.dispatch("setHouseholdCompositionType", value);
|
||||
},
|
||||
},
|
||||
numberOfChildren: {
|
||||
get() {
|
||||
return this.$store.state.numberOfChildren;
|
||||
},
|
||||
set(value) {
|
||||
this.$store.commit("setNumberOfChildren", value);
|
||||
},
|
||||
},
|
||||
numberOfDependents: {
|
||||
get() {
|
||||
return this.$store.state.numberOfDependents;
|
||||
},
|
||||
set(value) {
|
||||
this.$store.commit("setNumberOfDependents", value);
|
||||
},
|
||||
},
|
||||
numberOfDependentsWithDisabilities: {
|
||||
get() {
|
||||
return this.$store.state.numberOfDependentsWithDisabilities;
|
||||
},
|
||||
set(value) {
|
||||
this.$store.commit("setNumberOfDependentsWithDisabilities", value);
|
||||
},
|
||||
},
|
||||
startDate: {
|
||||
get() {
|
||||
return this.$store.state.startDate;
|
||||
// return [
|
||||
// this.$store.state.startDate.getFullYear(),
|
||||
// (this.$store.state.startDate.getMonth() + 1).toString().padStart(2, '0'),
|
||||
// this.$store.state.startDate.getDate().toString().padStart(2, '0')
|
||||
// ].join('-');
|
||||
},
|
||||
set(value) {
|
||||
// let
|
||||
// [year, month, day] = value.split('-'),
|
||||
// dValue = new Date(year, month-1, day);
|
||||
computed: {
|
||||
...mapState(["householdCompositionTypes"]),
|
||||
...mapGetters(["isHouseholdNew"]),
|
||||
displayDependents: {
|
||||
get() {
|
||||
return window.household_members_editor_data.displayDependents;
|
||||
},
|
||||
},
|
||||
householdCompositionType: {
|
||||
get() {
|
||||
if (this.$store.state.householdCompositionType !== null) {
|
||||
return this.$store.state.householdCompositionType.id;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
set(value) {
|
||||
this.$store.dispatch("setHouseholdCompositionType", value);
|
||||
},
|
||||
},
|
||||
numberOfChildren: {
|
||||
get() {
|
||||
return this.$store.state.numberOfChildren;
|
||||
},
|
||||
set(value) {
|
||||
this.$store.commit("setNumberOfChildren", value);
|
||||
},
|
||||
},
|
||||
numberOfDependents: {
|
||||
get() {
|
||||
return this.$store.state.numberOfDependents;
|
||||
},
|
||||
set(value) {
|
||||
this.$store.commit("setNumberOfDependents", value);
|
||||
},
|
||||
},
|
||||
numberOfDependentsWithDisabilities: {
|
||||
get() {
|
||||
return this.$store.state.numberOfDependentsWithDisabilities;
|
||||
},
|
||||
set(value) {
|
||||
this.$store.commit(
|
||||
"setNumberOfDependentsWithDisabilities",
|
||||
value,
|
||||
);
|
||||
},
|
||||
},
|
||||
startDate: {
|
||||
get() {
|
||||
return this.$store.state.startDate;
|
||||
// return [
|
||||
// this.$store.state.startDate.getFullYear(),
|
||||
// (this.$store.state.startDate.getMonth() + 1).toString().padStart(2, '0'),
|
||||
// this.$store.state.startDate.getDate().toString().padStart(2, '0')
|
||||
// ].join('-');
|
||||
},
|
||||
set(value) {
|
||||
// let
|
||||
// [year, month, day] = value.split('-'),
|
||||
// dValue = new Date(year, month-1, day);
|
||||
|
||||
this.$store.dispatch("setStartDate", value);
|
||||
},
|
||||
this.$store.dispatch("setStartDate", value);
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@@ -1,116 +1,130 @@
|
||||
<template>
|
||||
<h2 class="mt-4">
|
||||
{{ $t("household_members_editor.household_part") }}
|
||||
</h2>
|
||||
<h2 class="mt-4">
|
||||
{{ $t("household_members_editor.household_part") }}
|
||||
</h2>
|
||||
|
||||
<div class="alert alert-info" v-if="!hasHousehold">
|
||||
{{ $t("household_members_editor.household.no_household_choose_one") }}
|
||||
</div>
|
||||
<template v-else>
|
||||
<current-household />
|
||||
</template>
|
||||
|
||||
<div v-if="hasHouseholdSuggestion" class="householdSuggestions my-5">
|
||||
<h4 class="mb-3">
|
||||
{{ $t("household_members_editor.household.household_suggested") }}
|
||||
</h4>
|
||||
<p>
|
||||
{{
|
||||
$t("household_members_editor.household.household_suggested_explanation")
|
||||
}}
|
||||
</p>
|
||||
<div class="accordion" id="householdSuggestions">
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="heading_household_suggestions">
|
||||
<button
|
||||
v-if="!showHouseholdSuggestion"
|
||||
class="accordion-button collapsed"
|
||||
type="button"
|
||||
data-bs-toggle="collapse"
|
||||
aria-expanded="false"
|
||||
@click="toggleHouseholdSuggestion"
|
||||
>
|
||||
{{
|
||||
$tc(
|
||||
"household_members_editor.show_household_suggestion",
|
||||
countHouseholdSuggestion,
|
||||
)
|
||||
}}
|
||||
</button>
|
||||
<button
|
||||
v-if="showHouseholdSuggestion"
|
||||
class="accordion-button"
|
||||
type="button"
|
||||
data-bs-toggle="collapse"
|
||||
aria-expanded="true"
|
||||
@click="toggleHouseholdSuggestion"
|
||||
>
|
||||
{{ $t("household_members_editor.hide_household_suggestion") }}
|
||||
</button>
|
||||
<!-- disabled bootstrap behaviour: data-bs-target="#collapse_household_suggestions" aria-controls="collapse_household_suggestions" -->
|
||||
</h2>
|
||||
<div
|
||||
class="accordion-collapse"
|
||||
id="collapse_household_suggestions"
|
||||
aria-labelledby="heading_household_suggestions"
|
||||
data-bs-parent="#householdSuggestions"
|
||||
>
|
||||
<div v-if="showHouseholdSuggestion">
|
||||
<div class="flex-table householdSuggestionList">
|
||||
<div
|
||||
v-for="(s, i) in getSuggestions"
|
||||
class="item-bloc"
|
||||
:key="`householdSuggestions-${i}`"
|
||||
>
|
||||
<household-render-box :household="s.household" />
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-sm btn-choose"
|
||||
@click="selectHousehold(s.household)"
|
||||
>
|
||||
{{ $t("household_members_editor.select_household") }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="alert alert-info" v-if="!hasHousehold">
|
||||
{{ $t("household_members_editor.household.no_household_choose_one") }}
|
||||
</div>
|
||||
</div>
|
||||
<template v-else>
|
||||
<current-household />
|
||||
</template>
|
||||
|
||||
<ul class="record_actions">
|
||||
<li v-if="hasHousehold">
|
||||
<button @click="resetMode" class="btn btn-sm btn-misc">
|
||||
{{ $t("household_members_editor.household.reset_mode") }}
|
||||
</button>
|
||||
</li>
|
||||
<li v-if="!hasHousehold" class="add-persons">
|
||||
<add-persons
|
||||
modal-title="Chercher un ménage existant"
|
||||
button-title="Chercher un ménage existant"
|
||||
:key="addPersons.key"
|
||||
:options="addPersons.options"
|
||||
@add-new-persons="pickHouseholdFound"
|
||||
ref="pickHousehold"
|
||||
>
|
||||
<!-- to cast child method -->
|
||||
</add-persons>
|
||||
</li>
|
||||
<li v-if="!hasHousehold">
|
||||
<button @click="setModeNew" class="btn btn-sm btn-create">
|
||||
{{ $t("household_members_editor.household.create_household") }}
|
||||
</button>
|
||||
</li>
|
||||
<li v-if="isModeLeaveAllowed && !hasHousehold">
|
||||
<button @click="setModeLeave" class="btn btn-sm btn-misc">
|
||||
<i class="fa fa-sign-out" />
|
||||
{{ $t("household_members_editor.household.leave") }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
<div v-if="hasHouseholdSuggestion" class="householdSuggestions my-5">
|
||||
<h4 class="mb-3">
|
||||
{{ $t("household_members_editor.household.household_suggested") }}
|
||||
</h4>
|
||||
<p>
|
||||
{{
|
||||
$t(
|
||||
"household_members_editor.household.household_suggested_explanation",
|
||||
)
|
||||
}}
|
||||
</p>
|
||||
<div class="accordion" id="householdSuggestions">
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="heading_household_suggestions">
|
||||
<button
|
||||
v-if="!showHouseholdSuggestion"
|
||||
class="accordion-button collapsed"
|
||||
type="button"
|
||||
data-bs-toggle="collapse"
|
||||
aria-expanded="false"
|
||||
@click="toggleHouseholdSuggestion"
|
||||
>
|
||||
{{
|
||||
$tc(
|
||||
"household_members_editor.show_household_suggestion",
|
||||
countHouseholdSuggestion,
|
||||
)
|
||||
}}
|
||||
</button>
|
||||
<button
|
||||
v-if="showHouseholdSuggestion"
|
||||
class="accordion-button"
|
||||
type="button"
|
||||
data-bs-toggle="collapse"
|
||||
aria-expanded="true"
|
||||
@click="toggleHouseholdSuggestion"
|
||||
>
|
||||
{{
|
||||
$t(
|
||||
"household_members_editor.hide_household_suggestion",
|
||||
)
|
||||
}}
|
||||
</button>
|
||||
<!-- disabled bootstrap behaviour: data-bs-target="#collapse_household_suggestions" aria-controls="collapse_household_suggestions" -->
|
||||
</h2>
|
||||
<div
|
||||
class="accordion-collapse"
|
||||
id="collapse_household_suggestions"
|
||||
aria-labelledby="heading_household_suggestions"
|
||||
data-bs-parent="#householdSuggestions"
|
||||
>
|
||||
<div v-if="showHouseholdSuggestion">
|
||||
<div class="flex-table householdSuggestionList">
|
||||
<div
|
||||
v-for="(s, i) in getSuggestions"
|
||||
class="item-bloc"
|
||||
:key="`householdSuggestions-${i}`"
|
||||
>
|
||||
<household-render-box
|
||||
:household="s.household"
|
||||
/>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-sm btn-choose"
|
||||
@click="
|
||||
selectHousehold(s.household)
|
||||
"
|
||||
>
|
||||
{{
|
||||
$t(
|
||||
"household_members_editor.select_household",
|
||||
)
|
||||
}}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul class="record_actions">
|
||||
<li v-if="hasHousehold">
|
||||
<button @click="resetMode" class="btn btn-sm btn-misc">
|
||||
{{ $t("household_members_editor.household.reset_mode") }}
|
||||
</button>
|
||||
</li>
|
||||
<li v-if="!hasHousehold" class="add-persons">
|
||||
<add-persons
|
||||
modal-title="Chercher un ménage existant"
|
||||
button-title="Chercher un ménage existant"
|
||||
:key="addPersons.key"
|
||||
:options="addPersons.options"
|
||||
@add-new-persons="pickHouseholdFound"
|
||||
ref="pickHousehold"
|
||||
>
|
||||
<!-- to cast child method -->
|
||||
</add-persons>
|
||||
</li>
|
||||
<li v-if="!hasHousehold">
|
||||
<button @click="setModeNew" class="btn btn-sm btn-create">
|
||||
{{ $t("household_members_editor.household.create_household") }}
|
||||
</button>
|
||||
</li>
|
||||
<li v-if="isModeLeaveAllowed && !hasHousehold">
|
||||
<button @click="setModeLeave" class="btn btn-sm btn-misc">
|
||||
<i class="fa fa-sign-out" />
|
||||
{{ $t("household_members_editor.household.leave") }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -120,154 +134,156 @@ import CurrentHousehold from "./CurrentHousehold";
|
||||
import AddPersons from "ChillPersonAssets/vuejs/_components/AddPersons";
|
||||
|
||||
export default {
|
||||
name: "Household",
|
||||
components: {
|
||||
AddPersons,
|
||||
CurrentHousehold,
|
||||
HouseholdRenderBox,
|
||||
},
|
||||
emits: ["readyToGo"],
|
||||
data() {
|
||||
return {
|
||||
addPersons: {
|
||||
key: "household_find",
|
||||
options: {
|
||||
type: ["household"],
|
||||
priority: null,
|
||||
uniq: true,
|
||||
button: {
|
||||
size: "btn-sm",
|
||||
type: "btn-search",
|
||||
},
|
||||
},
|
||||
},
|
||||
addAddress: {
|
||||
key: "household_new",
|
||||
options: {
|
||||
useDate: {
|
||||
validFrom: false,
|
||||
validTo: false,
|
||||
},
|
||||
onlyButton: true,
|
||||
button: {
|
||||
text: {
|
||||
create: "household_members_editor.household.set_address",
|
||||
edit: "household_members_editor.household.update_address",
|
||||
name: "Household",
|
||||
components: {
|
||||
AddPersons,
|
||||
CurrentHousehold,
|
||||
HouseholdRenderBox,
|
||||
},
|
||||
emits: ["readyToGo"],
|
||||
data() {
|
||||
return {
|
||||
addPersons: {
|
||||
key: "household_find",
|
||||
options: {
|
||||
type: ["household"],
|
||||
priority: null,
|
||||
uniq: true,
|
||||
button: {
|
||||
size: "btn-sm",
|
||||
type: "btn-search",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
title: {
|
||||
create: "household_members_editor.household.create_new_address",
|
||||
edit: "household_members_editor.household.update_address_title",
|
||||
},
|
||||
addAddress: {
|
||||
key: "household_new",
|
||||
options: {
|
||||
useDate: {
|
||||
validFrom: false,
|
||||
validTo: false,
|
||||
},
|
||||
onlyButton: true,
|
||||
button: {
|
||||
text: {
|
||||
create: "household_members_editor.household.set_address",
|
||||
edit: "household_members_editor.household.update_address",
|
||||
},
|
||||
},
|
||||
title: {
|
||||
create: "household_members_editor.household.create_new_address",
|
||||
edit: "household_members_editor.household.update_address_title",
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
"isModeNewAllowed",
|
||||
"isModeLeaveAllowed",
|
||||
"getSuggestions",
|
||||
"hasHousehold",
|
||||
"isHouseholdNew",
|
||||
"hasHouseholdSuggestion",
|
||||
"countHouseholdSuggestion",
|
||||
"filterHouseholdSuggestionByAccompanyingPeriod",
|
||||
"hasAddressSuggestion",
|
||||
"countAddressSuggestion",
|
||||
"filterAddressesSuggestion",
|
||||
"hasHouseholdAddress",
|
||||
"isModeLeave",
|
||||
"getAddressContext",
|
||||
]),
|
||||
...mapState([
|
||||
"household",
|
||||
"showHouseholdSuggestion",
|
||||
"showAddressSuggestion",
|
||||
"mode",
|
||||
]),
|
||||
household() {
|
||||
return this.$store.state.household;
|
||||
},
|
||||
allowHouseholdSearch() {
|
||||
return false;
|
||||
return (
|
||||
this.$store.state.allowHouseholdSearch &&
|
||||
!this.$store.getters.hasHousehold
|
||||
);
|
||||
},
|
||||
isHouseholdNewDesactivated() {
|
||||
return (
|
||||
this.$store.state.mode !== null &&
|
||||
!this.$store.getters.isHouseholdNew
|
||||
);
|
||||
},
|
||||
isHouseholdLeaveDesactivated() {
|
||||
return (
|
||||
this.$store.state.mode !== null &&
|
||||
this.$store.state.mode !== "leave"
|
||||
);
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
"isModeNewAllowed",
|
||||
"isModeLeaveAllowed",
|
||||
"getSuggestions",
|
||||
"hasHousehold",
|
||||
"isHouseholdNew",
|
||||
"hasHouseholdSuggestion",
|
||||
"countHouseholdSuggestion",
|
||||
"filterHouseholdSuggestionByAccompanyingPeriod",
|
||||
"hasAddressSuggestion",
|
||||
"countAddressSuggestion",
|
||||
"filterAddressesSuggestion",
|
||||
"hasHouseholdAddress",
|
||||
"isModeLeave",
|
||||
"getAddressContext",
|
||||
]),
|
||||
...mapState([
|
||||
"household",
|
||||
"showHouseholdSuggestion",
|
||||
"showAddressSuggestion",
|
||||
"mode",
|
||||
]),
|
||||
household() {
|
||||
return this.$store.state.household;
|
||||
},
|
||||
allowHouseholdSearch() {
|
||||
return false;
|
||||
return (
|
||||
this.$store.state.allowHouseholdSearch &&
|
||||
!this.$store.getters.hasHousehold
|
||||
);
|
||||
methods: {
|
||||
setModeNew() {
|
||||
this.$store.dispatch("createHousehold");
|
||||
this.$emit("readyToGo");
|
||||
},
|
||||
setModeLeave() {
|
||||
this.$store.dispatch("forceLeaveWithoutHousehold");
|
||||
this.$emit("readyToGo");
|
||||
},
|
||||
resetMode() {
|
||||
this.$store.commit("resetMode");
|
||||
},
|
||||
addressChanged(payload) {
|
||||
console.log("addressChanged", payload);
|
||||
this.$store.dispatch("setHouseholdNewAddress", payload.address);
|
||||
},
|
||||
selectHousehold(h) {
|
||||
this.$store.dispatch("selectHousehold", h);
|
||||
this.$emit("readyToGo");
|
||||
},
|
||||
pickHouseholdFound({ selected, modal }) {
|
||||
selected.forEach(function (item) {
|
||||
this.selectHousehold(item.result);
|
||||
}, this);
|
||||
this.$refs.pickHousehold.resetSearch(); // to cast child method
|
||||
modal.showModal = false;
|
||||
},
|
||||
removeHouseholdAddress() {
|
||||
this.$store.commit("removeHouseholdAddress");
|
||||
},
|
||||
toggleHouseholdSuggestion() {
|
||||
this.$store.commit("toggleHouseholdSuggestion");
|
||||
},
|
||||
},
|
||||
isHouseholdNewDesactivated() {
|
||||
return (
|
||||
this.$store.state.mode !== null && !this.$store.getters.isHouseholdNew
|
||||
);
|
||||
},
|
||||
isHouseholdLeaveDesactivated() {
|
||||
return (
|
||||
this.$store.state.mode !== null && this.$store.state.mode !== "leave"
|
||||
);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
setModeNew() {
|
||||
this.$store.dispatch("createHousehold");
|
||||
this.$emit("readyToGo");
|
||||
},
|
||||
setModeLeave() {
|
||||
this.$store.dispatch("forceLeaveWithoutHousehold");
|
||||
this.$emit("readyToGo");
|
||||
},
|
||||
resetMode() {
|
||||
this.$store.commit("resetMode");
|
||||
},
|
||||
addressChanged(payload) {
|
||||
console.log("addressChanged", payload);
|
||||
this.$store.dispatch("setHouseholdNewAddress", payload.address);
|
||||
},
|
||||
selectHousehold(h) {
|
||||
this.$store.dispatch("selectHousehold", h);
|
||||
this.$emit("readyToGo");
|
||||
},
|
||||
pickHouseholdFound({ selected, modal }) {
|
||||
selected.forEach(function (item) {
|
||||
this.selectHousehold(item.result);
|
||||
}, this);
|
||||
this.$refs.pickHousehold.resetSearch(); // to cast child method
|
||||
modal.showModal = false;
|
||||
},
|
||||
removeHouseholdAddress() {
|
||||
this.$store.commit("removeHouseholdAddress");
|
||||
},
|
||||
toggleHouseholdSuggestion() {
|
||||
this.$store.commit("toggleHouseholdSuggestion");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.filtered {
|
||||
filter: grayscale(1) opacity(0.6);
|
||||
filter: grayscale(1) opacity(0.6);
|
||||
}
|
||||
|
||||
.filteredButActive {
|
||||
filter: grayscale(1) opacity(0.6);
|
||||
&:hover {
|
||||
filter: unset;
|
||||
}
|
||||
filter: grayscale(1) opacity(0.6);
|
||||
&:hover {
|
||||
filter: unset;
|
||||
}
|
||||
}
|
||||
|
||||
div#household_members_editor div,
|
||||
div.householdSuggestionList {
|
||||
&.flex-table {
|
||||
margin: 0;
|
||||
div.item-bloc div.item-row div.item-col {
|
||||
&:first-child {
|
||||
width: 25%;
|
||||
}
|
||||
&:last-child {
|
||||
display: initial;
|
||||
}
|
||||
&.flex-table {
|
||||
margin: 0;
|
||||
div.item-bloc div.item-row div.item-col {
|
||||
&:first-child {
|
||||
width: 25%;
|
||||
}
|
||||
&:last-child {
|
||||
display: initial;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,26 +1,30 @@
|
||||
<template>
|
||||
<current-household />
|
||||
<current-household />
|
||||
|
||||
<ul class="record_actions">
|
||||
<!-- <li v-if="!hasHouseholdAddress && !isHouseholdForceAddress">
|
||||
<ul class="record_actions">
|
||||
<!-- <li v-if="!hasHouseholdAddress && !isHouseholdForceAddress">
|
||||
<button class="btn btn-misc" @click="markNoAddress">
|
||||
{{ $t('household_members_editor.household_address.mark_no_address') }}
|
||||
</button>
|
||||
</li> -->
|
||||
<li v-if="!hasHouseholdAddress">
|
||||
<add-address
|
||||
:context="getAddressContext"
|
||||
:key="addAddress.key"
|
||||
:options="addAddress.options"
|
||||
:address-changed-callback="addressChanged"
|
||||
/>
|
||||
</li>
|
||||
<li v-if="hasHouseholdAddress">
|
||||
<button class="btn btn-remove" @click="removeHouseholdAddress">
|
||||
{{ $t("household_members_editor.household_address.remove_address") }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
<li v-if="!hasHouseholdAddress">
|
||||
<add-address
|
||||
:context="getAddressContext"
|
||||
:key="addAddress.key"
|
||||
:options="addAddress.options"
|
||||
:address-changed-callback="addressChanged"
|
||||
/>
|
||||
</li>
|
||||
<li v-if="hasHouseholdAddress">
|
||||
<button class="btn btn-remove" @click="removeHouseholdAddress">
|
||||
{{
|
||||
$t(
|
||||
"household_members_editor.household_address.remove_address",
|
||||
)
|
||||
}}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -29,56 +33,55 @@ import CurrentHousehold from "./CurrentHousehold";
|
||||
import { mapGetters } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "HouseholdAddress.vue",
|
||||
components: {
|
||||
CurrentHousehold,
|
||||
AddAddress,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addAddress: {
|
||||
key: "household_new",
|
||||
options: {
|
||||
useDate: {
|
||||
validFrom: false,
|
||||
validTo: false,
|
||||
},
|
||||
onlyButton: true,
|
||||
button: {
|
||||
text: {
|
||||
create: "household_members_editor.household_address.set_address",
|
||||
edit: "household_members_editor.household_address.update_address",
|
||||
name: "HouseholdAddress.vue",
|
||||
components: {
|
||||
CurrentHousehold,
|
||||
AddAddress,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addAddress: {
|
||||
key: "household_new",
|
||||
options: {
|
||||
useDate: {
|
||||
validFrom: false,
|
||||
validTo: false,
|
||||
},
|
||||
onlyButton: true,
|
||||
button: {
|
||||
text: {
|
||||
create: "household_members_editor.household_address.set_address",
|
||||
edit: "household_members_editor.household_address.update_address",
|
||||
},
|
||||
},
|
||||
title: {
|
||||
create: "household_members_editor.household_address.create_new_address",
|
||||
edit: "household_members_editor.household_address.update_address_title",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
title: {
|
||||
create:
|
||||
"household_members_editor.household_address.create_new_address",
|
||||
edit: "household_members_editor.household_address.update_address_title",
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
"isHouseholdNew",
|
||||
"hasHouseholdAddress",
|
||||
"getAddressContext",
|
||||
"isHouseholdForceNoAddress",
|
||||
]),
|
||||
},
|
||||
methods: {
|
||||
addressChanged(payload) {
|
||||
console.log("addressChanged", payload);
|
||||
this.$store.dispatch("setHouseholdNewAddress", payload.address);
|
||||
},
|
||||
markNoAddress() {
|
||||
this.$store.commit("markHouseholdNoAddress");
|
||||
},
|
||||
removeHouseholdAddress() {
|
||||
this.$store.commit("removeHouseholdAddress");
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
"isHouseholdNew",
|
||||
"hasHouseholdAddress",
|
||||
"getAddressContext",
|
||||
"isHouseholdForceNoAddress",
|
||||
]),
|
||||
},
|
||||
methods: {
|
||||
addressChanged(payload) {
|
||||
console.log("addressChanged", payload);
|
||||
this.$store.dispatch("setHouseholdNewAddress", payload.address);
|
||||
},
|
||||
markNoAddress() {
|
||||
this.$store.commit("markHouseholdNoAddress");
|
||||
},
|
||||
removeHouseholdAddress() {
|
||||
this.$store.commit("removeHouseholdAddress");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@@ -1,97 +1,104 @@
|
||||
<template>
|
||||
<div class="item-bloc">
|
||||
<div class="item-row">
|
||||
<div class="item-col">
|
||||
<div>
|
||||
<person-render-box
|
||||
render="badge"
|
||||
:options="{}"
|
||||
:person="conc.person"
|
||||
/>
|
||||
<span v-if="isHolder" class="badge bg-primary holder">
|
||||
{{ $t("household_members_editor.holder") }}
|
||||
</span>
|
||||
<div class="item-bloc">
|
||||
<div class="item-row">
|
||||
<div class="item-col">
|
||||
<div>
|
||||
<person-render-box
|
||||
render="badge"
|
||||
:options="{}"
|
||||
:person="conc.person"
|
||||
/>
|
||||
<span v-if="isHolder" class="badge bg-primary holder">
|
||||
{{ $t("household_members_editor.holder") }}
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="conc.person.birthdate !== null">
|
||||
{{
|
||||
$t("person.born", {
|
||||
gender: conc.person.gender.genderTranslation,
|
||||
})
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-col">
|
||||
<ul class="list-content fa-ul">
|
||||
<li>
|
||||
<i class="fa fa-li fa-map-marker" />
|
||||
<span class="chill-no-data-statement"
|
||||
>Sans adresse</span
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="conc.person.birthdate !== null">
|
||||
{{
|
||||
$t("person.born", { gender: conc.person.gender.genderTranslation })
|
||||
}}
|
||||
|
||||
<div class="item-row comment">
|
||||
<comment-editor v-model="comment" />
|
||||
</div>
|
||||
|
||||
<div class="item-row participation-details">
|
||||
<div v-if="conc.position.allowHolder" class="action">
|
||||
<button
|
||||
class="btn"
|
||||
:class="{
|
||||
'btn-primary': isHolder,
|
||||
'btn-secondary': !isHolder,
|
||||
}"
|
||||
@click="toggleHolder"
|
||||
>
|
||||
{{
|
||||
$t(
|
||||
isHolder
|
||||
? "household_members_editor.is_holder"
|
||||
: "household_members_editor.is_not_holder",
|
||||
)
|
||||
}}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button @click="removePosition" class="btn btn-outline-primary">
|
||||
{{
|
||||
$t("household_members_editor.remove_position", {
|
||||
position: conc.position.label.fr,
|
||||
})
|
||||
}}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button
|
||||
v-if="conc.allowRemove"
|
||||
@click="removeConcerned"
|
||||
class="btn btn-primary"
|
||||
>
|
||||
{{ $t("household_members_editor.remove_concerned") }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-col">
|
||||
<ul class="list-content fa-ul">
|
||||
<li>
|
||||
<i class="fa fa-li fa-map-marker" />
|
||||
<span class="chill-no-data-statement">Sans adresse</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item-row comment">
|
||||
<comment-editor v-model="comment" />
|
||||
</div>
|
||||
|
||||
<div class="item-row participation-details">
|
||||
<div v-if="conc.position.allowHolder" class="action">
|
||||
<button
|
||||
class="btn"
|
||||
:class="{ 'btn-primary': isHolder, 'btn-secondary': !isHolder }"
|
||||
@click="toggleHolder"
|
||||
>
|
||||
{{
|
||||
$t(
|
||||
isHolder
|
||||
? "household_members_editor.is_holder"
|
||||
: "household_members_editor.is_not_holder",
|
||||
)
|
||||
}}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button @click="removePosition" class="btn btn-outline-primary">
|
||||
{{
|
||||
$t("household_members_editor.remove_position", {
|
||||
position: conc.position.label.fr,
|
||||
})
|
||||
}}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button
|
||||
v-if="conc.allowRemove"
|
||||
@click="removeConcerned"
|
||||
class="btn btn-primary"
|
||||
>
|
||||
{{ $t("household_members_editor.remove_concerned") }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.drag-icon {
|
||||
height: 1.1em;
|
||||
margin-right: 0.5em;
|
||||
height: 1.1em;
|
||||
margin-right: 0.5em;
|
||||
}
|
||||
div.participation-details {
|
||||
display: flex;
|
||||
flex-direction: row !important;
|
||||
justify-content: flex-end;
|
||||
display: flex;
|
||||
flex-direction: row !important;
|
||||
justify-content: flex-end;
|
||||
|
||||
.action {
|
||||
align-self: flex-start;
|
||||
margin-right: auto;
|
||||
}
|
||||
.action {
|
||||
align-self: flex-start;
|
||||
margin-right: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.holder {
|
||||
display: inline;
|
||||
vertical-align: super;
|
||||
font-size: 0.6em;
|
||||
display: inline;
|
||||
vertical-align: super;
|
||||
font-size: 0.6em;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -101,41 +108,44 @@ import PersonRenderBox from "ChillPersonAssets/vuejs/_components/Entity/PersonRe
|
||||
import CommentEditor from "ChillMainAssets/vuejs/_components/CommentEditor/CommentEditor.vue";
|
||||
|
||||
export default {
|
||||
name: "MemberDetails",
|
||||
components: {
|
||||
PersonRenderBox,
|
||||
CommentEditor,
|
||||
},
|
||||
props: ["conc"],
|
||||
computed: {
|
||||
...mapGetters(["concByPersonId"]),
|
||||
classicEditor: () => ClassicEditor,
|
||||
editorConfig: () => classicEditorConfig,
|
||||
isHolder() {
|
||||
return this.conc.holder;
|
||||
name: "MemberDetails",
|
||||
components: {
|
||||
PersonRenderBox,
|
||||
CommentEditor,
|
||||
},
|
||||
comment: {
|
||||
get() {
|
||||
return this.conc.comment;
|
||||
},
|
||||
set(text) {
|
||||
console.log("set comment");
|
||||
console.log("comment", text);
|
||||
props: ["conc"],
|
||||
computed: {
|
||||
...mapGetters(["concByPersonId"]),
|
||||
classicEditor: () => ClassicEditor,
|
||||
editorConfig: () => classicEditorConfig,
|
||||
isHolder() {
|
||||
return this.conc.holder;
|
||||
},
|
||||
comment: {
|
||||
get() {
|
||||
return this.conc.comment;
|
||||
},
|
||||
set(text) {
|
||||
console.log("set comment");
|
||||
console.log("comment", text);
|
||||
|
||||
this.$store.dispatch("setComment", { conc: this.conc, comment: text });
|
||||
},
|
||||
this.$store.dispatch("setComment", {
|
||||
conc: this.conc,
|
||||
comment: text,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
toggleHolder() {
|
||||
this.$store.dispatch("toggleHolder", this.conc);
|
||||
methods: {
|
||||
toggleHolder() {
|
||||
this.$store.dispatch("toggleHolder", this.conc);
|
||||
},
|
||||
removePosition() {
|
||||
this.$store.dispatch("removePosition", this.conc);
|
||||
},
|
||||
removeConcerned() {
|
||||
this.$store.dispatch("removeConcerned", this.conc);
|
||||
},
|
||||
},
|
||||
removePosition() {
|
||||
this.$store.dispatch("removePosition", this.conc);
|
||||
},
|
||||
removeConcerned() {
|
||||
this.$store.dispatch("removeConcerned", this.conc);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@@ -1,30 +1,30 @@
|
||||
<template>
|
||||
<comment-editor v-model="content" />
|
||||
<comment-editor v-model="content" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CommentEditor from "ChillMainAssets/vuejs/_components/CommentEditor/CommentEditor.vue";
|
||||
|
||||
export default {
|
||||
name: "PersonComment.vue",
|
||||
components: {
|
||||
CommentEditor,
|
||||
},
|
||||
props: ["conc"],
|
||||
computed: {
|
||||
content: {
|
||||
get() {
|
||||
return this.$props.conc.comment || "";
|
||||
},
|
||||
set(value) {
|
||||
console.log("set content", value);
|
||||
this.$store.commit("setComment", {
|
||||
conc: this.$props.conc,
|
||||
comment: value,
|
||||
});
|
||||
},
|
||||
name: "PersonComment.vue",
|
||||
components: {
|
||||
CommentEditor,
|
||||
},
|
||||
props: ["conc"],
|
||||
computed: {
|
||||
content: {
|
||||
get() {
|
||||
return this.$props.conc.comment || "";
|
||||
},
|
||||
set(value) {
|
||||
console.log("set content", value);
|
||||
this.$store.commit("setComment", {
|
||||
conc: this.$props.conc,
|
||||
comment: value,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@@ -1,55 +1,57 @@
|
||||
<template>
|
||||
<current-household />
|
||||
<current-household />
|
||||
|
||||
<h2>
|
||||
{{ $t("household_members_editor.positioning.persons_to_positionnate") }}
|
||||
</h2>
|
||||
<h2>
|
||||
{{ $t("household_members_editor.positioning.persons_to_positionnate") }}
|
||||
</h2>
|
||||
|
||||
<div class="list-household-members flex-table">
|
||||
<div v-for="conc in concerned" class="item-bloc" :key="conc.person.id">
|
||||
<div class="pick-position item-row">
|
||||
<div class="person">
|
||||
<!-- <h3>{{ conc.person.text }}</h3> -->
|
||||
<h3><person-text :person="conc.person" /></h3>
|
||||
<div class="list-household-members flex-table">
|
||||
<div v-for="conc in concerned" class="item-bloc" :key="conc.person.id">
|
||||
<div class="pick-position item-row">
|
||||
<div class="person">
|
||||
<!-- <h3>{{ conc.person.text }}</h3> -->
|
||||
<h3><person-text :person="conc.person" /></h3>
|
||||
</div>
|
||||
<div class="holder">
|
||||
<button
|
||||
class="btn"
|
||||
:disabled="!allowHolderForConcerned(conc)"
|
||||
:class="{
|
||||
'btn-outline-chill-green': !conc.holder,
|
||||
'btn-chill-green': conc.holder,
|
||||
}"
|
||||
@click="toggleHolder(conc)"
|
||||
>
|
||||
{{ $t("household_members_editor.positioning.holder") }}
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
v-for="(position, i) in positions"
|
||||
:key="`position-${i}`"
|
||||
class="position"
|
||||
>
|
||||
<button
|
||||
class="btn"
|
||||
:class="{
|
||||
'btn-primary': conc.position === position,
|
||||
'btn-outline-primary': conc.position !== position,
|
||||
}"
|
||||
@click="moveToPosition(conc.person.id, position.id)"
|
||||
>
|
||||
{{ localizeString(position.label) }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-row">
|
||||
<div class="col-12">
|
||||
<h6>
|
||||
{{ $t("household_members_editor.positioning.comment") }}
|
||||
</h6>
|
||||
<person-comment :conc="conc" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="holder">
|
||||
<button
|
||||
class="btn"
|
||||
:disabled="!allowHolderForConcerned(conc)"
|
||||
:class="{
|
||||
'btn-outline-chill-green': !conc.holder,
|
||||
'btn-chill-green': conc.holder,
|
||||
}"
|
||||
@click="toggleHolder(conc)"
|
||||
>
|
||||
{{ $t("household_members_editor.positioning.holder") }}
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
v-for="(position, i) in positions"
|
||||
:key="`position-${i}`"
|
||||
class="position"
|
||||
>
|
||||
<button
|
||||
class="btn"
|
||||
:class="{
|
||||
'btn-primary': conc.position === position,
|
||||
'btn-outline-primary': conc.position !== position,
|
||||
}"
|
||||
@click="moveToPosition(conc.person.id, position.id)"
|
||||
>
|
||||
{{ localizeString(position.label) }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-row">
|
||||
<div class="col-12">
|
||||
<h6>{{ $t("household_members_editor.positioning.comment") }}</h6>
|
||||
<person-comment :conc="conc" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -60,61 +62,61 @@ import PersonText from "../../_components/Entity/PersonText.vue";
|
||||
import { localizeString } from "ChillMainAssets/lib/localizationHelper/localizationHelper";
|
||||
|
||||
export default {
|
||||
name: "Positioning",
|
||||
components: {
|
||||
CurrentHousehold,
|
||||
PersonComment,
|
||||
PersonText,
|
||||
},
|
||||
computed: {
|
||||
...mapState(["concerned"]),
|
||||
...mapGetters([
|
||||
"persons",
|
||||
"concUnpositionned",
|
||||
"positions",
|
||||
"concByPosition",
|
||||
]),
|
||||
allPersonsPositionnated() {
|
||||
return (
|
||||
this.$store.getters.persons.length > 0 &&
|
||||
this.$store.getters.concUnpositionned.length === 0
|
||||
);
|
||||
name: "Positioning",
|
||||
components: {
|
||||
CurrentHousehold,
|
||||
PersonComment,
|
||||
PersonText,
|
||||
},
|
||||
allowHolderForConcerned: () => (conc) => {
|
||||
console.log("allow holder for concerned", conc);
|
||||
if (conc.position === null) {
|
||||
return false;
|
||||
}
|
||||
computed: {
|
||||
...mapState(["concerned"]),
|
||||
...mapGetters([
|
||||
"persons",
|
||||
"concUnpositionned",
|
||||
"positions",
|
||||
"concByPosition",
|
||||
]),
|
||||
allPersonsPositionnated() {
|
||||
return (
|
||||
this.$store.getters.persons.length > 0 &&
|
||||
this.$store.getters.concUnpositionned.length === 0
|
||||
);
|
||||
},
|
||||
allowHolderForConcerned: () => (conc) => {
|
||||
console.log("allow holder for concerned", conc);
|
||||
if (conc.position === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return conc.position.allowHolder;
|
||||
return conc.position.allowHolder;
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
localizeString,
|
||||
moveToPosition(person_id, position_id) {
|
||||
this.$store.dispatch("markPosition", { person_id, position_id });
|
||||
methods: {
|
||||
localizeString,
|
||||
moveToPosition(person_id, position_id) {
|
||||
this.$store.dispatch("markPosition", { person_id, position_id });
|
||||
},
|
||||
toggleHolder(conc) {
|
||||
console.log("toggle holder", conc);
|
||||
this.$store.dispatch("toggleHolder", conc);
|
||||
},
|
||||
},
|
||||
toggleHolder(conc) {
|
||||
console.log("toggle holder", conc);
|
||||
this.$store.dispatch("toggleHolder", conc);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.pick-position {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
|
||||
.person {
|
||||
margin-right: auto;
|
||||
}
|
||||
.holder {
|
||||
margin-right: 1.2rem;
|
||||
}
|
||||
.person {
|
||||
margin-right: auto;
|
||||
}
|
||||
.holder {
|
||||
margin-right: 1.2rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
Reference in New Issue
Block a user