Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Tia-dev
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dida Adams Arizona
Tia-dev
Commits
42ba2cac
Commit
42ba2cac
authored
Sep 02, 2020
by
faisalhamdi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
validasi parent company
parent
469afb6b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
8 deletions
+32
-8
CreatePerusahaan.js
src/container/MasterData/Perusahaan/CreatePerusahaan.js
+32
-8
No files found.
src/container/MasterData/Perusahaan/CreatePerusahaan.js
View file @
42ba2cac
...
...
@@ -249,6 +249,8 @@ export default class CreatePerusahaan extends Component {
validasiEdit
()
{
if
(
R
.
isEmpty
(
this
.
state
.
company
))
{
this
.
setState
({
errorNP
:
true
,
msgErrorNP
:
'Company Name Cannot be Empty.'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
getPerusahaan
))
{
this
.
setState
({
errorPC
:
true
,
msgErrorPC
:
'Parent Company Cannot be Empty.'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
getTypes
))
{
this
.
setState
({
errorUB
:
true
,
msgErrorUB
:
'Business Unit Cannot be Empty.'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
startDate
))
{
...
...
@@ -260,7 +262,8 @@ export default class CreatePerusahaan extends Component {
"company_id"
:
this
.
state
.
companyID
,
"company_name"
:
this
.
state
.
company
,
"business_unit_id"
:
this
.
state
.
getTypes
.
business_unit_id
,
"parent"
:
this
.
state
.
getPerusahaan
==
null
?
null
:
this
.
state
.
getPerusahaan
.
company_id
,
// "parent": this.state.getPerusahaan == null ? null : this.state.getPerusahaan.company_id,
"parent"
:
this
.
state
.
getPerusahaan
.
company_id
,
"start_date"
:
this
.
state
.
startDate
,
"end_date"
:
this
.
state
.
endDate
}
...
...
@@ -271,6 +274,8 @@ export default class CreatePerusahaan extends Component {
validasi
()
{
if
(
R
.
isEmpty
(
this
.
state
.
company
))
{
this
.
setState
({
errorNP
:
true
,
msgErrorNP
:
'Company Name Cannot be Empty.'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
getPerusahaan
))
{
this
.
setState
({
errorPC
:
true
,
msgErrorPC
:
'Parent Company Cannot be Empty.'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
getTypes
))
{
this
.
setState
({
errorUB
:
true
,
msgErrorUB
:
'Business Unit Cannot be Empty.'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
startDate
))
{
...
...
@@ -281,7 +286,8 @@ export default class CreatePerusahaan extends Component {
else
{
let
payload
=
{
"company_name"
:
this
.
state
.
company
,
"parent"
:
this
.
state
.
getPerusahaan
==
null
?
null
:
this
.
state
.
getPerusahaan
.
company_id
,
// "parent": this.state.getPerusahaan == null ? null : this.state.getPerusahaan.company_id,
"parent"
:
this
.
state
.
getPerusahaan
.
company_id
,
"business_unit_id"
:
this
.
state
.
getTypes
.
business_unit_id
,
"start_date"
:
this
.
state
.
startDate
,
"end_date"
:
this
.
state
.
endDate
...
...
@@ -448,12 +454,21 @@ export default class CreatePerusahaan extends Component {
<
/TextField
>
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Autocomplete
<
Autocomplete
{...
this
.
state
.
perusahaan
}
debug
id
=
"tipe"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
getPerusahaan
:
newInputValue
})}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
label
=
"Parent Company"
/>
}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
getPerusahaan
:
newInputValue
},
()
=>
this
.
clearError
())}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Parent Company"
error
=
{
this
.
state
.
errorPC
}
helperText
=
{
this
.
state
.
msgErrorPC
}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
/
>
}
value
=
{
this
.
state
.
getPerusahaan
}
/
>
<
/div
>
...
...
@@ -662,9 +677,18 @@ export default class CreatePerusahaan extends Component {
{...
this
.
state
.
perusahaan
}
debug
id
=
"tipe"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
getPerusahaan
:
newInputValue
})}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
label
=
"Parent Company"
/>
}
value
=
{
this
.
state
.
getPerusahaan
}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
getPerusahaan
:
newInputValue
},
()
=>
this
.
clearError
())}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Parent Company"
error
=
{
this
.
state
.
errorPC
}
helperText
=
{
this
.
state
.
msgErrorPC
}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
/
>
}
value
=
{
this
.
state
.
perusahaan
}
/
>
<
/div
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
...
...
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