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
Hide 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 {
}
componentDidMount
()
{
this
.
getCompanyActive
()
this
.
getAllUnitBisnis
()
if
(
this
.
props
.
type
===
'edit'
)
{
this
.
getDetailPerusahaan
()
// console.log(this.props.data);
}
else
{
this
.
getCompanyActive
()
this
.
getAllUnitBisnis
()
let
date
=
format
(
new
Date
,
'yyyy-MM-dd'
)
// console.log(date);
this
.
setState
({
...
...
@@ -86,7 +86,12 @@ export default class CreatePerusahaan extends Component {
totalReport
:
response
.
data
.
data
.
total_report
,
created
:
response
.
data
.
data
.
created
,
updated
:
response
.
data
.
data
.
updated
===
null
?
""
:
response
.
data
.
data
.
updated
},
()
=>
this
.
getAllUnitBisnis
(),
this
.
getCompanyActive
())
},
()
=>
{
// setTimeout(() => {
this
.
getAllUnitBisnis
()
this
.
getCompanyActive
()
// }, 1000);
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Token"
))
{
...
...
@@ -107,6 +112,7 @@ export default class CreatePerusahaan extends Component {
}
getCompanyActive
()
{
console
.
log
(
this
.
state
.
company
)
if
(
this
.
state
.
company
!==
null
)
{
console
.
log
(
this
.
state
.
company
)
let
payload
=
{
...
...
@@ -118,12 +124,20 @@ export default class CreatePerusahaan extends Component {
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
==
'success'
)
{
let
data
=
response
.
data
.
data
let
perusahaanData
=
data
.
map
((
item
)
=>
{
return
{
company_id
:
item
.
company_id
,
company_name
:
item
.
company_name
let
currentIndex
=
null
let
perusahaanData
=
data
.
map
((
item
,
index
)
=>
{
if
(
this
.
state
.
companyID
!==
item
.
company_id
)
{
return
{
company_id
:
item
.
company_id
,
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
typeProps
=
{
options
:
perusahaanData
,
...
...
src/container/MasterData/Perusahaan/Perusahaan.js
View file @
4f280285
...
...
@@ -496,7 +496,12 @@ export default class Perusahaan extends Component {
// onClick={() => this.setState({ visibleEdit: true, data: tableMeta.rowData })}
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
>
)}
<
/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