Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PStA WP2 OmarElkadi1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Omar Elkadi
PStA WP2 OmarElkadi1
Commits
a1b98a3d
Commit
a1b98a3d
authored
3 years ago
by
Omar Elkadi
Browse files
Options
Downloads
Patches
Plain Diff
udate sick form comments and object struction
parent
420efe85
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/views/SickForm.vue
+17
-15
17 additions, 15 deletions
src/views/SickForm.vue
with
17 additions
and
15 deletions
src/views/SickForm.vue
+
17
−
15
View file @
a1b98a3d
...
...
@@ -5,8 +5,9 @@
enctype=
"multipart/form-data"
>
<div
class=
"row"
>
<!-- 1st col of inputs -->
<div
class=
"col-md-8"
>
<!--1. name-->
<!--1.
row ->
name-->
<div
class=
"form-row"
>
<div
class=
"form-group col-md-5 col-sm-12 col-sm-12"
>
<input
...
...
@@ -39,7 +40,7 @@
/>
</div>
</div>
<!--2. Email && phonenumber -->
<!--2.
row ->
Email && phonenumber -->
<div
class=
"form-row"
>
<div
class=
"form-group col-md-6 col-sm-12"
>
<input
...
...
@@ -62,7 +63,7 @@
/>
</div>
</div>
<!--3. Adress street haus num -->
<!--3.
row ->
Adress street haus num -->
<div
class=
"form-row"
>
<div
class=
"form-group col-md-9"
>
<input
...
...
@@ -85,7 +86,7 @@
/>
</div>
</div>
<!-- 4. Adress city + country-->
<!-- 4.
row ->
Adress city + country-->
<div
class=
"form-row"
>
<div
class=
"form-group col-md-2"
>
<input
type=
"text"
class=
"form-control"
id=
"inputZip"
placeholder=
"Postleizahl"
v-model=
"patientStudent.Address.ZIPcode"
required
/>
...
...
@@ -101,7 +102,7 @@
</select>
</div>
</div>
<!-- 5.date select and file upload -->
<!-- 5.
row ->
date select and file upload -->
<div
class=
"form-row"
>
<div
class=
"form-group col-md-4"
>
<label
for=
"date-input-start"
>
Startdatum
</label>
...
...
@@ -118,6 +119,7 @@
</div>
</div>
</div>
<!-- 2nd col of inputs -->
<div
class=
"col-md-4"
>
<div
class=
"form-row h-50 p-1"
>
<div
class=
"form-group col-md-12"
>
...
...
@@ -139,7 +141,7 @@
type=
"text-area"
class=
"form-control h-75"
id=
"mess"
v-model=
"Message"
v-model=
"
patientStudent.
Message"
required
>
</textarea>
...
...
@@ -172,14 +174,14 @@ export default {
City
:
''
,
ZIPcode
:
''
,
selectedCountry
:
'
Germany
'
}
},
Message
:
''
},
SickNote
:
{
diagnose
:
''
,
StartDate
:
new
Date
().
getDate
(),
EndDate
:
new
Date
().
getDate
()
},
Message
:
''
,
countries
:
[
{
name
:
'
Afghanistan
'
,
code
:
'
AF
'
},
...
...
@@ -439,18 +441,18 @@ export default {
const
sizeLimit
=
2000000
// 2 megabyte
const
fileExtension
=
file
.
name
.
split
(
'
.
'
).
pop
()
console
.
log
(
fileExtension
)
if
(
!
allowedExtentions
.
includes
(
fileExtension
))
{
// extention validation
if
(
!
allowedExtentions
.
includes
(
fileExtension
))
{
//
check
extention validation
this
.
$refs
.
file
.
value
=
null
// delete the file from selection
Swal
.
fire
({
Swal
.
fire
({
// rise up an Alret
title
:
'
Fehler!
'
,
text
:
'
Die Datei muss jpg, jpeg, png oder pdf
'
,
icon
:
'
error
'
,
confirmButtonColor
:
'
#1a4273
'
,
background
:
'
#dadada
'
})
}
else
if
(
file
.
size
>
sizeLimit
)
{
// size validation
}
else
if
(
file
.
size
>
sizeLimit
)
{
//
check
size validation
this
.
$refs
.
file
.
value
=
null
Swal
.
fire
({
Swal
.
fire
({
// rise up an Alret
title
:
'
Fehler!
'
,
text
:
'
Die Datei ist zu Groß
'
,
icon
:
'
error
'
,
...
...
@@ -476,8 +478,7 @@ export default {
// FormData is a dictionary type -> (key , value)
formData
.
append
(
'
patientStudent
'
,
JSON
.
stringify
(
this
.
patientStudent
))
formData
.
append
(
'
SickNote
'
,
JSON
.
stringify
(
this
.
SickNote
))
formData
.
append
(
'
Message
'
,
JSON
.
stringify
(
this
.
Message
))
// add file to the message body
// add file to the post request body
formData
.
append
(
'
sickNoteEvidence
'
,
this
.
EvidenceFile
)
// perform the post request
...
...
@@ -490,7 +491,7 @@ export default {
const
data
=
res
.
data
console
.
log
(
data
)
// trigger alert th
e
the form
i
s accepted
// trigger alert th
at
the form
wa
s accepted
Swal
.
fire
({
title
:
'
Gesandet!
'
,
text
:
'
Danke für Ihre Meldung
'
,
...
...
@@ -498,6 +499,7 @@ export default {
confirmButtonColor
:
'
#1a4273
'
,
background
:
'
#dadada
'
})
// reset the form
event
.
target
.
reset
()
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment