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
4f280285
Commit
4f280285
authored
Sep 04, 2020
by
a.bairuha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update issue
parent
00211b29
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
8 deletions
+27
-8
CreatePerusahaan.js
src/container/MasterData/Perusahaan/CreatePerusahaan.js
+21
-7
Perusahaan.js
src/container/MasterData/Perusahaan/Perusahaan.js
+6
-1
No files found.
src/container/MasterData/Perusahaan/CreatePerusahaan.js
View file @
4f280285
...
@@ -53,12 +53,12 @@ export default class CreatePerusahaan extends Component {
...
@@ -53,12 +53,12 @@ export default class CreatePerusahaan extends Component {
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
getCompanyActive
()
this
.
getAllUnitBisnis
()
if
(
this
.
props
.
type
===
'edit'
)
{
if
(
this
.
props
.
type
===
'edit'
)
{
this
.
getDetailPerusahaan
()
this
.
getDetailPerusahaan
()
// console.log(this.props.data);
// console.log(this.props.data);
}
else
{
}
else
{
this
.
getCompanyActive
()
this
.
getAllUnitBisnis
()
let
date
=
format
(
new
Date
,
'yyyy-MM-dd'
)
let
date
=
format
(
new
Date
,
'yyyy-MM-dd'
)
// console.log(date);
// console.log(date);
this
.
setState
({
this
.
setState
({
...
@@ -86,7 +86,12 @@ export default class CreatePerusahaan extends Component {
...
@@ -86,7 +86,12 @@ export default class CreatePerusahaan extends Component {
totalReport
:
response
.
data
.
data
.
total_report
,
totalReport
:
response
.
data
.
data
.
total_report
,
created
:
response
.
data
.
data
.
created
,
created
:
response
.
data
.
data
.
created
,
updated
:
response
.
data
.
data
.
updated
===
null
?
""
:
response
.
data
.
data
.
updated
updated
:
response
.
data
.
data
.
updated
===
null
?
""
:
response
.
data
.
data
.
updated
},
()
=>
this
.
getAllUnitBisnis
(),
this
.
getCompanyActive
())
},
()
=>
{
// setTimeout(() => {
this
.
getAllUnitBisnis
()
this
.
getCompanyActive
()
// }, 1000);
})
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Token"
))
{
if
(
response
.
data
.
message
.
includes
(
"Token"
))
{
...
@@ -107,6 +112,7 @@ export default class CreatePerusahaan extends Component {
...
@@ -107,6 +112,7 @@ export default class CreatePerusahaan extends Component {
}
}
getCompanyActive
()
{
getCompanyActive
()
{
console
.
log
(
this
.
state
.
company
)
if
(
this
.
state
.
company
!==
null
)
{
if
(
this
.
state
.
company
!==
null
)
{
console
.
log
(
this
.
state
.
company
)
console
.
log
(
this
.
state
.
company
)
let
payload
=
{
let
payload
=
{
...
@@ -118,12 +124,20 @@ export default class CreatePerusahaan extends Component {
...
@@ -118,12 +124,20 @@ export default class CreatePerusahaan extends Component {
if
(
response
.
ok
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
==
'success'
)
{
if
(
response
.
data
.
status
==
'success'
)
{
let
data
=
response
.
data
.
data
let
data
=
response
.
data
.
data
let
perusahaanData
=
data
.
map
((
item
)
=>
{
let
currentIndex
=
null
let
perusahaanData
=
data
.
map
((
item
,
index
)
=>
{
if
(
this
.
state
.
companyID
!==
item
.
company_id
)
{
return
{
return
{
company_id
:
item
.
company_id
,
company_id
:
item
.
company_id
,
company_name
:
item
.
company_name
company_name
:
item
.
company_name
}
}
}
else
{
currentIndex
=
index
}
})
})
if
(
currentIndex
!==
null
)
{
perusahaanData
.
splice
(
currentIndex
,
1
)
}
let
index
=
perusahaanData
.
sort
((
a
,
b
)
=>
a
.
company_id
-
b
.
company_id
).
findIndex
((
val
)
=>
val
.
company_id
==
this
.
state
.
parentID
)
let
index
=
perusahaanData
.
sort
((
a
,
b
)
=>
a
.
company_id
-
b
.
company_id
).
findIndex
((
val
)
=>
val
.
company_id
==
this
.
state
.
parentID
)
let
typeProps
=
{
let
typeProps
=
{
options
:
perusahaanData
,
options
:
perusahaanData
,
...
...
src/container/MasterData/Perusahaan/Perusahaan.js
View file @
4f280285
...
@@ -496,7 +496,12 @@ export default class Perusahaan extends Component {
...
@@ -496,7 +496,12 @@ export default class Perusahaan extends Component {
// onClick={() => this.setState({ visibleEdit: true, data: tableMeta.rowData })}
// onClick={() => this.setState({ visibleEdit: true, data: tableMeta.rowData })}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'edit'
)}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'edit'
)}
>
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
div
style
=
{{
display
:
'flex'
}}
>
{
!
tableMeta
.
rowData
[
2
].
includes
(
"TIA"
)
?
<
img
src
=
{
Images
.
editCopy
}
/>
:
null
}
<
/div
>
<
/button
>
<
/button
>
)}
)}
<
/div
>
<
/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