Commit ab9c46fc authored by David Foucher's avatar David Foucher

Merge branch 'new-simulator' into 'master'

New simulator

See merge request !45
parents 531eb5da 02b4b7dc
Pipeline #2879 passed with stage
in 1 minute and 28 seconds
<template>
<div id="Eligibilite">
<ul>
<li v-for="(props, id) in this.conditions" :key="id" :class="{passed: props.status, failed: !props.status}">
<span v-html="transformData(props.condition)"/>
<span v-if="props.children">
<eligibilite :conditions="props.children"/>
</span>
</li>
</ul>
</div>
</template>
<script>
import Eligibilite from './Eligibilite.vue';
export default {
name: 'Eligibilite',
props: ['conditions', 'schema'],
components: {
Eligibilite,
},
methods: {
transformData: function (data) {
return data
.replace(/Ou /g, '<span style="font-style: italic">&nbsp;Ou&nbsp; </span>')
.replace(/OU /g, '<span style="font-style: italic">&nbsp;OU&nbsp; </span>')
.replace(/, ou /g, '<span style="font-style: italic">&nbsp;, ou&nbsp; </span>')
.replace(/Et /g, '<span style="font-style: italic">&nbsp;Et&nbsp; </span>')
.replace(/ET /g, '<span style="font-style: italic">&nbsp;ET&nbsp; </span>')
.replace(/, et /g, '<span style="font-style: italic">&nbsp;, et&nbsp; </span>');
}
}
}
</script>
<style scoped>
.failed:before {
content: '✗';
color: crimson;
}
.passed:before {
content: '✔';
color: forestgreen;
}
li li {
padding-left: 1.5rem;
}
li ul, li.sub {
display: inline;
padding-left: 0;
}
.connective {
font-style: italic !important;
}
</style>
\ No newline at end of file
......@@ -8,625 +8,72 @@
</div>
</div>
<hr class="simulateur-horizontal-separator">
<!---------------- STEP ONE ---------------->
<!---------------- STEP FORMATION ---------------->
<div class="formation-step step" :class="{step_completed_class: formation_step_completed}">
<div class="row">
<div class="col-md-12">
<h4>Formation</h4>
</div>
</div>
<div class="row">
<div class="col-md-12">
<label for="id_formation">Identifiant de formation intercarif</label>
<input v-model="id_formation" v-on:keydown="formationNotExists=null; formation.numero=null" id="id_formation" type="text" value="" placeholder="identifiant intercarif" class="form-control" /><br>
<button class="btn main-button mr-5" v-on:click="searchCatalogue()">Chercher</button>
<strong v-if="formationNotExists===false">{{ intitule_formation }}</strong>
<span v-if="formationNotExists===true" style="color:red">Aucune formation trouvée pour l'identifiant renseigné</span><br>
</div>
</div>
<SimulateurStepFormation/>
</div>
<hr v-if="formation_step_completed" class="simulateur-horizontal-separator">
<!---------------- STEP ONE ---------------->
<div v-if="formation_step_completed" class="form-step step-one" :class="{step_completed_class: step_one_completed}">
<div class="row">
<div class="col-md-12">
<h4>Situation</h4>
</div>
</div>
<div class="row">
<div class="col-md-12 form-check">
<input v-model="situation_inscrit" name="situation_inscrit" id="situation_inscrit1" type="radio" value="1" class="form-check-input"/>
<label for="situation_inscrit1" class="form-check-label">Vous êtes inscrit(e) comme demandeur d'emploi</label>
</div>
</div>
<div v-if="situation_inscrit==1">
<div class="row">
<div class="col-md-12 group-indent1">
<label for="situation_inscritcumuldureeinscriptionsur12mois">Depuis combien de temps êtes-vous inscrit à Pôle Emploi ?</label>&nbsp;
<select v-model="situation_inscritcumuldureeinscriptionsur12mois" id="situation_inscritcumuldureeinscriptionsur12mois" class="form-control">
<option value="-" selected>-</option>
<option value="1">de 1 à 3 mois</option>
<option value="3">de 3 à 6 mois</option>
<option value="6">de 6 à 12 mois</option>
<option value="12">12 mois et plus</option>
</select>
</div>
</div>
<div class="row">
<div class="col-md-12 group-indent1">
<label for="allocation_type">Type d'allocation</label>&nbsp;
<select v-model="allocation_type" id="allocation_type" class="form-control">
<option value="-" selected>-</option>
<option value="non">Non indemnisé</option>
<option value="are">Allocation d'aide au Retour à l'Emploi (ARE)</option>
<option value="ass">Allocation de Solidarité Spécifique (ASS)</option>
<option value="rsa">Revenu de Solidarité Active (RSA)</option>
<option value="asr">Allocation Spécifique de Reclassement (ASR)</option>
<option value="atp">Allocation de Transition Professionnelle (ATP)</option>
<option value="asp">Allocation de Sécurisation Professionnelle (ASP)</option>
<option value="aex">Allocation ex-employeur secteur public</option>
</select>
</div>
</div>
</div>
<div v-if="allocation_type != 'non' && allocation_type != '-' && allocation_type != '' && situation_inscrit == 1">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-12 group-indent2">
<label for="allocation_dateend">Date de fin estimée de votre indemnisation</label>&nbsp;
<input v-model="allocation_dateend" id="allocation_dateend" type="text" value="" placeholder="JJ/MM/AAAA" pattern="^\d{1,2}/\d{1,2}/\d{4}$" class="date form-control" :class="{input_format_error: badFormatAllocation_dateend, input_format_valid: goodFormatAllocation_dateend}"/>
</div>
</div>
<div class="row">
<div class="col-md-12 group-indent2">
<label for="allocation_cost">Montant mensuel de votre allocation</label>&nbsp;
<input v-model="allocation_cost" id="allocation_cost" type="number" value="" placeholder="arrondi à l'€ net / mois" min="0" class="form-control"/>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 form-check">
<input v-model="situation_inscrit" name="situation_inscrit" id="situation_inscrit2" type="radio" value="2" required="required" class="form-check-input"/>&nbsp;
<label for="situation_inscrit2" class="form-check-label" >Vous êtes salarié(e) de droit privé</label>
</div>
</div>
<SimulateurStepOne id="SimulateurStepOne"/>
</div>
<hr v-if="step_one_completed" class="simulateur-horizontal-separator">
<!---------------- STEP TWO ---------------->
<div v-if="step_one_completed" class="form-step step-two" :class="{step_completed_class: step_two_completed}">
<div v-if="situation_inscrit == 2 && financement__accessible_salarie_formation == false">
<h5 style="color:red;">Seules les personnes inscrites comme « demandeur d'emploi » peuvent bénéficier d'une aide financière pour cette formation.</h5>
</div>
<div v-else>
<div class="row">
<div class="col-md-12">
<h4>Date de naissance</h4>
</div>
</div>
<div class="row">
<div class="col-md-12">
<input v-model="birthdate" name="birthdate" id="birthdate" type="text" title="Format : JJ/MM/AAAA" required="required" placeholder="JJ/MM/AAAA" class="date form-control" :class="{input_format_error: badFormatBirthdate, input_format_valid: goodFormatBirthdate}"/>
</div>
</div>
<div v-if="situation_inscrit == 1">
<div class="row">
<div class="col-md-12">