Commit 3808e6ed authored by David Foucher's avatar David Foucher

Merge branch '26-pourvoir-modifier-les-informations-du-formulaire-de-simulation' into 'master'

Resolve "Pourvoir modifier les informations du formulaire de simulation"

Closes #26

See merge request !65
parents 58b8968d 6d0a8690
Pipeline #3448 passed with stage
in 3 minutes and 11 seconds
......@@ -38,7 +38,7 @@
<div class="row">
<div class="col-md-12 mt-5">
<div id="chart-container" class="text-center">
<ModificationChart width="1200" height="200" @on-receive="update" :values="modification_chart_datas.datasets" :labels="modification_chart_datas.labels"></ModificationChart>
<ModificationChart :width="1200" :height="200" @on-receive="update" :values="modification_chart_datas.datasets" :labels="modification_chart_datas.labels"></ModificationChart>
</div>
</div>
<div class="col-md-12">
......
......@@ -10,7 +10,7 @@
<hr class="simulateur-horizontal-separator">
<!---------------- STEP FORMATION ---------------->
<div class="formation-step step" :class="{step_completed_class: formation_step_completed}">
<SimulateurStepFormation/>
<SimulateurStepFormation :id_formation="formation.numero"/>
</div>
<hr v-if="formation_step_completed" class="simulateur-horizontal-separator">
<!---------------- STEP ONE ---------------->
......@@ -46,7 +46,7 @@
<!------------------- RESULTATS -------------->
<div v-if="resultats" id="simulate-results">
<div v-if="!isLoading" class="mt-5">
<SimulateurResultats :schema="schema" :financements="financements" :financements_eligibles="financements_eligibles" :scenario="scenario" :context="context"></SimulateurResultats>
<SimulateurResultats :schema="schema" :financements="financements" :financements_eligibles="financements_eligibles" :scenario="scenario" :context="context" :id_formation="formation.numero"></SimulateurResultats>
</div>
<div v-else class="text-center loading-gif">
<img src="./../assets/images/loading.gif" alt="loading...">
......@@ -256,8 +256,8 @@
inscrit_pe: this.situation_inscrit == 2 ? false : true,
solde_cpf: this.situation_creditheurescpf == '' ? 0 : this.situation_creditheurescpf,
remuneration: this.salaire == '' ? 0 : this.salaire,
allocation: this.allocation_cost == ''? 0 : this.allocation_cost,
type_allocation: this.allocation_type,
allocation: this.allocation_cost == '' ? 0 : this.allocation_cost,
type_allocation: this.allocation_type == 'non' ? null : this.allocation_type,
fin_allocation: this.allocation_dateend,
naissance: this.birthdate,
age: this.age_beneficiaire,
......@@ -365,15 +365,11 @@
simulate: function () {
this.isLoading = true;
var context = null;
if(this.context) {
context=this.context
} else {
if(!this.objectIsEmpty(this.context)) {
this.prepareRequest()
context=this.request
}
this.$http.post('/financement?context=1&explain=true&scenario=1', context).then(response => {
this.$http.post('/financement?context=1&explain=true&scenario=1', this.request).then(response => {
if(this.objectIsEmpty(response.body) == false) {
for(var i=0; i<response.body.financements.length-1; i++) {
if(this.situation_cpfconnu=='cpfempty') {
......
......@@ -5,7 +5,10 @@
<div class="col-md-12">
<h2>
Résultats de simulation de financement
<button v-on:click="newSimulation();" class="btn main-button-primary pull-right"><span class="mr-1">Nouvelle simulation</span><i class="ml-1 fas fa-redo"></i></button>
<div class="pull-right inline">
<button v-on:click="editSimulation();" class="btn main-button-primary mr-3"><span class="mr-1">Editer la simulation</span><i class="ml-1 fas fa-edit"></i></button>
<button v-on:click="newSimulation();" class="btn main-button-primary"><span class="mr-1">Nouvelle simulation</span><i class="ml-1 fas fa-redo"></i></button>
</div>
</h2>
</div>
</div>
......@@ -151,7 +154,7 @@
SimulateurExplain,
SimulateurContext
},
props: ['schema','financements', 'financements_eligibles', 'scenario', 'context', 'isLoading'],
props: ['schema','financements', 'financements_eligibles', 'scenario', 'context', 'isLoading', 'id_formation'],
data : function () {
return {
scenarioToggled:false,
......@@ -162,6 +165,11 @@
methods: {
newSimulation : function () {
location.reload();
},
editSimulation: function () {
this.$parent.resultats = false;
this.$parent.financements_eligibles = [];
this.$parent.formation.numero = this.id_formation;
}
}
......
......@@ -19,10 +19,9 @@
<script>
export default {
name: 'SimulateurStepFormation',
props:[],
props:["id_formation"],
data: function () {
return {
id_formation : null,
formationNotExists: null,
intitule_formation : null,
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment