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
75598a6b
Commit
75598a6b
authored
Jan 21, 2021
by
rifkaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
actual last year ratio
parent
55c2f260
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
734 additions
and
1 deletion
+734
-1
SubHolding.js
src/container/Laporan/SubHolding.js
+96
-1
TableSubHolding.js
src/container/Laporan/TableSubHolding.js
+638
-0
No files found.
src/container/Laporan/SubHolding.js
View file @
75598a6b
...
...
@@ -632,6 +632,13 @@ export default class SubHolding extends Component {
}
getRatioMR
(
payload
)
{
let
payloadLast
=
{
"report_id"
:
this
.
state
.
report
.
value
,
"revision"
:
this
.
state
.
revisionType
,
"periode"
:
Number
(
this
.
state
.
periode
.
periode
)
-
1
,
"company_id"
:
this
.
state
.
company
.
company_id
,
"submission_id"
:
this
.
state
.
submissionID
}
api
.
create
().
getReportHierarkiFRMR
(
payload
).
then
(
response
=>
{
// console.log(payload);
console
.
log
(
response
);
...
...
@@ -698,7 +705,95 @@ export default class SubHolding extends Component {
})
console
.
log
(
dataTable2
)
this
.
setState
({
dataTable
:
dataTable2
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
// this.setState({ dataTable: dataTable2, previewTable: true, loading: false, previewDownload: true })
this
.
setState
({
dataTable2
},
()
=>
{
console
.
log
(
this
.
state
.
dataTable2
)
this
.
getRatioLastMR
(
payloadLast
)
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
}
})
}
getRatioLastMR
(
payloadLast
)
{
api
.
create
().
getReportHierarkiFRMR
(
payloadLast
).
then
(
response
=>
{
console
.
log
(
payloadLast
);
console
.
log
(
response
);
let
dataTable2
=
this
.
state
.
dataTable2
let
dataTable3
=
[]
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
if
(
indexID
!=
-
1
)
{
const
handlePushChild
=
(
items
)
=>
{
let
indexIDzz
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
===
items
.
id
)
// console.log(indexIDzz)
if
(
indexIDzz
!=
-
1
)
{
dataTable3
.
push
([...
dataTable2
[
indexIDzz
],
Number
(
items
.
ratio
.
monthly_january
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_february
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_march
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_april
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_may
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_june
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_july
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_august
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_september
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_october
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_november
).
toFixed
(
2
),
Number
(
items
.
ratio
.
monthly_december
).
toFixed
(
2
),
])
}
if
(
items
.
children
!==
null
)
{
if
(
items
.
children
.
length
>
0
)
{
items
.
children
.
map
((
itemss
,
indexss
)
=>
{
handlePushChild
(
itemss
)
})
}
}
}
dataTable3
.
push
([...
dataTable2
[
indexID
],
Number
(
item
.
ratio
.
monthly_january
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_february
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_march
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_april
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_may
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_june
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_july
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_august
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_september
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_october
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_november
).
toFixed
(
2
),
Number
(
item
.
ratio
.
monthly_december
).
toFixed
(
2
),
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
}
})
console
.
log
(
dataTable3
)
this
.
setState
({
dataTable
:
dataTable3
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
...
...
src/container/Laporan/TableSubHolding.js
View file @
75598a6b
This diff is collapsed.
Click to expand it.
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