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
dea11cc8
Commit
dea11cc8
authored
Aug 28, 2020
by
faisalhamdi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FAM
parent
ef36863f
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
599 additions
and
71 deletions
+599
-71
CorporateAnnualTarget.js
src/container/BudgetTahunan/CorporateAnnualTarget.js
+164
-12
FixedAssetsMovement.js
src/container/BudgetTahunan/FixedAssetsMovement.js
+435
-59
No files found.
src/container/BudgetTahunan/CorporateAnnualTarget.js
View file @
dea11cc8
...
...
@@ -2,6 +2,7 @@ import React, { Component } from 'react';
import
{
Typography
,
Paper
,
createMuiTheme
,
MuiThemeProvider
,
TableCell
,
FormControlLabel
,
TextField
,
Input
}
from
'@material-ui/core'
;
import
MUIDataTable
from
'mui-datatables'
;
import
NumberFormat
from
'react-number-format'
;
import
api
from
'../../api'
;
var
ct
=
require
(
"../../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
...
...
@@ -25,32 +26,183 @@ export default class CorporateAnnualTarget extends Component {
super
(
props
)
this
.
state
=
{
dataTable
:
[
[
"FINANCIAL PERSPECTIVE"
,
"9,884,181"
,
"9,884,181"
,
"9,884,181"
,
"9,884,181"
,
"9,884,181"
,
"9,884,181"
,
"9,884,181"
,
"9,884,181"
,
"9,884,181"
,
"9,884,181"
],
[
"Control"
,
"-"
,
"-"
],
[
"Accumulated Depreciation (negative value)"
,
"2,647,647"
,
"2,058,898"
],
[
"Control"
,
"-"
,
"-"
],
[
"Gain / (Loss) on Fixed Assets"
,
"-"
,
"-"
],
[
"Control"
,
"-"
,
"-"
]
//
["FINANCIAL PERSPECTIVE", "9,884,181", "9,884,181", "9,884,181", "9,884,181", "9,884,181", "9,884,181", "9,884,181", "9,884,181", "9,884,181", "9,884,181"],
//
["Control", "-", "-"],
//
["Accumulated Depreciation (negative value)", "2,647,647", "2,058,898"],
//
["Control", "-", "-"],
//
["Gain / (Loss) on Fixed Assets", "-", "-"],
//
["Control", "-", "-"]
]
}
this
.
handleValue
=
this
.
handleValue
.
bind
(
this
)
}
componentDidMount
()
{
this
.
getItemHierarki
()
console
.
log
(
this
.
props
);
}
getItemHierarki
()
{
let
payload
=
{
"report_id"
:
this
.
props
.
report_id
,
"company_id"
:
this
.
props
.
company
.
company_id
}
api
.
create
().
getItemReportHierarki
(
payload
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
let
dataTable
=
[]
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
if
(
item
.
children
&&
item
.
children
.
length
>
0
)
{
dataTable
.
push
([
item
.
type_report_id
,
item
.
id
,
item
.
parent
,
item
.
formula
,
item
.
level
,
item
.
description
])
item
.
children
.
map
(
i
=>
{
if
(
i
.
children
)
{
if
(
i
.
children
.
length
>
0
)
{
dataTable
.
push
([
i
.
type_report_id
,
i
.
id
,
i
.
parent
,
i
.
formula
,
i
.
level
,
i
.
description
])
i
.
children
.
map
(
val
=>
{
if
(
val
.
children
&&
val
.
children
.
length
>
0
)
{
dataTable
.
push
([
val
.
type_report_id
,
val
.
id
,
val
.
parent
,
val
.
formula
,
val
.
level
,
val
.
description
])
val
.
children
.
map
(
items
=>
{
console
.
log
(
items
)
dataTable
.
push
([
items
.
type_report_id
,
items
.
id
,
items
.
parent
,
items
.
formula
,
items
.
level
,
items
.
description
])
})
}
else
{
dataTable
.
push
([
val
.
type_report_id
,
val
.
id
,
val
.
parent
,
val
.
formula
,
val
.
level
,
val
.
description
])
}
})
}
else
{
dataTable
.
push
([
i
.
type_report_id
,
i
.
id
,
i
.
parent
,
i
.
formula
,
i
.
level
,
i
.
description
])
}
}
else
{
dataTable
.
push
([
i
.
type_report_id
,
i
.
id
,
i
.
parent
,
i
.
formula
,
i
.
level
,
i
.
description
])
}
})
}
else
{
dataTable
.
push
([
item
.
type_report_id
,
item
.
id
,
item
.
parent
,
item
.
formula
,
item
.
level
,
item
.
description
])
}
})
console
.
log
(
dataTable
);
this
.
setState
({
dataTable
})
}
}
})
}
handleValue
(
data
)
{
let
total
=
0
this
.
state
.
dataTable
.
map
((
item
,
index
)
=>
{
if
(
data
.
rowData
[
1
]
==
item
[
2
])
{
total
=
item
[
data
.
columnIndex
]
==
undefined
?
(
total
+
0
)
:
(
total
+
item
[
data
.
columnIndex
])
}
})
let
indexParent
=
this
.
state
.
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
==
this
.
state
.
dataTable
[
data
.
rowIndex
][
2
])
let
a
=
this
.
state
.
dataTable
[
data
.
rowIndex
][
data
.
columnIndex
]
=
total
// console.log(indexParent);
return
a
}
handleChange
(
value
,
tableMeta
)
{
let
val
=
String
(
value
).
split
(
","
).
join
(
""
)
let
data
=
this
.
state
.
dataTable
let
a
=
data
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
value
this
.
setState
({
data
:
a
},
()
=>
console
.
log
(
this
.
state
.
dataTable
))
// let a = data[0].tableMeta.tableData[tableMeta.rowIndex] === value
// console.log(data)
let
indexParent
=
data
.
findIndex
((
val
)
=>
val
[
1
]
==
data
[
tableMeta
.
rowIndex
][
2
])
if
(
indexParent
>
0
)
{
console
.
log
(
indexParent
)
let
a
=
data
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
val
)
let
jagain
=
data
[
indexParent
][
tableMeta
.
columnIndex
]
a
=
data
[
indexParent
][
tableMeta
.
columnIndex
]
=
jagain
==
undefined
?
(
0
+
Number
(
val
))
:
(
jagain
+
Number
(
val
))
}
else
{
data
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
val
)
}
this
.
forceUpdate
()
// console.log(this.state.dataTable)
// this.setState({
// data: a,
// }, () => console.log(this.state.dataTable))
}
render
()
{
const
columns
=
[{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
"Key Performance Indicator"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
...
...
src/container/BudgetTahunan/FixedAssetsMovement.js
View file @
dea11cc8
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