mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
display evaluations for action
This commit is contained in:
parent
9ac14ff5e3
commit
d0fa28db2a
@ -1,10 +1,57 @@
|
||||
<template>
|
||||
le formulaire d'ajout
|
||||
<div>
|
||||
<h3>
|
||||
{{ $t('evaluation_title') }}
|
||||
</h3>
|
||||
|
||||
|
||||
</div>
|
||||
<pre>
|
||||
{{ $t('evaluation_status') }}
|
||||
{{ $t('evaluation_choose_a_status') }}
|
||||
{{ $t('evaluation_startdate') }}
|
||||
{{ $t('evaluation_enddate') }}
|
||||
{{ $t('evaluation_maxdate') }}
|
||||
{{ $t('evaluation_warning_interval') }}
|
||||
{{ $t('evaluation_public_comment') }}
|
||||
{{ $t('evaluation_generate_a_document') }}
|
||||
{{ $t('evaluation_choose_a_template') }}
|
||||
{{ $t('evaluation_add_a_document') }}
|
||||
{{ $t('evaluation_add') }}
|
||||
</pre>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
const i18n = {
|
||||
messages: {
|
||||
fr: {
|
||||
evaluation_title: "Ecrire une évaluation",
|
||||
evaluation_status: "Statut",
|
||||
evaluation_choose_a_status: "Choisir un statut",
|
||||
evaluation_startdate: "Date d'ouverture",
|
||||
evaluation_enddate: "Date de fin",
|
||||
evaluation_maxdate: "Date d'échéance",
|
||||
evaluation_warning_interval: "Date de rappel",
|
||||
evaluation_public_comment: "Note publique",
|
||||
evaluation_generate_a_document: "Générer un document",
|
||||
evaluation_choose_a_template: "Choisir un gabarit",
|
||||
evaluation_add_a_document: "Ajouter un document",
|
||||
evaluation_add: "Ajouter"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default {
|
||||
name: "NewEvaluation",
|
||||
props: [],
|
||||
i18n,
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
@ -115,6 +115,10 @@ const store = createStore({
|
||||
state.resultsForGoal.push(r);
|
||||
}
|
||||
},
|
||||
setEvaluationsForAction(state, results) {
|
||||
console.log('set evaluations for action', results);
|
||||
state.evaluationsForAction = results;
|
||||
},
|
||||
addResultPicked(state, result) {
|
||||
state.resultsPicked.push(result);
|
||||
},
|
||||
@ -257,6 +261,24 @@ const store = createStore({
|
||||
commit('setResultsForAction', data.results);
|
||||
});
|
||||
},
|
||||
getReachablesEvaluationsForAction({ getters, commit }) {
|
||||
console.log('getReachablesEvaluationsForAction');
|
||||
let
|
||||
socialActionId = getters.socialAction.id,
|
||||
url = `/api/1.0/person/social-work/evaluation/by-social-action/${socialActionId}.json`
|
||||
;
|
||||
window.fetch(url)
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
}
|
||||
throw { m: 'Error while retriving evaluations for social action', s: response.status, b: response.body };
|
||||
})
|
||||
.then(data => {
|
||||
console.log('data retrived', data);
|
||||
commit('setEvaluationsForAction', data.results);
|
||||
});
|
||||
},
|
||||
submit({ getters, state, commit }) {
|
||||
let
|
||||
payload = getters.buildPayload,
|
||||
@ -300,6 +322,7 @@ const store = createStore({
|
||||
initAsync({ dispatch }) {
|
||||
dispatch('getReachablesResultsForAction');
|
||||
dispatch('getReachablesGoalsForAction');
|
||||
dispatch('getReachablesEvaluationsForAction');
|
||||
},
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user