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
3f12c134
Commit
3f12c134
authored
Oct 15, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
subholdingg
parent
b45cbae1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1826 additions
and
442 deletions
+1826
-442
SubHolding.js
src/container/Laporan/SubHolding.js
+212
-100
TableSubHolding.js
src/container/Laporan/TableSubHolding.js
+1614
-342
No files found.
src/container/Laporan/SubHolding.js
View file @
3f12c134
...
@@ -20,13 +20,14 @@ export default class SubHolding extends Component {
...
@@ -20,13 +20,14 @@ export default class SubHolding extends Component {
listPeriode
:
null
,
listPeriode
:
null
,
periode
:
null
,
periode
:
null
,
reportType
:
[
reportType
:
[
{
value
:
'DB Balance Sheet'
,
label
:
'DB Balance Sheet'
},
{
value
:
1
,
label
:
'DB Balance Sheet'
},
{
value
:
'DB Profit & Loss'
,
label
:
'DB Profit & Loss'
},
{
value
:
2
,
label
:
'DB Profit & Loss'
},
{
value
:
'DB Balance Sheet Detail'
,
label
:
'DB Balance Sheet Detail'
},
{
value
:
3
,
label
:
'DB Balance Sheet Detail'
},
{
value
:
'DB Ratio'
,
label
:
'DB Ratio'
},
{
value
:
4
,
label
:
'DB Ratio'
},
],
],
report
:
null
,
report
:
null
,
loading
:
false
loading
:
false
,
previewTable
:
false
}
}
}
}
...
@@ -145,7 +146,8 @@ export default class SubHolding extends Component {
...
@@ -145,7 +146,8 @@ export default class SubHolding extends Component {
// console.log(periodeData)
// console.log(periodeData)
// console.log(index)
// console.log(index)
this
.
setState
({
listPeriode
:
defaultProps
,
periode
:
index
===
-
1
?
periodeData
[
0
]
:
periodeData
[
index
]
},
()
=>
{
this
.
setState
({
listPeriode
:
defaultProps
,
periode
:
index
===
-
1
?
periodeData
[
0
]
:
periodeData
[
index
]
},
()
=>
{
this
.
getDataTable
()
// this.getDataTable()
this
.
getSubmission
()
// if (this.state.isApprover === true) {
// if (this.state.isApprover === true) {
// this.getCompanySubmitted()
// this.getCompanySubmitted()
// } else {
// } else {
...
@@ -157,17 +159,42 @@ export default class SubHolding extends Component {
...
@@ -157,17 +159,42 @@ export default class SubHolding extends Component {
})
})
}
}
async
getDataTable
()
{
getSubmission
()
{
this
.
setState
({
loading
:
true
})
let
payload
=
{
let
payload
=
{
"report_id"
:
1
,
"company_id"
:
this
.
state
.
company
.
company_id
,
"revision"
:
0
,
"periode"
:
this
.
state
.
periode
.
periode
,
"is_approver"
:
true
}
api
.
create
().
getSubmission
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
submissionID
:
response
.
data
.
data
.
submission_id
,
lastRevision
:
response
.
data
.
data
.
last_revision
,
},
()
=>
{
this
.
getDataTable
()
})
}
else
{
this
.
setState
({
submissionID
:
null
,
loading
:
false
})
}
}
})
}
getDataTable
()
{
let
payload
=
{
"report_id"
:
this
.
state
.
report
.
value
,
"revision"
:
this
.
state
.
lastRevision
,
"periode"
:
this
.
state
.
periode
.
periode
,
"periode"
:
this
.
state
.
periode
.
periode
,
"company_id"
:
this
.
state
.
company
.
company_id
,
"company_id"
:
this
.
state
.
company
.
company_id
,
"submission_id"
:
null
"submission_id"
:
this
.
state
.
submissionID
}
}
let
response
=
await
api
.
create
().
getDetailReportMB
(
payload
)
api
.
create
().
getDetailReportMB
(
payload
).
then
(
response
=>
{
console
.
log
(
response
);
console
.
log
(
response
);
let
dataTable
=
[]
let
dataTable
=
[]
if
(
this
.
state
.
report
.
value
===
1
)
{
if
(
response
.
data
)
{
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
let
res
=
response
.
data
.
data
const
handlePushChild
=
(
item
)
=>
{
const
handlePushChild
=
(
item
)
=>
{
...
@@ -245,9 +272,95 @@ export default class SubHolding extends Component {
...
@@ -245,9 +272,95 @@ export default class SubHolding extends Component {
}
}
}
}
})
})
this
.
setState
({
dataTable
,
loading
:
false
})
this
.
setState
({
dataTable
,
previewTable
:
true
,
loading
:
false
})
}
else
{
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
})
}
}
else
if
(
this
.
state
.
report
.
value
===
2
)
{
if
(
response
.
data
)
{
let
res
=
response
.
data
.
data
const
handlePushChild
=
(
item
)
=>
{
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
.
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
)
})
}
}
}
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
,
previewTable
:
true
,
loading
:
false
})
}
else
{
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
})
}
}
else
{
}
else
{
this
.
setState
({
dataTable
:
[],
previewTable
:
false
,
loading
:
false
})
}
}
})
}
}
render
()
{
render
()
{
...
@@ -276,9 +389,11 @@ export default class SubHolding extends Component {
...
@@ -276,9 +389,11 @@ export default class SubHolding extends Component {
<
div
style
=
{{
marginTop
:
20
}}
>
<
div
style
=
{{
marginTop
:
20
}}
>
<
Autocomplete
<
Autocomplete
options
=
{
this
.
state
.
reportType
}
options
=
{
this
.
state
.
reportType
}
getOptionLabel
=
{(
option
)
=>
titleCase
(
option
.
value
)}
getOptionLabel
=
{(
option
)
=>
titleCase
(
option
.
label
)}
id
=
"typereport"
id
=
"typereport"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
report
:
newInputValue
})}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
report
:
newInputValue
},
()
=>
{
this
.
getSubmission
()
})}
disableClearable
disableClearable
style
=
{{
width
:
250
}}
style
=
{{
width
:
250
}}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Report Type"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Report Type"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
...
@@ -290,7 +405,9 @@ export default class SubHolding extends Component {
...
@@ -290,7 +405,9 @@ export default class SubHolding extends Component {
{...
this
.
state
.
listCompany
}
{...
this
.
state
.
listCompany
}
id
=
"company"
id
=
"company"
disabled
=
{
this
.
state
.
intent
===
'Home'
?
true
:
false
}
disabled
=
{
this
.
state
.
intent
===
'Home'
?
true
:
false
}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
})}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
},
()
=>
{
this
.
getSubmission
()
})}
disableClearable
disableClearable
style
=
{{
width
:
250
}}
style
=
{{
width
:
250
}}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Company"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Company"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
...
@@ -302,12 +419,7 @@ export default class SubHolding extends Component {
...
@@ -302,12 +419,7 @@ export default class SubHolding extends Component {
{...
this
.
state
.
listPeriode
}
{...
this
.
state
.
listPeriode
}
id
=
"periode"
id
=
"periode"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
periode
:
newInputValue
},
()
=>
{
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
periode
:
newInputValue
},
()
=>
{
// if (this.state.isApprover === true) {
this
.
getSubmission
()
// this.getCompanySubmitted()
// } else {
// this.setState({ visibleTableHistory: false })
// this.getRevision()
// }
})}
})}
disabled
=
{
this
.
state
.
intent
===
'Home'
?
true
:
false
}
disabled
=
{
this
.
state
.
intent
===
'Home'
?
true
:
false
}
disableClearable
disableClearable
...
@@ -321,12 +433,12 @@ export default class SubHolding extends Component {
...
@@ -321,12 +433,12 @@ export default class SubHolding extends Component {
<
/div
>
<
/div
>
<
div
style
=
{{
marginTop
:
20
}}
>
<
div
style
=
{{
marginTop
:
20
}}
>
{
this
.
state
.
loading
&&
loadingComponent
}
{
this
.
state
.
loading
&&
loadingComponent
}
{
!
this
.
state
.
loading
&&
(
{
this
.
state
.
previewTable
&&
(
<
TableSubHolding
<
TableSubHolding
width
=
{
this
.
props
.
width
}
width
=
{
this
.
props
.
width
}
height
=
{
this
.
props
.
height
}
height
=
{
this
.
props
.
height
}
open
=
{
this
.
props
.
open
}
open
=
{
this
.
props
.
open
}
type
=
{
1
}
type
=
{
this
.
state
.
report
?
this
.
state
.
report
.
value
:
1
}
dataTable
=
{
this
.
state
.
dataTable
}
dataTable
=
{
this
.
state
.
dataTable
}
periode
=
{
this
.
state
.
periode
?
this
.
state
.
periode
.
periode
:
null
}
periode
=
{
this
.
state
.
periode
?
this
.
state
.
periode
.
periode
:
null
}
/
>
/
>
...
...
src/container/Laporan/TableSubHolding.js
View file @
3f12c134
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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