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
b09cedb4
Commit
b09cedb4
authored
Sep 08, 2020
by
faisalhamdi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update kompeni
parent
8d4d3d4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
60 deletions
+69
-60
Perusahaan.js
src/container/MasterData/Perusahaan/Perusahaan.js
+69
-60
No files found.
src/container/MasterData/Perusahaan/Perusahaan.js
View file @
b09cedb4
...
@@ -71,11 +71,11 @@ export default class Perusahaan extends Component {
...
@@ -71,11 +71,11 @@ export default class Perusahaan extends Component {
if
(
item
.
length
>
0
)
{
if
(
item
.
length
>
0
)
{
payload
.
push
({
payload
.
push
({
"id"
:
index
+
1
,
"id"
:
index
+
1
,
"company_name"
:
item
[
0
],
"company_name"
:
item
[
0
]
===
undefined
?
""
:
item
[
0
]
,
"company_parent"
:
item
[
1
]
===
undefined
?
null
:
item
[
1
],
"company_parent"
:
item
[
1
]
===
undefined
?
""
:
item
[
1
],
"unit_bisnis"
:
item
[
2
],
"unit_bisnis"
:
item
[
2
]
===
undefined
?
""
:
item
[
2
]
,
"startDate"
:
item
[
3
],
"startDate"
:
item
[
3
]
===
undefined
?
""
:
item
[
3
]
,
"endDate"
:
item
[
4
],
"endDate"
:
item
[
4
]
===
undefined
?
""
:
item
[
4
]
,
})
})
}
}
})
})
...
@@ -111,16 +111,16 @@ export default class Perusahaan extends Component {
...
@@ -111,16 +111,16 @@ export default class Perusahaan extends Component {
options
:
{
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
let
check
=
null
if
(
tableMeta
.
rowData
[
6
]
!=
null
)
{
if
(
tableMeta
.
rowData
[
5
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
6
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'company_name'
))
check
=
tableMeta
.
rowData
[
5
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'company_name'
))
if
(
check
>
-
1
)
{
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
this
.
setState
({
buttonError
:
true
})
}
}
}
}
return
(
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
6
]
!=
null
&&
check
>
-
1
?
{
tableMeta
.
rowData
[
5
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
6
][
check
].
message
}
data
-
for
=
"company_name"
>
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
5
][
check
].
message
}
data
-
for
=
"company_name"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"Empty"
:
val
}
<
/span
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"Empty"
:
val
}
<
/span
>
<
/a>
:
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"Empty"
:
val
}
<
/span
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"Empty"
:
val
}
<
/span
>
...
@@ -136,16 +136,16 @@ export default class Perusahaan extends Component {
...
@@ -136,16 +136,16 @@ export default class Perusahaan extends Component {
options
:
{
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
let
check
=
null
if
(
tableMeta
.
rowData
[
6
]
!=
null
)
{
if
(
tableMeta
.
rowData
[
5
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
6
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'company_parent'
))
check
=
tableMeta
.
rowData
[
5
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'company_parent'
))
if
(
check
>
-
1
)
{
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
this
.
setState
({
buttonError
:
true
})
}
}
}
}
return
(
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
6
]
!=
null
&&
check
>
-
1
?
{
tableMeta
.
rowData
[
5
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
6
][
check
].
message
}
data
-
for
=
"company_parent"
>
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
5
][
check
].
message
}
data
-
for
=
"company_parent"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"Empty"
:
val
}
<
/span
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"Empty"
:
val
}
<
/span
>
<
/a>
:
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"Empty"
:
val
}
<
/span
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"Empty"
:
val
}
<
/span
>
...
@@ -161,16 +161,16 @@ export default class Perusahaan extends Component {
...
@@ -161,16 +161,16 @@ export default class Perusahaan extends Component {
options
:
{
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
let
check
=
null
if
(
tableMeta
.
rowData
[
6
]
!=
null
)
{
if
(
tableMeta
.
rowData
[
5
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
6
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'unit_bisnis'
))
check
=
tableMeta
.
rowData
[
5
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'unit_bisnis'
))
if
(
check
>
-
1
)
{
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
this
.
setState
({
buttonError
:
true
})
}
}
}
}
return
(
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
6
]
!=
null
&&
check
>
-
1
?
{
tableMeta
.
rowData
[
5
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
6
][
check
].
message
}
data
-
for
=
"unit_bisnis"
>
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
5
][
check
].
message
}
data
-
for
=
"unit_bisnis"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"Empty"
:
val
}
<
/span
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"Empty"
:
val
}
<
/span
>
<
/a>
:
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"Empty"
:
val
}
<
/span
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"Empty"
:
val
}
<
/span
>
...
@@ -186,16 +186,16 @@ export default class Perusahaan extends Component {
...
@@ -186,16 +186,16 @@ export default class Perusahaan extends Component {
options
:
{
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
let
check
=
null
if
(
tableMeta
.
rowData
[
6
]
!=
null
)
{
if
(
tableMeta
.
rowData
[
5
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
6
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'start_date'
))
check
=
tableMeta
.
rowData
[
5
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'start_date'
))
if
(
check
>
-
1
)
{
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
this
.
setState
({
buttonError
:
true
})
}
}
}
}
return
(
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
6
]
!=
null
&&
check
>
-
1
?
{
tableMeta
.
rowData
[
5
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
6
][
check
].
message
}
data
-
for
=
"startdate"
>
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
5
][
check
].
message
}
data
-
for
=
"startdate"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"Empty"
:
val
}
<
/span
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"Empty"
:
val
}
<
/span
>
<
/a>
:
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"Empty"
:
val
}
<
/span
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"Empty"
:
val
}
<
/span
>
...
@@ -211,16 +211,16 @@ export default class Perusahaan extends Component {
...
@@ -211,16 +211,16 @@ export default class Perusahaan extends Component {
options
:
{
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
let
check
=
null
if
(
tableMeta
.
rowData
[
6
]
!=
null
)
{
if
(
tableMeta
.
rowData
[
5
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
6
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'end_date'
))
check
=
tableMeta
.
rowData
[
5
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'end_date'
))
if
(
check
>
-
1
)
{
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
this
.
setState
({
buttonError
:
true
})
}
}
}
}
return
(
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
6
]
!=
null
&&
check
>
-
1
?
{
tableMeta
.
rowData
[
5
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
6
][
check
].
message
}
data
-
for
=
"enddate"
>
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
5
][
check
].
message
}
data
-
for
=
"enddate"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"Empty"
:
val
}
<
/span
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"Empty"
:
val
}
<
/span
>
<
/a>
:
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"Empty"
:
val
}
<
/span
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
===
""
?
"Empty"
:
val
}
<
/span
>
...
@@ -239,7 +239,7 @@ export default class Perusahaan extends Component {
...
@@ -239,7 +239,7 @@ export default class Perusahaan extends Component {
}
}
]
]
//
console.log(dataRow);
console
.
log
(
dataRow
);
this
.
setState
({
this
.
setState
({
dataLoaded
:
true
,
dataLoaded
:
true
,
cols
:
columns
,
cols
:
columns
,
...
@@ -525,40 +525,49 @@ export default class Perusahaan extends Component {
...
@@ -525,40 +525,49 @@ export default class Perusahaan extends Component {
sort
:
false
,
sort
:
false
,
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
this
.
state
.
edit
&&
(
{
this
.
state
.
edit
&&
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
button
<
a
data
-
tip
=
{
'Edit'
}
data
-
for
=
"edit"
>
style
=
{{
<
button
backgroundColor
:
'transparent'
,
style
=
{{
cursor
:
'pointer'
,
backgroundColor
:
'transparent'
,
borderColor
:
'transparent'
cursor
:
'pointer'
,
}}
borderColor
:
'transparent'
// onClick={() => this.setState({ visibleEdit: true, data: tableMeta.rowData })}
}}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'edit'
)}
// onClick={() => this.setState({ visibleEdit: true, data: tableMeta.rowData })}
>
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'edit'
)}
<
div
style
=
{{
display
:
'flex'
}}
>
>
{
!
tableMeta
.
rowData
[
2
].
includes
(
"TIA"
)
?
<
div
style
=
{{
display
:
'flex'
}}
>
<
img
src
=
{
Images
.
editCopy
}
/>
:
{
!
tableMeta
.
rowData
[
2
].
includes
(
"TIA"
)
?
null
<
img
src
=
{
Images
.
editCopy
}
/>
:
}
null
<
/div
>
}
<
/button
>
<
/div
>
)}
<
/button
>
{
this
.
state
.
edit
&&
(
<
/a
>
<
button
<
ReactTooltip
border
=
{
true
}
id
=
"edit"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
style
=
{{
<
a
data
-
tip
=
{
'Delete'
}
data
-
for
=
"delete"
>
backgroundColor
:
'transparent'
,
<
button
cursor
:
'pointer'
,
style
=
{{
borderColor
:
'transparent'
,
backgroundColor
:
'transparent'
,
marginLeft
:
10
cursor
:
'pointer'
,
}}
borderColor
:
'transparent'
,
// onClick={() => this.setState({ visibleEdit: true, data: tableMeta.rowData })}
marginLeft
:
10
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'delete'
)}
}}
>
// onClick={() => this.setState({ visibleEdit: true, data: tableMeta.rowData })}
<
img
src
=
{
Images
.
delete
}
/
>
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'delete'
)}
<
/button
>
>
)}
<
div
style
=
{{
display
:
'flex'
}}
>
<
/div
>
{
!
tableMeta
.
rowData
[
2
].
includes
(
"TIA"
)
?
<
img
src
=
{
Images
.
delete
}
/>
:
null
}
<
/div
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"delete"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
)
);
);
}
}
}
}
...
...
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