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
66e68589
Commit
66e68589
authored
Jan 21, 2021
by
d.arizona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
c3e55249
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
113 additions
and
26 deletions
+113
-26
SubHolding.js
src/container/Laporan/SubHolding.js
+113
-26
No files found.
src/container/Laporan/SubHolding.js
View file @
66e68589
...
...
@@ -503,7 +503,7 @@ export default class SubHolding extends Component {
}
})
}
else
if
(
this
.
state
.
report
.
value
===
4
)
{
api
.
create
().
getReportHierarkiFR
(
payload
).
then
(
response
=>
{
api
.
create
().
getReportHierarkiFR
MB
(
payload
).
then
(
response
=>
{
// console.log(payload);
console
.
log
(
response
);
let
dataTable
=
[]
...
...
@@ -536,18 +536,18 @@ export default class SubHolding extends Component {
Number
(
item
.
ratio
.
december
).
toFixed
(
1
),
Number
(
item
.
ratio
.
total_next_year
).
toFixed
(
1
),
Number
(
item
.
ratio
.
total_more_year
).
toFixed
(
1
),
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
),
//
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),
// item.order,
// item.condition_it_should_be,
// item.condition_if_wrong,
...
...
@@ -586,18 +586,18 @@ export default class SubHolding extends Component {
Number
(
item
.
ratio
.
december
).
toFixed
(
1
),
Number
(
item
.
ratio
.
total_next_year
).
toFixed
(
1
),
Number
(
item
.
ratio
.
total_more_year
).
toFixed
(
1
),
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
),
//
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),
// item.order,
// item.condition_it_should_be,
// item.condition_if_wrong
...
...
@@ -610,7 +610,10 @@ export default class SubHolding extends Component {
}
}
})
this
.
setState
({
dataTable
,
previewTable
:
true
,
loading
:
false
,
previewDownload
:
true
})
this
.
setState
({
dataTable
},
()
=>
{
console
.
log
(
this
.
state
.
dataTable
)
this
.
getRatioMR
(
payload
)
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
...
...
@@ -628,6 +631,90 @@ export default class SubHolding extends Component {
}
}
getRatioMR
(
payload
)
{
api
.
create
().
getReportHierarkiFRMR
(
payload
).
then
(
response
=>
{
// console.log(payload);
console
.
log
(
response
);
let
dataTable
=
this
.
state
.
dataTable
let
dataTable2
=
[]
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
res
=
response
.
data
.
data
res
.
map
((
item
,
index
)
=>
{
let
indexID
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
==
item
.
id
)
if
(
indexID
!=
-
1
)
{
const
handlePushChild
=
(
items
)
=>
{
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
===
items
.
id
)
// console.log(indexIDzz)
if
(
indexIDzz
!=
-
1
)
{
dataTable2
.
push
([...
dataTable
[
indexIDzz
],
Number
(
items
.
ratio
.
monthly_january
).
toFixed
(
1
),
Number
(
items
.
ratio
.
monthly_february
).
toFixed
(
1
),
Number
(
items
.
ratio
.
monthly_march
).
toFixed
(
1
),
Number
(
items
.
ratio
.
monthly_april
).
toFixed
(
1
),
Number
(
items
.
ratio
.
monthly_may
).
toFixed
(
1
),
Number
(
items
.
ratio
.
monthly_june
).
toFixed
(
1
),
Number
(
items
.
ratio
.
monthly_july
).
toFixed
(
1
),
Number
(
items
.
ratio
.
monthly_august
).
toFixed
(
1
),
Number
(
items
.
ratio
.
monthly_september
).
toFixed
(
1
),
Number
(
items
.
ratio
.
monthly_october
).
toFixed
(
1
),
Number
(
items
.
ratio
.
monthly_november
).
toFixed
(
1
),
Number
(
items
.
ratio
.
monthly_december
).
toFixed
(
1
),
])
}
if
(
items
.
children
!==
null
)
{
if
(
items
.
children
.
length
>
0
)
{
items
.
children
.
map
((
itemss
,
indexss
)
=>
{
handlePushChild
(
itemss
)
})
}
}
}
dataTable2
.
push
([...
dataTable
[
indexID
],
Number
(
item
.
ratio
.
monthly_january
).
toFixed
(
1
),
Number
(
item
.
ratio
.
monthly_february
).
toFixed
(
1
),
Number
(
item
.
ratio
.
monthly_march
).
toFixed
(
1
),
Number
(
item
.
ratio
.
monthly_april
).
toFixed
(
1
),
Number
(
item
.
ratio
.
monthly_may
).
toFixed
(
1
),
Number
(
item
.
ratio
.
monthly_june
).
toFixed
(
1
),
Number
(
item
.
ratio
.
monthly_july
).
toFixed
(
1
),
Number
(
item
.
ratio
.
monthly_august
).
toFixed
(
1
),
Number
(
item
.
ratio
.
monthly_september
).
toFixed
(
1
),
Number
(
item
.
ratio
.
monthly_october
).
toFixed
(
1
),
Number
(
item
.
ratio
.
monthly_november
).
toFixed
(
1
),
Number
(
item
.
ratio
.
monthly_december
).
toFixed
(
1
),
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
}
})
console
.
log
(
dataTable2
)
this
.
setState
({
dataTable
:
dataTable2
,
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"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
}
})
}
async
downloadAllData
()
{
if
(
this
.
state
.
report
.
value
===
1
)
{
let
res
=
await
fetch
(
...
...
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