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
89cc2e37
Commit
89cc2e37
authored
Nov 05, 2020
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lagi
parent
d32c3bee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
92 additions
and
78 deletions
+92
-78
ProfitLoss.js
src/container/BudgetTahunan/ProfitLoss.js
+92
-78
No files found.
src/container/BudgetTahunan/ProfitLoss.js
View file @
89cc2e37
...
@@ -107,86 +107,100 @@ export default class ProfitLoss extends Component {
...
@@ -107,86 +107,100 @@ export default class ProfitLoss extends Component {
let
dataTable
=
[]
let
dataTable
=
[]
this
.
setState
({
visibleProfitLoss
:
true
})
this
.
setState
({
visibleProfitLoss
:
true
})
if
(
response
.
data
)
{
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
if
(
response
.
ok
)
{
const
handlePushChild
=
(
item
)
=>
{
if
(
response
.
data
.
status
===
'success'
)
{
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
let
res
=
response
.
data
.
data
if
(
indexIDzz
===
-
1
)
{
const
handlePushChild
=
(
item
)
=>
{
dataTable
.
push
([
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
item
.
type_report_id
,
if
(
indexIDzz
===
-
1
)
{
item
.
id
,
dataTable
.
push
([
item
.
parent
,
item
.
type_report_id
,
item
.
formula
,
item
.
id
,
item
.
level
,
item
.
parent
,
item
.
description
,
item
.
formula
,
item
.
profit_loss
.
notes
===
""
?
null
:
item
.
profit_loss
.
notes
,
item
.
level
,
item
.
profit_loss
.
total_actual_before
===
null
?
"0"
:
item
.
profit_loss
.
total_actual_before
===
""
?
"0"
:
item
.
profit_loss
.
total_actual_before
,
item
.
description
,
item
.
profit_loss
.
january
,
item
.
profit_loss
.
notes
===
""
?
null
:
item
.
profit_loss
.
notes
,
item
.
profit_loss
.
february
,
item
.
profit_loss
.
total_actual_before
===
null
?
"0"
:
item
.
profit_loss
.
total_actual_before
===
""
?
"0"
:
item
.
profit_loss
.
total_actual_before
,
item
.
profit_loss
.
march
,
item
.
profit_loss
.
january
,
item
.
profit_loss
.
april
,
item
.
profit_loss
.
february
,
item
.
profit_loss
.
may
,
item
.
profit_loss
.
march
,
item
.
profit_loss
.
june
,
item
.
profit_loss
.
april
,
item
.
profit_loss
.
july
,
item
.
profit_loss
.
may
,
item
.
profit_loss
.
august
,
item
.
profit_loss
.
june
,
item
.
profit_loss
.
september
,
item
.
profit_loss
.
july
,
item
.
profit_loss
.
october
,
item
.
profit_loss
.
august
,
item
.
profit_loss
.
november
,
item
.
profit_loss
.
september
,
item
.
profit_loss
.
december
,
item
.
profit_loss
.
october
,
item
.
profit_loss
.
total_current_year
,
item
.
profit_loss
.
november
,
item
.
profit_loss
.
total_next_year
,
item
.
profit_loss
.
december
,
item
.
profit_loss
.
total_more_year
,
item
.
profit_loss
.
total_current_year
,
item
.
order
item
.
profit_loss
.
total_next_year
,
])
item
.
profit_loss
.
total_more_year
,
}
item
.
order
if
(
item
.
children
!==
null
)
{
])
if
(
item
.
children
.
length
>
0
)
{
}
item
.
children
.
map
((
items
,
indexs
)
=>
{
if
(
item
.
children
!==
null
)
{
handlePushChild
(
items
)
if
(
item
.
children
.
length
>
0
)
{
})
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
}
}
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
===
null
?
"0"
:
item
.
profit_loss
.
total_actual_before
===
""
?
"0"
:
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
,
item
.
order
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
})
// console.log(dataTable)
this
.
setState
({
dataTable
,
loading
:
false
,
buttonError
:
true
,
editable
:
true
},
()
=>
{
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
,
loading
:
false
})
}
}
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
===
null
?
"0"
:
item
.
profit_loss
.
total_actual_before
===
""
?
"0"
:
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
,
item
.
order
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
}
})
// console.log(dataTable)
this
.
setState
({
dataTable
,
loading
:
false
,
buttonError
:
true
,
editable
:
true
},
()
=>
{
// console.log(dataTable)
})
}
else
{
}
else
{
this
.
setState
({
dataTable
,
loading
:
false
,
buttonError
:
true
,
editable
:
tru
e
})
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
fals
e
})
}
}
})
})
...
@@ -423,10 +437,10 @@ export default class ProfitLoss extends Component {
...
@@ -423,10 +437,10 @@ export default class ProfitLoss extends Component {
// alert(response.data.status)
// alert(response.data.status)
}
}
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
,
loading
:
false
})
}
}
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
}
}
})
})
}
}
...
...
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