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
fdf5249e
Commit
fdf5249e
authored
Sep 15, 2020
by
Rifka Kurnia Irfiana
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://103.44.149.204/d.arizona/tia-dev
into rifka
parents
d0891fc0
09c0f8f3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
465 additions
and
201 deletions
+465
-201
index.js
src/api/index.js
+3
-1
BalanceSheet.js
src/container/BudgetTahunan/BalanceSheet.js
+323
-132
CorporateAnnualTarget.js
src/container/BudgetTahunan/CorporateAnnualTarget.js
+137
-66
Perusahaan.js
src/container/MasterData/Perusahaan/Perusahaan.js
+2
-2
No files found.
src/api/index.js
View file @
fdf5249e
...
@@ -168,6 +168,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
...
@@ -168,6 +168,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const
getDetailReportMB
=
(
body
)
=>
api
.
post
(
'/transaction/master_budget/get_report_hierarki'
,
body
)
const
getDetailReportMB
=
(
body
)
=>
api
.
post
(
'/transaction/master_budget/get_report_hierarki'
,
body
)
const
createSubmitReport
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/create_submission_report'
,
body
)
const
createSubmitReport
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/create_submission_report'
,
body
)
const
getSubmission
=
(
body
)
=>
api
.
post
(
'transaction/get_submission_id'
,
body
)
const
getSubmission
=
(
body
)
=>
api
.
post
(
'transaction/get_submission_id'
,
body
)
const
checkUploadMB
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/check_import'
,
body
)
//Template
//Template
const
downloadTemplate
=
(
fileName
,
fileType
)
=>
api
.
get
(
`attachment/download_file?fileName=
${
fileName
}
&&fileType=
${
fileType
}
`
)
const
downloadTemplate
=
(
fileName
,
fileType
)
=>
api
.
get
(
`attachment/download_file?fileName=
${
fileName
}
&&fileType=
${
fileType
}
`
)
...
@@ -291,7 +292,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
...
@@ -291,7 +292,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
updateDocument
,
updateDocument
,
downloadDocument
,
downloadDocument
,
createSubmitReport
,
createSubmitReport
,
getSubmission
getSubmission
,
checkUploadMB
}
}
}
}
...
...
src/container/BudgetTahunan/BalanceSheet.js
View file @
fdf5249e
...
@@ -8,6 +8,8 @@ import { values } from 'ramda';
...
@@ -8,6 +8,8 @@ import { values } from 'ramda';
import
PropagateLoader
from
"react-spinners/PropagateLoader"
import
PropagateLoader
from
"react-spinners/PropagateLoader"
import
Images
from
'../../assets/Images'
;
import
Images
from
'../../assets/Images'
;
import
ReactTooltip
from
'react-tooltip'
;
import
ReactTooltip
from
'react-tooltip'
;
import
UploadFile
from
"../../library/Upload"
;
import
{
ExcelRenderer
}
from
'react-excel-renderer'
;
var
ct
=
require
(
"../../library/CustomTable"
);
var
ct
=
require
(
"../../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable3
());
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable3
());
...
@@ -40,9 +42,12 @@ export default class BalanceSheet extends Component {
...
@@ -40,9 +42,12 @@ export default class BalanceSheet extends Component {
// ["Notes Receivable", "", ""],
// ["Notes Receivable", "", ""],
// ["Accounts Receivable", "172,031", "97,112"],
// ["Accounts Receivable", "172,031", "97,112"],
// ["Trade Receivables - Third Party", "142,668", "77,480"],
// ["Trade Receivables - Third Party", "142,668", "77,480"],
]
],
visibleBalanceSheet
:
true
,
disabledSave
:
true
}
}
this
.
handleValue
=
this
.
handleValue
.
bind
(
this
)
this
.
handleValue
=
this
.
handleValue
.
bind
(
this
)
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
}
}
componentDidMount
()
{
componentDidMount
()
{
...
@@ -753,6 +758,105 @@ export default class BalanceSheet extends Component {
...
@@ -753,6 +758,105 @@ export default class BalanceSheet extends Component {
this
.
props
.
onClickClose
()
this
.
props
.
onClickClose
()
}
}
downloadTemplate
=
async
()
=>
{
let
res
=
await
fetch
(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/download_template?report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
`
)
res
=
await
res
.
blob
()
console
.
log
(
res
)
if
(
res
.
size
>
0
)
{
let
url
=
window
.
URL
.
createObjectURL
(
res
);
let
a
=
document
.
createElement
(
'a'
);
a
.
href
=
url
;
a
.
download
=
'Template Balance Sheet.xlsx'
;
a
.
click
();
}
}
fileHandler
=
(
event
)
=>
{
let
fileObj
=
event
ExcelRenderer
(
fileObj
,
(
err
,
resp
)
=>
{
// console.log(resp)
if
(
err
)
{
console
.
log
(
err
);
}
else
{
let
isi
=
resp
.
rows
.
slice
(
3
)
console
.
log
(
isi
);
let
payload
=
[]
isi
.
map
((
i
,
index
)
=>
{
if
(
i
.
length
>
0
)
{
payload
.
push
({
item_report
:
i
[
0
]
===
undefined
?
""
:
String
(
i
[
0
]),
total_actual_before
:
i
[
1
]
===
undefined
?
""
:
String
(
i
[
1
]),
january
:
i
[
2
]
===
undefined
?
""
:
String
(
i
[
2
]),
february
:
i
[
3
]
===
undefined
?
""
:
String
(
i
[
3
]),
march
:
i
[
4
]
===
undefined
?
""
:
String
(
i
[
4
]),
april
:
i
[
5
]
===
undefined
?
""
:
String
(
i
[
5
]),
may
:
i
[
6
]
===
undefined
?
""
:
String
(
i
[
6
]),
june
:
i
[
7
]
===
undefined
?
""
:
String
(
i
[
7
]),
july
:
i
[
8
]
===
undefined
?
""
:
String
(
i
[
8
]),
august
:
i
[
9
]
===
undefined
?
""
:
String
(
i
[
9
]),
september
:
i
[
10
]
===
undefined
?
""
:
String
(
i
[
10
]),
october
:
i
[
11
]
===
undefined
?
""
:
String
(
i
[
11
]),
november
:
i
[
12
]
===
undefined
?
""
:
String
(
i
[
12
]),
december
:
i
[
13
]
===
undefined
?
""
:
String
(
i
[
13
]),
total_current_year
:
i
[
14
]
===
undefined
?
""
:
String
(
i
[
14
]),
total_next_year
:
i
[
15
]
===
undefined
?
""
:
String
(
i
[
15
]),
total_more_year
:
i
[
16
]
===
undefined
?
""
:
String
(
i
[
16
])
})
}
})
let
rows
=
isi
.
map
((
i
,
index
)
=>
{
return
[
String
(
i
[
0
])
===
'-'
?
4
:
3
,
0
,
0
,
""
,
1
,
i
[
0
]
===
undefined
?
""
:
String
(
i
[
0
]),
i
[
1
]
===
undefined
?
""
:
String
(
i
[
1
]),
i
[
2
]
===
undefined
?
""
:
String
(
i
[
2
]),
i
[
3
]
===
undefined
?
""
:
String
(
i
[
3
]),
i
[
4
]
===
undefined
?
""
:
String
(
i
[
4
]),
i
[
5
]
===
undefined
?
""
:
String
(
i
[
5
]),
i
[
6
]
===
undefined
?
""
:
String
(
i
[
6
]),
i
[
7
]
===
undefined
?
""
:
String
(
i
[
7
]),
i
[
8
]
===
undefined
?
""
:
String
(
i
[
8
]),
i
[
9
]
===
undefined
?
""
:
String
(
i
[
9
]),
i
[
10
]
===
undefined
?
""
:
String
(
i
[
10
]),
i
[
11
]
===
undefined
?
""
:
String
(
i
[
11
]),
i
[
12
]
===
undefined
?
""
:
String
(
i
[
12
]),
i
[
13
]
===
undefined
?
""
:
String
(
i
[
13
]),
i
[
14
]
===
undefined
?
""
:
String
(
i
[
14
]),
i
[
15
]
===
undefined
?
""
:
String
(
i
[
15
]),
i
[
16
]
===
undefined
?
""
:
String
(
i
[
16
])
]
})
let
body
=
{
company_id
:
this
.
props
.
company
.
company_id
,
periode
:
this
.
props
.
periode
,
report_id
:
this
.
props
.
report_id
,
balance_sheet
:
payload
}
// console.log(JSON.stringify(body))
this
.
setState
({
payload
:
body
,
buttonError
:
false
,
judul
:
resp
.
rows
[
1
][
0
]
})
}
});
}
checkUpload
()
{
api
.
create
().
checkUploadMB
(
this
.
state
.
payload
).
then
(
response
=>
{
console
.
log
(
JSON
.
stringify
(
this
.
state
.
payload
));
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
this
.
setState
({
dataLoaded
:
true
,
visibleBalanceSheet
:
false
,
visibleUpload
:
false
})
}
}
})
}
render
()
{
render
()
{
let
dataTable2
=
this
.
state
.
dataTable
let
dataTable2
=
this
.
state
.
dataTable
const
handleChange
=
(
value
,
tableMeta
)
=>
{
const
handleChange
=
(
value
,
tableMeta
)
=>
{
...
@@ -2268,145 +2372,232 @@ export default class BalanceSheet extends Component {
...
@@ -2268,145 +2372,232 @@ export default class BalanceSheet extends Component {
<
/div
>
<
/div
>
{
this
.
state
.
loading
&&
loadingComponent
}
{
this
.
state
.
loading
&&
loadingComponent
}
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
<
Paper
style
=
{{
paddingTop
:
10
,
paddingBottom
:
20
}}
>
{
this
.
state
.
visibleBalanceSheet
===
true
?
<
div
style
=
{{
borderBottom
:
'solid 1px #c4c4c4'
}}
>
<
Paper
style
=
{{
paddingTop
:
10
,
paddingBottom
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'12px'
,
color
:
'#4b4b4b'
,
margin
:
10
}}
>
Budget
Tahunan
-
Balance
Sheet
<
/Typography
>
<
div
style
=
{{
borderBottom
:
'solid 1px #c4c4c4'
}}
>
<
/div
>
<
Typography
style
=
{{
fontSize
:
'12px'
,
color
:
'#4b4b4b'
,
margin
:
10
}}
>
Budget
Tahunan
-
Balance
Sheet
<
/Typography
>
<
div
style
=
{{
padding
:
20
}}
>
<
/div
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'space-between'
}}
>
<
div
style
=
{{
padding
:
20
}}
>
<
div
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'space-between'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
{
this
.
props
.
company
.
company_name
}
<
/Typography
>
<
div
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
Periode
:
{
this
.
props
.
periode
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
{
this
.
props
.
company
.
company_name
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
in
IDR
mn
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
Periode
:
{
this
.
props
.
periode
}
<
/Typography
>
<
/div
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
in
IDR
mn
<
/Typography
>
<
div
style
=
{{
width
:
'50%'
}}
>
<
/div
>
<
div
style
=
{{
justifyContent
:
'flex-end'
,
display
:
'flex'
,
flexFlow
:
'wrap'
}}
>
<
div
style
=
{{
width
:
'50%'
}}
>
<
a
data
-
tip
=
{
'Download Template'
}
data
-
for
=
"template"
>
<
div
style
=
{{
justifyContent
:
'flex-end'
,
display
:
'flex'
,
flexFlow
:
'wrap'
}}
>
<
button
<
a
data
-
tip
=
{
'Download Template'
}
data
-
for
=
"template"
>
style
=
{{
<
button
backgroundColor
:
'transparent'
,
style
=
{{
cursor
:
'pointer'
,
backgroundColor
:
'transparent'
,
borderColor
:
'transparent'
,
cursor
:
'pointer'
,
margin
:
5
borderColor
:
'transparent'
,
}}
margin
:
5
onClick
=
{()
=>
null
}
}}
>
onClick
=
{()
=>
this
.
downloadTemplate
()}
<
img
src
=
{
Images
.
template
}
/
>
>
<
/button
>
<
img
src
=
{
Images
.
template
}
/
>
<
/a
>
<
/button
>
<
ReactTooltip
border
=
{
true
}
id
=
"template"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/a
>
<
a
data
-
tip
=
{
'Upload'
}
data
-
for
=
"upload"
>
<
ReactTooltip
border
=
{
true
}
id
=
"template"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
button
<
a
data
-
tip
=
{
'Upload'
}
data
-
for
=
"upload"
>
style
=
{{
<
button
backgroundColor
:
'transparent'
,
style
=
{{
cursor
:
'pointer'
,
backgroundColor
:
'transparent'
,
borderColor
:
'transparent'
,
cursor
:
'pointer'
,
margin
:
5
borderColor
:
'transparent'
,
}}
margin
:
5
onClick
=
{()
=>
null
}
}}
>
onClick
=
{()
=>
this
.
setState
({
visibleUpload
:
true
})}
<
img
src
=
{
Images
.
upload
}
/
>
>
<
/button
>
<
img
src
=
{
Images
.
upload
}
/
>
<
/a
>
<
/button
>
<
ReactTooltip
border
=
{
true
}
id
=
"upload"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/a
>
<
a
data
-
tip
=
{
'Download'
}
data
-
for
=
"download"
>
<
ReactTooltip
border
=
{
true
}
id
=
"upload"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
button
<
a
data
-
tip
=
{
'Download'
}
data
-
for
=
"download"
>
style
=
{{
<
button
backgroundColor
:
'transparent'
,
style
=
{{
cursor
:
'pointer'
,
backgroundColor
:
'transparent'
,
borderColor
:
'transparent'
,
cursor
:
'pointer'
,
margin
:
5
borderColor
:
'transparent'
,
}}
margin
:
5
onClick
=
{()
=>
null
}
}}
>
onClick
=
{()
=>
null
}
<
img
src
=
{
Images
.
download
}
/
>
>
<
/button
>
<
img
src
=
{
Images
.
download
}
/
>
<
/a
>
<
/button
>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
style
=
{{
marginTop
:
20
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
400
:
150
),
height
:
this
.
props
.
height
-
400
}}
>
<
div
style
=
{{
marginTop
:
20
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
400
:
150
),
height
:
this
.
props
.
height
-
400
}}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
{
!
this
.
state
.
loading
&&
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
<
MUIDataTable
data
=
{
dataTable2
}
data
=
{
dataTable2
}
columns
=
{
columns
}
columns
=
{
columns
}
options
=
{
options
}
options
=
{
options
}
/
>
/
>
<
/MuiThemeProvider
>
<
/MuiThemeProvider>
}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"grid grid-2x"
style
=
{{
marginTop
:
20
}}
>
<
div
className
=
"grid grid-2x"
style
=
{{
marginTop
:
20
}}
>
<
div
className
=
"col-1"
>
<
div
className
=
"col-1"
>
<
button
<
button
type
=
"button"
type
=
"button"
onClick
=
{()
=>
this
.
backToMasterBudget
(
'draft'
)}
onClick
=
{()
=>
this
.
backToMasterBudget
(
'draft'
)}
style
=
{{
style
=
{{
backgroundColor
:
'transparent'
,
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
borderColor
:
'transparent'
,
outline
:
'none'
outline
:
'none'
}}
}}
>
>
<
div
style
=
{{
backgroundColor
:
'#019ce5'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
div
style
=
{{
backgroundColor
:
'#019ce5'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Back
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Back
<
/Typography
>
<
/div
>
<
/div
>
<
/button
>
<
/button
>
<
/div
>
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
}}
>
<
button
className
=
"button"
type
=
"button"
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
outline
:
'none'
}}
onClick
=
{()
=>
{
this
.
props
.
onClickClose
()
}}
>
<
div
style
=
{{
backgroundColor
:
'#fff'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
border
:
'solid 1px #354960'
,
marginRight
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#354960'
,
textAlign
:
'center'
}}
>
Cancel
<
/Typography
>
<
/div
>
<
/button
>
<
button
type
=
"button"
disabled
=
{
this
.
state
.
disabledSave
}
onClick
=
{()
=>
this
.
backToMasterBudget
(
'submitted'
)}
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
this
.
state
.
disabledSave
===
true
?
'default'
:
'pointer'
,
borderColor
:
'transparent'
,
outline
:
'none'
}}
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
marginRight
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Save
<
/Typography
>
<
/div
>
<
/button
>
<
button
className
=
"button"
type
=
"button"
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
outline
:
'none'
}}
onClick
=
{()
=>
{
this
.
setState
({
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
setState
({
loading
:
false
,
disabledSave
:
false
})
},
100
);
})
}}
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Calculate
<
/Typography
>
<
/div
>
<
/button
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
}}
>
<
/Paper
>
<
button
:
className
=
"button"
<
Paper
style
=
{{
paddingTop
:
10
,
paddingBottom
:
20
}}
>
type
=
"button"
<
div
>
style
=
{{
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
}}
>
backgroundColor
:
'transparent'
,
<
label
style
=
{{
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
}}
>
Preview
Data
<
/label
>
cursor
:
'pointer'
,
<
/div
>
borderColor
:
'transparent'
,
<
div
style
=
{{
padding
:
25
}}
>
outline
:
'none'
{
this
.
state
.
dataLoaded
&&
(
}}
<
div
style
=
{{
marginTop
:
20
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
400
:
150
),
height
:
this
.
props
.
height
-
400
}}
>
onClick
=
{()
=>
{
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
this
.
props
.
onClickClose
()
<
MUIDataTable
}}
theme
=
{
getMuiTheme
()}
>
data
=
{
this
.
state
.
rows
}
<
div
style
=
{{
backgroundColor
:
'#fff'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
border
:
'solid 1px #354960'
,
marginRight
:
20
}}
>
columns
=
{
columns
}
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#354960'
,
textAlign
:
'center'
}}
>
Cancel
<
/Typography
>
options
=
{
options
}
<
/div
>
/
>
<
/button
>
<
/MuiThemeProvider
>
<
button
<
/div
>
type
=
"button"
)}
onClick
=
{()
=>
this
.
backToMasterBudget
(
'submitted'
)}
<
/div
>
style
=
{{
<
div
style
=
{{
display
:
'flex'
,
width
:
'100%'
,
placeContent
:
'flex-end'
,
padding
:
20
}}
>
backgroundColor
:
'transparent'
,
<
button
cursor
:
'pointer'
,
type
=
"button"
borderColor
:
'transparent'
,
onClick
=
{()
=>
this
.
setState
({
visibleBalanceSheet
:
true
})}
outline
:
'none'
style
=
{{
marginRight
:
20
}}
}}
>
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
marginRight
:
20
}}
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Cancel
<
/span
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Save
<
/Typography
>
<
/div
>
<
/div
>
<
/button
>
<
/button
>
<
button
<
button
type
=
"button"
className
=
"button"
disabled
=
{
this
.
state
.
buttonError
==
true
?
true
:
false
}
type
=
"button"
onClick
=
{()
=>
null
}
style
=
{{
style
=
{{}}
backgroundColor
:
'transparent'
,
>
cursor
:
'pointer'
,
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
borderColor
:
'transparent'
,
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Save
<
/span
>
outline
:
'none'
<
/div
>
}}
<
/button
>
onClick
=
{()
=>
{
<
/div
>
this
.
forceUpdate
()
<
/div
>
}}
<
/Paper>
}
>
<
/div
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Calculate
<
/Typography
>
{
this
.
state
.
visibleUpload
&&
(
<
div
className
=
"test app-popup-show"
>
<
div
className
=
"popup-content background-white border-radius"
style
=
{{
borderRadius
:
8
}}
>
<
div
className
=
"popup-panel grid grid-2x main-color"
style
=
{{
height
:
64
,
borderTopRightRadius
:
8
,
borderTopLeftRadius
:
8
}}
>
<
div
className
=
"col-1"
style
=
{{
maxWidth
:
"inherit"
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
div
className
=
"popup-title"
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
16
,
fontWeight
:
'bold'
}}
>
Upload
File
<
/span
>
<
/div
>
<
/div
>
<
/button
>
<
/div
>
<
div
className
=
"col-2 content-right"
style
=
{{
maxWidth
:
"inherit"
,
alignSelf
:
'center'
}}
>
<
button
type
=
"button"
className
=
"btn btn-circle btn-white"
onClick
=
{()
=>
this
.
setState
({
visibleUpload
:
false
})}
>
<
img
src
=
{
Images
.
close
}
/
>
<
/button
>
<
/div
>
<
/div
>
<
/div
>
<
UploadFile
type
=
{
this
.
state
.
uploadStatus
}
percentage
=
{
this
.
state
.
percentage
}
result
=
{
this
.
state
.
result
}
acceptedFiles
=
{[
"xlsx"
]}
onHandle
=
{(
dt
)
=>
{
this
.
fileHandler
(
dt
)
this
.
setState
({
uploadStatus
:
'idle'
,
percentage
:
'0'
})
}}
onUpload
=
{()
=>
{
this
.
state
.
judul
===
"MASTER BUDGET - BALANCE SHEET"
?
this
.
checkUpload
()
:
this
.
setState
({
alert
:
true
,
messageAlert
:
"Invalid Template"
,
tipeAlert
:
'warning'
})
}}
/
>
<
/div
>
<
/div
>
<
/
Paper
>
<
/
div
>
<
/div
>
)}
<
/div
>
<
/div
>
);
);
}
}
...
...
src/container/BudgetTahunan/CorporateAnnualTarget.js
View file @
fdf5249e
...
@@ -3,6 +3,11 @@ import { Typography, Paper, createMuiTheme, MuiThemeProvider, TableCell, FormCon
...
@@ -3,6 +3,11 @@ import { Typography, Paper, createMuiTheme, MuiThemeProvider, TableCell, FormCon
import
MUIDataTable
from
'mui-datatables'
;
import
MUIDataTable
from
'mui-datatables'
;
import
NumberFormat
from
'react-number-format'
;
import
NumberFormat
from
'react-number-format'
;
import
api
from
'../../api'
;
import
api
from
'../../api'
;
import
AddIcon
from
'@material-ui/icons/Add'
;
import
{
values
}
from
'ramda'
;
import
PropagateLoader
from
"react-spinners/PropagateLoader"
import
Images
from
'../../assets/Images'
;
import
ReactTooltip
from
'react-tooltip'
;
var
ct
=
require
(
"../../library/CustomTable"
);
var
ct
=
require
(
"../../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
...
@@ -16,9 +21,8 @@ const style = {
...
@@ -16,9 +21,8 @@ const style = {
};
};
const
style2
=
{
const
style2
=
{
position
:
"sticky"
,
position
:
"sticky"
,
left
:
420
,
background
:
"white"
,
background
:
"white"
,
zIndex
:
10
1
zIndex
:
10
0
};
};
export
default
class
CorporateAnnualTarget
extends
Component
{
export
default
class
CorporateAnnualTarget
extends
Component
{
...
@@ -43,6 +47,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -43,6 +47,7 @@ export default class CorporateAnnualTarget extends Component {
}
}
getItemHierarki
()
{
getItemHierarki
()
{
this
.
setState
({
loading
:
true
})
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
),
...
@@ -179,32 +184,32 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -179,32 +184,32 @@ export default class CorporateAnnualTarget extends Component {
}
}
render
()
{
render
()
{
//
let dataTable2 = this.state.dataTable
let
dataTable2
=
this
.
state
.
dataTable
//
const handleChange = (value, tableMeta) => {
const
handleChange
=
(
value
,
tableMeta
)
=>
{
//
let val = String(value).split(",").join("")
let
val
=
String
(
value
).
split
(
","
).
join
(
""
)
//
// let data = this.state.dataTable2
// let data = this.state.dataTable2
//
let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[tableMeta.rowIndex][2])
let
indexParent
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
dataTable2
[
tableMeta
.
rowIndex
][
2
])
//
if (indexParent > 0) {
if
(
indexParent
>
0
)
{
//
// console.log(indexParent)
// console.log(indexParent)
//
let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
let
a
=
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
val
)
//
let jagain = dataTable2[indexParent][tableMeta.columnIndex]
let
jagain
=
dataTable2
[
indexParent
][
tableMeta
.
columnIndex
]
//
a = dataTable2[indexParent][tableMeta.columnIndex] = jagain == undefined ? (0 + Number(val)) : (jagain + Number(val))
a
=
dataTable2
[
indexParent
][
tableMeta
.
columnIndex
]
=
jagain
==
undefined
?
(
0
+
Number
(
val
))
:
(
jagain
+
Number
(
val
))
//
} else {
}
else
{
//
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
val
)
//
}
}
//
}
}
//
const handleValue = (data) => {
const
handleValue
=
(
data
)
=>
{
//
let total = 0
let
total
=
0
//
dataTable2.map((item, index) => {
dataTable2
.
map
((
item
,
index
)
=>
{
//
if (data.rowData[1] == item[2]) {
if
(
data
.
rowData
[
1
]
==
item
[
2
])
{
//
total = item[data.columnIndex] == undefined ? (Number(total) + 0) : (Number(total) + Number(item[data.columnIndex]))
total
=
item
[
data
.
columnIndex
]
==
undefined
?
(
Number
(
total
)
+
0
)
:
(
Number
(
total
)
+
Number
(
item
[
data
.
columnIndex
]))
//
}
}
//
})
})
//
let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[data.rowIndex][2])
let
indexParent
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
dataTable2
[
data
.
rowIndex
][
2
])
//
let a = dataTable2[data.rowIndex][data.columnIndex] = Number(total)
let
a
=
dataTable2
[
data
.
rowIndex
][
data
.
columnIndex
]
=
Number
(
total
)
//
// console.log(indexParent);
// console.log(indexParent);
//
return a
return
a
//
}
}
const
columns
=
[{
const
columns
=
[{
name
:
""
,
name
:
""
,
options
:
{
options
:
{
...
@@ -234,14 +239,14 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -234,14 +239,14 @@ export default class CorporateAnnualTarget extends Component {
name
:
"Key Performance Indicator"
,
name
:
"Key Performance Indicator"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
key
=
{
columnMeta
.
index
}
style
=
{{
...
style
,
top
:
0
,
zIndex
:
102
,
backgroundColor
:
'#
354960
'
,
width
:
388
}}
>
<
TableCell
key
=
{
columnMeta
.
index
}
style
=
{{
...
style
,
top
:
0
,
zIndex
:
102
,
backgroundColor
:
'#
1c71b8
'
,
width
:
388
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
setCellProps
:
()
=>
({
style
}),
setCellProps
:
()
=>
({
style
}),
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
return
(
<
div
style
=
{{
width
:
3
88
}}
>
<
div
style
=
{{
width
:
3
00
}}
>
{
tableMeta
.
rowIndex
==
0
||
tableMeta
.
rowIndex
==
1
?
{
tableMeta
.
rowIndex
==
0
||
tableMeta
.
rowIndex
==
1
?
<
span
style
=
{{
fontSize
:
12
,
fontWeight
:
'bold'
}}
>
{
val
}
<
/span
>
<
span
style
=
{{
fontSize
:
12
,
fontWeight
:
'bold'
}}
>
{
val
}
<
/span
>
:
:
...
@@ -257,24 +262,79 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -257,24 +262,79 @@ export default class CorporateAnnualTarget extends Component {
name
:
"Weight"
,
name
:
"Weight"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
setCellProps
:
()
=>
({
setCellProps
:
()
=>
({
style2
}),
style
:
{
customBodyRender
:
(
value
,
tableMeta
,
updateValue
)
=>
{
position
:
"sticky"
,
return
(
left
:
420
,
<
div
style
=
{{
textAlign
:
'right'
}}
>
background
:
"white"
,
{
tableMeta
.
rowData
[
0
]
===
3
?
zIndex
:
101
<
div
style
=
{{
flex
:
1
}}
>
}
<
FormControlLabel
})
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
value
}
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
console
.
log
(
dataTable2
)
}}
/
>
}
/
>
<
/div>
:
tableMeta
.
rowData
[
0
]
===
2
?
<
span
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
}}
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleValue
(
tableMeta
)}
/
>
<
/span
>
:
tableMeta
.
rowData
[
0
]
===
4
?
null
:
tableMeta
.
rowData
[
0
]
===
6
?
<
span
>
Formula
<
/span
>
:
tableMeta
.
rowData
[
0
]
===
5
?
<
span
>
Formula
Summary
<
/span
>
:
tableMeta
.
rowData
[
0
]
===
1
?
value
===
""
?
null
:
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
value
)}
/
>
:
<
span
>
validasi
<
/span
>
}
<
/div
>
)
}
}
}
},
{
},
{
name
:
"UOM"
,
name
:
"UOM"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#
354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#
1c71b8
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
...
@@ -309,7 +369,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -309,7 +369,7 @@ export default class CorporateAnnualTarget extends Component {
name
:
"Jenis KPI"
,
name
:
"Jenis KPI"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#
354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#
1c71b8
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
...
@@ -325,7 +385,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -325,7 +385,7 @@ export default class CorporateAnnualTarget extends Component {
name
:
"Max Ach."
,
name
:
"Max Ach."
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#
354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#
1c71b8
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
...
@@ -341,7 +401,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -341,7 +401,7 @@ export default class CorporateAnnualTarget extends Component {
name
:
"Formula YTD"
,
name
:
"Formula YTD"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#
354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#
1c71b8
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
...
@@ -357,9 +417,9 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -357,9 +417,9 @@ export default class CorporateAnnualTarget extends Component {
name
:
"2020"
,
name
:
"2020"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#37b5e6
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white
'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'black
'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
customBodyRender
:
(
val
)
=>
{
customBodyRender
:
(
val
)
=>
{
return
(
return
(
...
@@ -373,7 +433,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -373,7 +433,7 @@ export default class CorporateAnnualTarget extends Component {
name
:
"Jan 2021"
,
name
:
"Jan 2021"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#
354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#
1c71b8
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
...
@@ -389,7 +449,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -389,7 +449,7 @@ export default class CorporateAnnualTarget extends Component {
name
:
"Feb 2021"
,
name
:
"Feb 2021"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#
354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#
1c71b8
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
...
@@ -405,7 +465,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -405,7 +465,7 @@ export default class CorporateAnnualTarget extends Component {
name
:
"Mar 2021"
,
name
:
"Mar 2021"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#
354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#
1c71b8
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
...
@@ -421,7 +481,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -421,7 +481,7 @@ export default class CorporateAnnualTarget extends Component {
name
:
"Apr 2021"
,
name
:
"Apr 2021"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#
354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#
1c71b8
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
...
@@ -437,7 +497,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -437,7 +497,7 @@ export default class CorporateAnnualTarget extends Component {
name
:
"May 2021"
,
name
:
"May 2021"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#
354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#
1c71b8
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
...
@@ -453,7 +513,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -453,7 +513,7 @@ export default class CorporateAnnualTarget extends Component {
name
:
"Jun 2021"
,
name
:
"Jun 2021"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#
354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#
1c71b8
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
...
@@ -469,7 +529,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -469,7 +529,7 @@ export default class CorporateAnnualTarget extends Component {
name
:
"Jul 2021"
,
name
:
"Jul 2021"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#
354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#
1c71b8
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
...
@@ -485,7 +545,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -485,7 +545,7 @@ export default class CorporateAnnualTarget extends Component {
name
:
"Aug 2021"
,
name
:
"Aug 2021"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#
354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#
1c71b8
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
...
@@ -501,7 +561,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -501,7 +561,7 @@ export default class CorporateAnnualTarget extends Component {
name
:
"Sep 2021"
,
name
:
"Sep 2021"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#
354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#
1c71b8
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
...
@@ -517,7 +577,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -517,7 +577,7 @@ export default class CorporateAnnualTarget extends Component {
name
:
"Oct 2021"
,
name
:
"Oct 2021"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#
354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#
1c71b8
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
...
@@ -533,7 +593,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -533,7 +593,7 @@ export default class CorporateAnnualTarget extends Component {
name
:
"Nop 2021"
,
name
:
"Nop 2021"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#
354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#
1c71b8
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
...
@@ -549,7 +609,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -549,7 +609,7 @@ export default class CorporateAnnualTarget extends Component {
name
:
"Dec 2021"
,
name
:
"Dec 2021"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#
354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#
1c71b8
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
...
@@ -565,7 +625,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -565,7 +625,7 @@ export default class CorporateAnnualTarget extends Component {
name
:
"2021 Total"
,
name
:
"2021 Total"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#
354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#
1c71b8
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
...
@@ -581,7 +641,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -581,7 +641,7 @@ export default class CorporateAnnualTarget extends Component {
name
:
"2022 Total"
,
name
:
"2022 Total"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#
354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#
1c71b8
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
...
@@ -597,7 +657,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -597,7 +657,7 @@ export default class CorporateAnnualTarget extends Component {
name
:
"2023 Total"
,
name
:
"2023 Total"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#
354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#
1c71b8
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
...
@@ -613,7 +673,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -613,7 +673,7 @@ export default class CorporateAnnualTarget extends Component {
name
:
"Strategic Initiative"
,
name
:
"Strategic Initiative"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#
354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#
1c71b8
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
...
@@ -629,7 +689,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -629,7 +689,7 @@ export default class CorporateAnnualTarget extends Component {
name
:
"PIC"
,
name
:
"PIC"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#
354960
'
,
width
:
96
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#
1c71b8
'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
<
/TableCell
>
),
),
...
@@ -643,12 +703,23 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -643,12 +703,23 @@ export default class CorporateAnnualTarget extends Component {
}
}
}
}
]
]
const
loadingComponent
=
(
<
div
style
=
{{
position
:
'absolute'
,
zIndex
:
110
,
top
:
0
,
left
:
0
,
width
:
'100%'
,
height
:
'100%'
,
display
:
'flex'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
background
:
'rgba(255,255,255,0.8)'
}}
>
<
PropagateLoader
// css={override}
size
=
{
20
}
color
=
{
"#274B80"
}
loading
=
{
this
.
state
.
loading
}
/
>
<
/div
>
);
return
(
return
(
<
div
style
=
{{
height
:
this
.
props
.
height
,
backgroundColor
:
'#f8f8f8'
,
marginBottom
:
100
,
minHeight
:
1000
}}
>
<
div
style
=
{{
height
:
this
.
props
.
height
,
backgroundColor
:
'#f8f8f8'
,
marginBottom
:
100
,
minHeight
:
1000
}}
>
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
78
,
flex
:
1
,
display
:
'flex'
,
alignItems
:
'center'
,
paddingLeft
:
20
}}
>
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
78
,
flex
:
1
,
display
:
'flex'
,
alignItems
:
'center'
,
paddingLeft
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Pengajuan
Budget
Tahunan
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Pengajuan
Budget
Tahunan
<
/Typography
>
<
/div
>
<
/div
>
{
/* {this.state.loading && loadingComponent} */
}
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
<
Paper
style
=
{{
paddingTop
:
10
,
paddingBottom
:
20
}}
>
<
Paper
style
=
{{
paddingTop
:
10
,
paddingBottom
:
20
}}
>
<
div
style
=
{{
borderBottom
:
'solid 1px #c4c4c4'
}}
>
<
div
style
=
{{
borderBottom
:
'solid 1px #c4c4c4'
}}
>
...
@@ -689,10 +760,10 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -689,10 +760,10 @@ export default class CorporateAnnualTarget extends Component {
<
/button
>
<
/button
>
<
/div
>
<
/div
>
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
}}
>
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
}}
>
<
div
style
=
{{
backgroundColor
:
'#fff'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
border
:
'solid 1px #
354960
'
,
marginRight
:
20
}}
>
<
div
style
=
{{
backgroundColor
:
'#fff'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
border
:
'solid 1px #
1c71b8
'
,
marginRight
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#
354960
'
,
textAlign
:
'center'
}}
>
Cancel
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#
1c71b8
'
,
textAlign
:
'center'
}}
>
Cancel
<
/Typography
>
<
/div
>
<
/div
>
<
div
style
=
{{
backgroundColor
:
'#
354960
'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
marginRight
:
20
}}
>
<
div
style
=
{{
backgroundColor
:
'#
1c71b8
'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
marginRight
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Save
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Save
<
/Typography
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
...
src/container/MasterData/Perusahaan/Perusahaan.js
View file @
fdf5249e
...
@@ -576,7 +576,7 @@ export default class Perusahaan extends Component {
...
@@ -576,7 +576,7 @@ export default class Perusahaan extends Component {
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'edit'
)}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'edit'
)}
>
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
{
!
tableMeta
.
rowData
[
2
].
includes
(
"
TI
A"
)
?
{
!
tableMeta
.
rowData
[
2
].
includes
(
"
PT TRIPUTRA INVESTINDO ARY
A"
)
?
<
img
src
=
{
Images
.
editCopy
}
/>
:
<
img
src
=
{
Images
.
editCopy
}
/>
:
null
null
}
}
...
@@ -600,7 +600,7 @@ export default class Perusahaan extends Component {
...
@@ -600,7 +600,7 @@ export default class Perusahaan extends Component {
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'delete'
)}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'delete'
)}
>
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
{
!
tableMeta
.
rowData
[
2
].
includes
(
"
TI
A"
)
?
{
!
tableMeta
.
rowData
[
2
].
includes
(
"
PT TRIPUTRA INVESTINDO ARY
A"
)
?
<
img
src
=
{
Images
.
delete
}
/>
:
<
img
src
=
{
Images
.
delete
}
/>
:
null
null
}
}
...
...
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