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
e8fffeb3
Commit
e8fffeb3
authored
Sep 21, 2020
by
EKSAD
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PL
parent
fedb60a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
50 deletions
+55
-50
ProfitLoss.js
src/container/BudgetTahunan/ProfitLoss.js
+55
-50
No files found.
src/container/BudgetTahunan/ProfitLoss.js
View file @
e8fffeb3
...
@@ -44,7 +44,8 @@ export default class ProfitLoss extends Component {
...
@@ -44,7 +44,8 @@ export default class ProfitLoss extends Component {
visibleProfitLoss
:
true
,
visibleProfitLoss
:
true
,
disabledSave
:
true
,
disabledSave
:
true
,
editable
:
false
,
editable
:
false
,
buttonError
:
false
buttonError
:
false
,
judulColumn
:
null
}
}
this
.
handleValue
=
this
.
handleValue
.
bind
(
this
)
this
.
handleValue
=
this
.
handleValue
.
bind
(
this
)
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
...
@@ -56,7 +57,7 @@ export default class ProfitLoss extends Component {
...
@@ -56,7 +57,7 @@ export default class ProfitLoss extends Component {
}
}
getItemHierarki
()
{
getItemHierarki
()
{
this
.
setState
({
loading
:
true
})
this
.
setState
({
loading
:
true
,
judulColumn
:
null
})
let
payload
=
{
let
payload
=
{
"report_id"
:
this
.
props
.
report_id
,
"report_id"
:
this
.
props
.
report_id
,
"revision"
:
Number
(
this
.
props
.
revision
),
"revision"
:
Number
(
this
.
props
.
revision
),
...
@@ -67,11 +68,47 @@ export default class ProfitLoss extends Component {
...
@@ -67,11 +68,47 @@ export default class ProfitLoss extends Component {
api
.
create
().
getDetailReportMB
(
payload
).
then
(
response
=>
{
api
.
create
().
getDetailReportMB
(
payload
).
then
(
response
=>
{
console
.
log
(
response
);
console
.
log
(
response
);
let
dataTable
=
[]
let
dataTable
=
[]
let
res
=
response
.
data
.
data
if
(
response
.
data
)
{
console
.
log
(
res
)
let
res
=
response
.
data
.
data
const
handlePushChild
=
(
item
)
=>
{
console
.
log
(
res
)
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
const
handlePushChild
=
(
item
)
=>
{
if
(
indexIDzz
===
-
1
)
{
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
if
(
indexIDzz
===
-
1
)
{
dataTable
.
push
([
item
.
type_report_id
,
item
.
id
,
item
.
parent
,
item
.
formula
,
item
.
level
,
item
.
description
,
item
.
profit_loss
.
notes
===
""
?
null
:
item
.
profit_loss
.
notes
,
item
.
profit_loss
.
total_actual_before
===
null
?
"0"
:
item
.
balance_sheet
.
total_actual_before
===
""
?
"0"
:
item
.
balance_sheet
.
total_actual_before
,
item
.
profit_loss
.
january
,
item
.
profit_loss
.
february
,
item
.
profit_loss
.
march
,
item
.
profit_loss
.
april
,
item
.
profit_loss
.
may
,
item
.
profit_loss
.
june
,
item
.
profit_loss
.
july
,
item
.
profit_loss
.
august
,
item
.
profit_loss
.
september
,
item
.
profit_loss
.
october
,
item
.
profit_loss
.
november
,
item
.
profit_loss
.
december
,
item
.
profit_loss
.
total_current_year
,
item
.
profit_loss
.
total_next_year
,
item
.
profit_loss
.
total_more_year
])
}
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
}
res
.
map
((
item
,
index
)
=>
{
dataTable
.
push
([
dataTable
.
push
([
item
.
type_report_id
,
item
.
type_report_id
,
item
.
id
,
item
.
id
,
...
@@ -80,7 +117,7 @@ export default class ProfitLoss extends Component {
...
@@ -80,7 +117,7 @@ export default class ProfitLoss extends Component {
item
.
level
,
item
.
level
,
item
.
description
,
item
.
description
,
item
.
profit_loss
.
notes
===
""
?
null
:
item
.
profit_loss
.
notes
,
item
.
profit_loss
.
notes
===
""
?
null
:
item
.
profit_loss
.
notes
,
item
.
profit_loss
.
total_actual_before
,
item
.
profit_loss
.
total_actual_before
===
null
?
"0"
:
item
.
balance_sheet
.
total_actual_before
===
""
?
"0"
:
item
.
balance_sheet
.
total_actual_before
,
item
.
profit_loss
.
january
,
item
.
profit_loss
.
january
,
item
.
profit_loss
.
february
,
item
.
profit_loss
.
february
,
item
.
profit_loss
.
march
,
item
.
profit_loss
.
march
,
...
@@ -97,50 +134,18 @@ export default class ProfitLoss extends Component {
...
@@ -97,50 +134,18 @@ export default class ProfitLoss extends Component {
item
.
profit_loss
.
total_next_year
,
item
.
profit_loss
.
total_next_year
,
item
.
profit_loss
.
total_more_year
item
.
profit_loss
.
total_more_year
])
])
}
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
handlePushChild
(
items
)
}
)
}
)
}
}
}
}
})
this
.
setState
({
dataTable
,
loading
:
false
,
buttonError
:
true
})
}
else
{
this
.
setState
({
dataTable
,
loading
:
false
,
buttonError
:
true
})
}
}
res
.
map
((
item
,
index
)
=>
{
dataTable
.
push
([
item
.
type_report_id
,
item
.
id
,
item
.
parent
,
item
.
formula
,
item
.
level
,
item
.
description
,
item
.
profit_loss
.
notes
===
""
?
null
:
item
.
profit_loss
.
notes
,
item
.
profit_loss
.
total_actual_before
,
item
.
profit_loss
.
january
,
item
.
profit_loss
.
february
,
item
.
profit_loss
.
march
,
item
.
profit_loss
.
april
,
item
.
profit_loss
.
may
,
item
.
profit_loss
.
june
,
item
.
profit_loss
.
july
,
item
.
profit_loss
.
august
,
item
.
profit_loss
.
september
,
item
.
profit_loss
.
october
,
item
.
profit_loss
.
november
,
item
.
profit_loss
.
december
,
item
.
profit_loss
.
total_current_year
,
item
.
profit_loss
.
total_next_year
,
item
.
profit_loss
.
total_more_year
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
})
this
.
setState
({
dataTable
,
loading
:
false
,
buttonError
:
true
})
})
})
}
}
...
...
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