Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Trèfle
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Open source
Trèfle
Commits
5c3939ca
Commit
5c3939ca
authored
Jun 12, 2020
by
David Foucher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add possibility to make a simulatio from Labonneforamtion
parent
2d75e12f
Pipeline
#3412
passed with stage
in 1 minute and 25 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
11 deletions
+37
-11
backoffice/src/components/Simulateur.vue
backoffice/src/components/Simulateur.vue
+37
-11
No files found.
backoffice/src/components/Simulateur.vue
View file @
5c3939ca
...
...
@@ -43,7 +43,7 @@
</div>
</div>
</div>
<!------------------- RESULTATS --------------
-
>
<!------------------- 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>
...
...
@@ -63,7 +63,7 @@
import
SimulateurStepFive
from
'
./SimulateurStepFive
'
;
import
SimulateurResultats
from
'
./SimulateurResultats.vue
'
;
export
default
{
export
default
{
name
:
'
Simulateur
'
,
components
:
{
SimulateurResultats
,
...
...
@@ -74,8 +74,8 @@
SimulateurStepFour
,
SimulateurStepFive
,
},
data
:
function
()
{
return
{
data
:
function
()
{
return
{
// champs de formulaire
// step formation
id_formation
:
null
,
...
...
@@ -152,7 +152,8 @@
isLoading
:
true
,
test
:
[],
schema
:
{},
}
context
:
{},
}
},
computed
:
{
formation_step_completed
:
function
()
{
...
...
@@ -294,8 +295,9 @@
},
mounted
:
function
()
{
this
.
loadSchema
();
this
.
simulateFromUrl
();
},
methods
:
{
methods
:
{
loadSchema
:
function
()
{
fetch
(
'
/explore/schema
'
)
.
then
((
response
)
=>
response
.
json
())
...
...
@@ -303,8 +305,21 @@
this
.
schema
=
data
})
},
simulate
:
function
()
{
this
.
isLoading
=
true
;
simulateFromUrl
:
function
()
{
if
(
window
.
location
.
hash
.
substr
(
1
).
match
(
/^simulate/
))
var
simulate_link
=
window
.
location
.
hash
.
substr
(
9
)
if
(
simulate_link
.
includes
(
'
labonneformation
'
))
this
.
$http
.
get
(
'
/explore/decode-lbf-url?url=
'
+
simulate_link
)
.
then
(
response
=>
{
this
.
context
=
response
.
body
this
.
$http
.
get
(
'
/explore/catalog?id=
'
+
this
.
context
[
'
formation.numero
'
]).
then
(
response
=>
{
if
(
response
.
status
==
200
)
{
this
.
simulate
()
}
})
})
},
prepareRequest
:
function
()
{
if
(
this
.
situation_inscrit
==
1
)
{
if
(
this
.
allocation_type
==
'
non
'
)
{
this
.
allocation_type
=
null
;
...
...
@@ -346,8 +361,19 @@
}
if
(
this
.
situation_cpfconnu
!=
'
cpfconnu
'
)
this
.
situation_creditheurescpf
=
null
;
},
simulate
:
function
()
{
this
.
isLoading
=
true
;
this
.
$http
.
post
(
'
/financement?context=1&explain=true&scenario=1
'
,
this
.
request
).
then
(
response
=>
{
var
context
=
null
;
if
(
this
.
context
)
{
context
=
this
.
context
}
else
{
this
.
prepareRequest
()
context
=
this
.
request
}
this
.
$http
.
post
(
'
/financement?context=1&explain=true&scenario=1
'
,
context
).
then
(
response
=>
{
if
(
this
.
objectIsEmpty
(
response
.
body
)
==
false
)
{
for
(
var
i
=
0
;
i
<
response
.
body
.
financements
.
length
-
1
;
i
++
)
{
if
(
this
.
situation_cpfconnu
==
'
cpfempty
'
)
{
...
...
@@ -374,8 +400,8 @@
}
return
true
;
},
}
}
}
}
</
script
>
<
style
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment