mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix bug in saving evaluation dates
This commit is contained in:
parent
9a1f56a820
commit
9447516694
@ -87,7 +87,7 @@
|
||||
<!-- list evaluations -->
|
||||
<add-evaluation
|
||||
v-for="e in pickedEvaluations"
|
||||
v-bind:key="e.id"
|
||||
v-bind:key="e.key"
|
||||
v-bind:evaluation="e">
|
||||
</add-evaluation>
|
||||
|
||||
|
@ -8,13 +8,13 @@
|
||||
<dl class="item-details definition-inline">
|
||||
|
||||
<dt v-if="evaluation.startDate">{{ $t('startDate') }} :</dt>
|
||||
<dd v-if="evaluation.startDate">{{ $d(evaluation.startDate.datetime, 'short') }}</dd>
|
||||
<dd v-if="evaluation.startDate">{{ $d(evaluation.startDate, 'short') }}</dd>
|
||||
|
||||
<dt v-if="evaluation.endDate">{{ $t('endDate') }} :</dt>
|
||||
<dd v-if="evaluation.endDate">{{ $d(evaluation.endDate.datetime, 'short') }}</dd>
|
||||
<dd v-if="evaluation.endDate">{{ $d(evaluation.endDate, 'short') }}</dd>
|
||||
|
||||
<dt v-if="evaluation.maxDate">{{ $t('maxDate') }} :</dt>
|
||||
<dd v-if="evaluation.maxDate">{{ $d(evaluation.maxDate.datetime, 'short') }}</dd>
|
||||
<dd v-if="evaluation.maxDate">{{ $d(evaluation.maxDate, 'short') }}</dd>
|
||||
|
||||
<dt v-if="evaluation.warningInterval">{{ $t('warningInterval') }} :</dt>
|
||||
<dd v-if="evaluation.warningInterval">{{ evaluation.warningInterval }}</dd>
|
||||
@ -70,7 +70,7 @@ export default {
|
||||
components: {
|
||||
FormEvaluation
|
||||
},
|
||||
props: ['evaluation'],
|
||||
props: ['evaluation', 'editEvaluation'],
|
||||
i18n,
|
||||
data() {
|
||||
return {
|
||||
@ -91,7 +91,6 @@ export default {
|
||||
this.editEvaluation = !this.editEvaluation;
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs.FormEvaluation.saveEvaluation();
|
||||
this.toggleEditEvaluation();
|
||||
}
|
||||
}
|
||||
|
@ -139,37 +139,28 @@ export default {
|
||||
},
|
||||
*/
|
||||
startDate: {
|
||||
get() {
|
||||
if (this.evaluation.startDate) {
|
||||
return this.evaluation.startDate.datetime.split('T')[0];
|
||||
}
|
||||
return null;
|
||||
},
|
||||
set(v) {
|
||||
this.evaluation.startDate.datetime = `${v}T00:00:00+0100`;
|
||||
}
|
||||
get() {
|
||||
return dateToISO(this.evaluation.startDate);
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('setEvaluationStartDate', { key: this.evaluation.key, date: ISOToDate(v) });
|
||||
}
|
||||
},
|
||||
endDate: {
|
||||
get() {
|
||||
if (this.evaluation.endDate) {
|
||||
return this.evaluation.endDate.datetime.split('T')[0];
|
||||
}
|
||||
return null;
|
||||
},
|
||||
set(v) {
|
||||
this.evaluation.endDate.datetime = `${v}T00:00:00+0100`;
|
||||
}
|
||||
get() {
|
||||
return dateToISO(this.evaluation.endDate);
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('setEvaluationEndDate', { key: this.evaluation.key, date: ISOToDate(v) });
|
||||
}
|
||||
},
|
||||
maxDate: {
|
||||
get() {
|
||||
if (this.evaluation.maxDate) {
|
||||
return this.evaluation.maxDate.datetime.split('T')[0];
|
||||
}
|
||||
return null;
|
||||
},
|
||||
set(v) {
|
||||
this.evaluation.maxDate.datetime = `${v}T00:00:00+0100`;
|
||||
}
|
||||
get() {
|
||||
return dateToISO(this.evaluation.maxDate);
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('setEvaluationMaxDate', { key: this.evaluation.key, date: ISOToDate(v) });
|
||||
}
|
||||
},
|
||||
warningInterval: {
|
||||
get() { return this.evaluation.warningInterval; },
|
||||
@ -203,12 +194,6 @@ export default {
|
||||
})
|
||||
;
|
||||
},
|
||||
saveEvaluation() {
|
||||
console.log('save evaluation');
|
||||
|
||||
console.log('dispatch action: post/patch/put evaluation');
|
||||
console.log('commit mutation: update state.mutation');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
//this.listAllStatus();
|
||||
|
@ -165,7 +165,7 @@ const store = createStore({
|
||||
|
||||
found.results.push(result);
|
||||
},
|
||||
removeResultForGoalPicked(state, { goal, result}) {
|
||||
removeResultForGoalPicked(state, { goal, result }) {
|
||||
let found = state.goalsPicked.find(g => g.goal.id === goal.id);
|
||||
|
||||
if (found === undefined) {
|
||||
@ -177,14 +177,14 @@ const store = createStore({
|
||||
addEvaluation(state, evaluation) {
|
||||
let e = {
|
||||
type: "accompanying_period_work_evaluation",
|
||||
key: state.evaluationsPicked.length + 1,
|
||||
evaluation: evaluation,
|
||||
//startDate,
|
||||
//endDate,
|
||||
//maxDate,
|
||||
//warningInterval
|
||||
//comment,
|
||||
//documents,
|
||||
}
|
||||
"startDate": null,
|
||||
"endDate": null,
|
||||
"maxDate": null,
|
||||
"warningInterval": null,
|
||||
"comment": "",
|
||||
};
|
||||
state.evaluationsPicked.push(e);
|
||||
console.log('ep', state.evaluationsPicked);
|
||||
},
|
||||
@ -192,6 +192,18 @@ const store = createStore({
|
||||
state.evaluationsPicked = state.evaluationsPicked.filter(e => e.id !== evaluation.id);
|
||||
console.log('ep', state.evaluationsPicked);
|
||||
},
|
||||
setEvaluationStartDate(state, {key, date}) {
|
||||
state.evaluationsPicked.find(e => e.key == key)
|
||||
.startDate = date;
|
||||
},
|
||||
setEvaluationEndDate(state, {key, date}) {
|
||||
state.evaluationsPicked.find(e => e.key == key)
|
||||
.endDate = date;
|
||||
},
|
||||
setEvaluationMaxDate(state, {key, date}) {
|
||||
state.evaluationsPicked.find(e => e.key == key)
|
||||
.maxDate = date;
|
||||
},
|
||||
setPersonsPickedIds(state, ids) {
|
||||
//console.log('persons ids', ids);
|
||||
state.personsPicked = state.personsReachables
|
||||
|
Loading…
x
Reference in New Issue
Block a user