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
1c026c14
Commit
1c026c14
authored
Sep 28, 2020
by
Dida Adams Arizona
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'didam' into 'master'
apdet malem2 sebelum bubu See merge request
!383
parents
e0731415
2b6ad044
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
342 additions
and
170 deletions
+342
-170
index.js
src/api/index.js
+5
-2
CorporateAnnualTarget.js
src/container/BudgetTahunan/CorporateAnnualTarget.js
+31
-3
HomePage.js
src/container/HomePage.js
+18
-3
OperatingIndicator.js
src/container/OprIndicator/OperatingIndicator.js
+9
-0
OperatingIndicatorDetail.js
src/container/OprIndicator/OperatingIndicatorDetail.js
+279
-162
No files found.
src/api/index.js
View file @
1c026c14
...
@@ -201,13 +201,14 @@ const create = (type = "") => {
...
@@ -201,13 +201,14 @@ const create = (type = "") => {
const
countingFormula
=
(
body
)
=>
api
.
post
(
'transaction/counting_formula'
,
body
)
const
countingFormula
=
(
body
)
=>
api
.
post
(
'transaction/counting_formula'
,
body
)
const
submitMasterBudget
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/submit_master_budget'
,
body
)
const
submitMasterBudget
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/submit_master_budget'
,
body
)
const
getIdDeleteFromExcel
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/delete_from_excel'
,
body
)
const
getOpetratingIndID
=
(
body
)
=>
api
.
post
(
'transaction/get_operating_indicator_id'
,
body
)
const
getOpetratingIndID
=
(
body
)
=>
api
.
post
(
'transaction/get_operating_indicator_id'
,
body
)
const
getAllOperatingInd
=
(
body
)
=>
api
.
post
(
'transaction/get_all_operating_indicator_report'
,
body
)
const
getAllOperatingInd
=
(
body
)
=>
api
.
post
(
'transaction/get_all_operating_indicator_report'
,
body
)
const
getOperatingIndDetail
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/get_operating_indicator_report_hierarki'
,
body
)
const
getOperatingIndDetail
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/get_operating_indicator_report_hierarki'
,
body
)
const
createOpetaingInd
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/create_submission_report'
,
body
)
const
createOpetaingInd
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/create_submission_report'
,
body
)
const
checkUploadOperatingInd
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/check_import'
,
body
)
const
checkUploadOperatingInd
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/check_import'
,
body
)
const
uploadOperatingInd
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/import_operating_indicator'
,
body
)
const
uploadOperatingInd
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/import_operating_indicator'
,
body
)
const
getDashboard
=
(
body
)
=>
api
.
get
(
'transaction/master_budget/get_dashboard'
)
//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
}
`
)
...
@@ -354,7 +355,9 @@ const create = (type = "") => {
...
@@ -354,7 +355,9 @@ const create = (type = "") => {
uploadOperatingInd
,
uploadOperatingInd
,
getLastestUpdateMB
,
getLastestUpdateMB
,
countingFormula
,
countingFormula
,
submitMasterBudget
submitMasterBudget
,
getIdDeleteFromExcel
,
getDashboard
}
}
}
}
...
...
src/container/BudgetTahunan/CorporateAnnualTarget.js
View file @
1c026c14
...
@@ -284,6 +284,19 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -284,6 +284,19 @@ export default class CorporateAnnualTarget extends Component {
}
}
checkUpload
()
{
checkUpload
()
{
let
dataDelete
=
this
.
state
.
dataDelete
api
.
create
().
getIdDeleteFromExcel
(
this
.
state
.
payload
).
then
((
response
)
=>
{
if
(
response
.
data
)
{
let
idDelete
=
response
.
data
.
data
.
item_report_id
if
(
idDelete
.
length
>
0
)
{
idDelete
.
map
((
item
,
index
)
=>
{
dataDelete
.
push
(
item
)
})
this
.
setState
({
dataDelete
})
}
}
})
api
.
create
().
checkUploadMB
(
this
.
state
.
payload
).
then
(
response
=>
{
api
.
create
().
checkUploadMB
(
this
.
state
.
payload
).
then
(
response
=>
{
// console.log(JSON.stringify(this.state.payload));
// console.log(JSON.stringify(this.state.payload));
console
.
log
(
response
)
console
.
log
(
response
)
...
@@ -343,11 +356,24 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -343,11 +356,24 @@ export default class CorporateAnnualTarget extends Component {
}
}
uploadCAT
(
type
)
{
uploadCAT
(
type
)
{
let
payload
=
{
"item_report_id"
:
this
.
state
.
dataDelete
}
if
(
this
.
state
.
dataDelete
.
length
>
0
)
{
api
.
create
().
deleteAllItemReport
(
payload
).
then
((
response
)
=>
{
this
.
functionUpload
(
type
)
})
}
else
{
this
.
functionUpload
(
type
)
}
}
functionUpload
(
type
)
{
let
data
=
[]
let
data
=
[]
console
.
log
(
this
.
state
.
dataTable
)
console
.
log
(
this
.
state
.
dataTable
)
this
.
state
.
dataTable
.
map
(
i
=>
{
this
.
state
.
dataTable
.
map
(
i
=>
{
data
.
push
({
data
.
push
({
"item_report_id"
:
i
[
0
],
"item_report_id"
:
i
[
1
],
"item_report"
:
String
(
i
[
6
]),
"item_report"
:
String
(
i
[
6
]),
"weight"
:
String
(
i
[
7
]),
"weight"
:
String
(
i
[
7
]),
"uom"
:
String
(
i
[
8
]),
"uom"
:
String
(
i
[
8
]),
...
@@ -534,6 +560,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -534,6 +560,7 @@ export default class CorporateAnnualTarget extends Component {
// })
// })
})
})
}
else
{
}
else
{
console
.
log
(
'sini jing'
)
// api.create().validateSubmitReport(payloadBro).then((response) => {
// api.create().validateSubmitReport(payloadBro).then((response) => {
// console.log(response)
// console.log(response)
// if (response.data.data.result) {
// if (response.data.data.result) {
...
@@ -732,7 +759,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -732,7 +759,7 @@ export default class CorporateAnnualTarget extends Component {
const
handleAction
=
(
idParent
)
=>
{
const
handleAction
=
(
idParent
)
=>
{
if
(
idParent
!==
null
)
{
if
(
idParent
!==
null
)
{
let
indexsss
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
idParent
)
let
indexsss
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
idParent
)
if
(
dataTable2
[
indexsss
][
6
]
==
'CUSTOMER PERSPECTIVE'
||
dataTable2
[
indexsss
][
6
]
==
'INTERNAL PERSPECTIVE'
)
{
if
(
dataTable2
[
indexsss
][
6
]
==
'CUSTOMER PERSPECTIVE'
||
dataTable2
[
indexsss
][
6
]
==
'INTERNAL
BUSINESS PROCESS
PERSPECTIVE'
)
{
return
true
return
true
}
else
{
}
else
{
return
false
return
false
...
@@ -1901,7 +1928,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -1901,7 +1928,7 @@ export default class CorporateAnnualTarget extends Component {
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
{
this
.
state
.
visibleCAT
?
<
Paper
style
=
{{
paddingTop
:
10
,
paddingBottom
:
20
}}
>
{
this
.
state
.
visibleCAT
?
<
Paper
style
=
{{
paddingTop
:
10
,
paddingBottom
:
20
}}
>
<
div
style
=
{{
borderBottom
:
'solid 1px #c4c4c4'
}}
>
<
div
style
=
{{
borderBottom
:
'solid 1px #c4c4c4'
}}
>
<
Typography
style
=
{{
fontSize
:
'12px'
,
color
:
'#4b4b4b'
,
margin
:
10
}}
>
Master
Budget
Submission
-
Corporate
Annual
Target
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'12px'
,
color
:
'#4b4b4b'
,
margin
:
10
}}
>
Master
Budget
-
Corporate
Annual
Target
<
/Typography
>
<
/div
>
<
/div
>
<
div
style
=
{{
padding
:
20
}}
>
<
div
style
=
{{
padding
:
20
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'space-between'
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'space-between'
}}
>
...
@@ -2068,6 +2095,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -2068,6 +2095,7 @@ export default class CorporateAnnualTarget extends Component {
<
/div
>
<
/div
>
{
this
.
state
.
dataLoaded
&&
(
{
this
.
state
.
dataLoaded
&&
(
<
div
style
=
{{
marginTop
:
20
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
400
:
150
)
}}
>
<
div
style
=
{{
marginTop
:
20
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
400
:
150
)
}}
>
{
this
.
state
.
loading
&&
loadingComponent
}
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
<
MUIDataTable
data
=
{
dataTable2
}
data
=
{
dataTable2
}
...
...
src/container/HomePage.js
View file @
1c026c14
...
@@ -13,7 +13,8 @@ class HomePage extends Component {
...
@@ -13,7 +13,8 @@ class HomePage extends Component {
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
this
.
state
=
{
this
.
state
=
{
userData
:
null
userData
:
null
,
listDashboard
:
[]
}
}
}
}
...
@@ -28,10 +29,24 @@ class HomePage extends Component {
...
@@ -28,10 +29,24 @@ class HomePage extends Component {
}
}
}
}
})
})
this
.
getDashboard
()
}
getDashboard
()
{
let
listDashboard
=
[]
api
.
create
().
getDashboard
().
then
((
response
)
=>
{
if
(
String
(
response
.
data
.
status
).
toLocaleLowerCase
()
==
'success'
)
{
let
data
=
response
.
data
.
data
data
.
map
((
item
,
index
)
=>
{
listDashboard
.
push
([
index
+
1
,
item
.
approval_id
,
item
.
company_name
,
`
${
item
.
type_report
}
-
${
item
.
periode
}
`
,
item
.
revision
,
item
.
status
])
})
this
.
setState
({
listDashboard
})
}
})
}
}
render
()
{
render
()
{
const
columns
=
[
"#"
,
"
Nama Perusahaan
"
,
"Revisi"
,
"Status"
,
{
const
columns
=
[
"#"
,
"
ID"
,
"Nama Perusahaan"
,
"Jenis Report
"
,
"Revisi"
,
"Status"
,
{
name
:
"Action"
,
name
:
"Action"
,
options
:
{
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
...
@@ -123,7 +138,7 @@ class HomePage extends Component {
...
@@ -123,7 +138,7 @@ class HomePage extends Component {
<
div
>
<
div
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
<
MUIDataTable
data
=
{
data
}
data
=
{
this
.
state
.
listDashboard
}
columns
=
{
columns
}
columns
=
{
columns
}
options
=
{
options
}
options
=
{
options
}
/
>
/
>
...
...
src/container/OprIndicator/OperatingIndicator.js
View file @
1c026c14
...
@@ -261,6 +261,12 @@ export default class OperatingIndicator extends Component {
...
@@ -261,6 +261,12 @@ export default class OperatingIndicator extends Component {
})
})
}
}
saveOperatingInd
(
payload
)
{
api
.
create
().
createOpetaingInd
(
payload
).
then
((
response
)
=>
{
this
.
getReport
()
})
}
render
()
{
render
()
{
const
columns
=
[
"#"
,
"Jenis Laporan"
,
const
columns
=
[
"#"
,
"Jenis Laporan"
,
// {
// {
...
@@ -453,6 +459,9 @@ export default class OperatingIndicator extends Component {
...
@@ -453,6 +459,9 @@ export default class OperatingIndicator extends Component {
height
=
{
this
.
props
.
height
}
height
=
{
this
.
props
.
height
}
width
=
{
this
.
props
.
width
}
width
=
{
this
.
props
.
width
}
onClickClose
=
{()
=>
this
.
setState
({
visibleDetailOpt
:
false
,
visibleOperatingIndicator
:
true
},
this
.
forceUpdate
())}
onClickClose
=
{()
=>
this
.
setState
({
visibleDetailOpt
:
false
,
visibleOperatingIndicator
:
true
},
this
.
forceUpdate
())}
getReport
=
{()
=>
this
.
getReport
()}
saveOperatingInd
=
{
this
.
saveOperatingInd
.
bind
(
this
)}
/
>
/
>
}
}
...
...
src/container/OprIndicator/OperatingIndicatorDetail.js
View file @
1c026c14
...
@@ -43,7 +43,7 @@ export default class BalanceSheet extends Component {
...
@@ -43,7 +43,7 @@ export default class BalanceSheet extends Component {
// ["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"],
],
],
visible
BalanceSheet
:
true
,
visible
OI
:
true
,
disabledSave
:
true
disabledSave
:
true
}
}
this
.
handleValue
=
this
.
handleValue
.
bind
(
this
)
this
.
handleValue
=
this
.
handleValue
.
bind
(
this
)
...
@@ -66,9 +66,10 @@ export default class BalanceSheet extends Component {
...
@@ -66,9 +66,10 @@ export default class BalanceSheet extends Component {
}
}
console
.
log
(
payload
)
console
.
log
(
payload
)
api
.
create
().
getOperatingIndDetail
(
payload
).
then
(
response
=>
{
api
.
create
().
getOperatingIndDetail
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
let
dataTable
=
[]
let
dataTable
=
[]
let
res
=
response
.
data
.
data
let
res
=
response
.
data
.
data
console
.
log
(
res
)
//
console.log(res)
const
handlePushChild
=
(
item
)
=>
{
const
handlePushChild
=
(
item
)
=>
{
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
if
(
indexIDzz
===
-
1
)
{
if
(
indexIDzz
===
-
1
)
{
...
@@ -141,7 +142,7 @@ export default class BalanceSheet extends Component {
...
@@ -141,7 +142,7 @@ export default class BalanceSheet extends Component {
}
}
createData
()
{
createData
(
type
)
{
let
payloadMB
=
[]
let
payloadMB
=
[]
this
.
state
.
dataTable
.
map
((
item
,
index
)
=>
{
this
.
state
.
dataTable
.
map
((
item
,
index
)
=>
{
payloadMB
.
push
({
payloadMB
.
push
({
...
@@ -167,14 +168,13 @@ export default class BalanceSheet extends Component {
...
@@ -167,14 +168,13 @@ export default class BalanceSheet extends Component {
"report_id"
:
this
.
props
.
data
.
report_id
,
"report_id"
:
this
.
props
.
data
.
report_id
,
"company_id"
:
this
.
props
.
data
.
company
.
company_id
,
"company_id"
:
this
.
props
.
data
.
company
.
company_id
,
"periode"
:
this
.
props
.
data
.
periode
,
"periode"
:
this
.
props
.
data
.
periode
,
"status"
:
"submitted"
,
"status"
:
type
,
"master_budget"
:
payloadMB
"master_budget"
:
payloadMB
}
}
console
.
log
(
'========================='
)
console
.
log
(
'========================='
)
console
.
log
(
JSON
.
stringify
(
payload
))
console
.
log
(
JSON
.
stringify
(
payload
))
api
.
create
().
createOpetaingInd
(
payload
).
then
((
response
)
=>
{
this
.
props
.
saveOperatingInd
(
payload
)
console
.
log
(
response
)
this
.
props
.
onClickClose
()
})
}
}
handleValue
(
data
)
{
handleValue
(
data
)
{
...
@@ -242,15 +242,35 @@ export default class BalanceSheet extends Component {
...
@@ -242,15 +242,35 @@ export default class BalanceSheet extends Component {
downloadTemplate
=
async
()
=>
{
downloadTemplate
=
async
()
=>
{
let
res
=
await
fetch
(
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
}
`
`https://tia.eksad.com/tia-reporting-dev/public/transaction/operating_indicator/download_template?report_id=
${
this
.
props
.
data
.
report_id
}
&&company_id=
${
this
.
props
.
data
.
company
.
company_id
}
&&year=
${
this
.
props
.
data
.
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 Master Budget Operating Indicator.xlsx'
;
a
.
click
();
}
}
async
downloadAllData
()
{
console
.
log
(
'masuk'
)
// let bram = [this.props.submissionID,this.props.report_id,this.props.company.company_id,this.props.periode,this.props.revision]
// console.log(bram)
let
res
=
await
fetch
(
`https://tia.eksad.com/tia-reporting-dev/transaction/operating_indicator/export_master_budget?operating_indicator_id=&&report_id=
${
this
.
props
.
data
.
operatingIndID
}
&company_id=
${
this
.
props
.
data
.
company
.
company_id
}
&&year=
${
this
.
props
.
data
.
periode
}
`
)
)
res
=
await
res
.
blob
()
res
=
await
res
.
blob
()
console
.
log
(
res
)
console
.
log
(
res
)
this
.
setState
({
loading
:
false
})
if
(
res
.
size
>
0
)
{
if
(
res
.
size
>
0
)
{
let
url
=
window
.
URL
.
createObjectURL
(
res
);
let
url
=
window
.
URL
.
createObjectURL
(
res
);
let
a
=
document
.
createElement
(
'a'
);
let
a
=
document
.
createElement
(
'a'
);
a
.
href
=
url
;
a
.
href
=
url
;
a
.
download
=
'
Template Balance Sheet
.xlsx'
;
a
.
download
=
'
Master Budget Operating Indicator
.xlsx'
;
a
.
click
();
a
.
click
();
}
}
}
}
...
@@ -270,46 +290,46 @@ export default class BalanceSheet extends Component {
...
@@ -270,46 +290,46 @@ export default class BalanceSheet extends Component {
isi
.
map
((
i
,
index
)
=>
{
isi
.
map
((
i
,
index
)
=>
{
if
(
i
.
length
>
0
)
{
if
(
i
.
length
>
0
)
{
payload
.
push
({
payload
.
push
({
item_report_id
:
i
[
0
]
===
undefined
?
"
"
:
String
(
i
[
0
]).
trim
(),
order
:
i
[
0
]
===
undefined
?
"0
"
:
String
(
i
[
0
]).
trim
(),
item_report
:
i
[
1
]
===
undefined
?
"
"
:
String
(
i
[
1
]).
trim
(),
item_report
_id
:
i
[
1
]
===
undefined
?
"0
"
:
String
(
i
[
1
]).
trim
(),
total_actual_before
:
i
[
2
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
2
]))
===
false
?
"0"
:
String
(
i
[
2
]).
trim
(),
item_report
:
i
[
2
]
===
undefined
?
"0"
:
String
(
i
[
2
]).
trim
(),
january
:
i
[
3
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
3
]))
===
false
?
"0
"
:
String
(
i
[
3
]).
trim
(),
uom
:
i
[
3
]
===
undefined
?
"
"
:
String
(
i
[
3
]).
trim
(),
february
:
i
[
4
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
4
]))
===
false
?
"0"
:
String
(
i
[
4
]).
trim
(),
// total_actual_before
: i[4] === undefined ? "0" : reg.test(String(i[4])) === false ? "0" : String(i[4]).trim(),
march
:
i
[
5
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
5
]))
===
false
?
"0"
:
String
(
i
[
5
]).
trim
(),
january
:
i
[
4
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
4
]))
===
false
?
"0"
:
String
(
i
[
4
]).
trim
(),
april
:
i
[
6
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
6
]))
===
false
?
"0"
:
String
(
i
[
6
]).
trim
(),
february
:
i
[
5
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
5
]))
===
false
?
"0"
:
String
(
i
[
5
]).
trim
(),
ma
y
:
i
[
7
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
7
]))
===
false
?
"0"
:
String
(
i
[
7
]).
trim
(),
ma
rch
:
i
[
6
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
6
]))
===
false
?
"0"
:
String
(
i
[
6
]).
trim
(),
june
:
i
[
8
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
8
]))
===
false
?
"0"
:
String
(
i
[
8
]).
trim
(),
april
:
i
[
7
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
7
]))
===
false
?
"0"
:
String
(
i
[
7
]).
trim
(),
july
:
i
[
9
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
9
]))
===
false
?
"0"
:
String
(
i
[
9
]).
trim
(),
may
:
i
[
8
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
8
]))
===
false
?
"0"
:
String
(
i
[
8
]).
trim
(),
august
:
i
[
10
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
10
]))
===
false
?
"0"
:
String
(
i
[
10
]).
trim
(),
june
:
i
[
9
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
9
]))
===
false
?
"0"
:
String
(
i
[
9
]).
trim
(),
september
:
i
[
11
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
11
]))
===
false
?
"0"
:
String
(
i
[
11
]).
trim
(),
july
:
i
[
10
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
10
]))
===
false
?
"0"
:
String
(
i
[
10
]).
trim
(),
october
:
i
[
12
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
12
]))
===
false
?
"0"
:
String
(
i
[
12
]).
trim
(),
august
:
i
[
11
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
11
]))
===
false
?
"0"
:
String
(
i
[
11
]).
trim
(),
november
:
i
[
13
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
13
]))
===
false
?
"0"
:
String
(
i
[
13
]).
trim
(),
september
:
i
[
12
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
12
]))
===
false
?
"0"
:
String
(
i
[
12
]).
trim
(),
december
:
i
[
14
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
14
]))
===
false
?
"0"
:
String
(
i
[
14
]).
trim
(),
october
:
i
[
13
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
13
]))
===
false
?
"0"
:
String
(
i
[
13
]).
trim
(),
total_current_year
:
i
[
15
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
15
]))
===
false
?
"0"
:
String
(
i
[
15
]).
trim
(),
november
:
i
[
14
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
14
]))
===
false
?
"0"
:
String
(
i
[
14
]).
trim
(),
total_next_year
:
i
[
16
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
16
]))
===
false
?
"0"
:
String
(
i
[
16
]).
trim
(),
december
:
i
[
15
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
15
]))
===
false
?
"0"
:
String
(
i
[
15
]).
trim
(),
total_
more_year
:
i
[
17
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
17
]))
===
false
?
"0"
:
String
(
i
[
17
]).
trim
()
total_
current_year
:
i
[
16
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
16
]))
===
false
?
"0"
:
String
(
i
[
16
]).
trim
(),
})
})
}
}
})
})
let
body
=
{
let
body
=
{
company_id
:
this
.
props
.
company
.
company_id
,
company_id
:
this
.
props
.
data
.
company
.
company_id
,
periode
:
this
.
props
.
periode
,
periode
:
this
.
props
.
data
.
periode
,
report_id
:
this
.
props
.
report_id
,
report_id
:
this
.
props
.
data
.
report_id
,
master_budget
:
payload
master_budget
:
payload
}
}
// console.log(JSON.stringify(body)
)
console
.
log
(
resp
.
rows
[
1
][
0
]
)
this
.
setState
({
payload
:
body
,
buttonError
:
false
,
judul
:
resp
.
rows
[
1
][
0
]
})
this
.
setState
({
payload
:
body
,
buttonError
:
false
,
judul
:
resp
.
rows
[
1
][
0
]
})
}
}
});
});
}
}
checkUpload
()
{
checkUpload
()
{
api
.
create
().
checkUpload
MB
(
this
.
state
.
payload
).
then
(
response
=>
{
api
.
create
().
checkUpload
OperatingInd
(
this
.
state
.
payload
).
then
(
response
=>
{
console
.
log
(
JSON
.
stringify
(
this
.
state
.
payload
));
//
console.log(JSON.stringify(this.state.payload));
console
.
log
(
response
)
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
this
.
setState
({
visibleUpload
:
false
,
visible
BalanceSheet
:
false
,
loading
:
true
})
this
.
setState
({
visibleUpload
:
false
,
visible
OI
:
false
,
loading
:
true
})
let
dataTable
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
let
dataTable
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
return
[
return
[
item
.
type_report_id
,
item
.
type_report_id
,
...
@@ -318,6 +338,7 @@ export default class BalanceSheet extends Component {
...
@@ -318,6 +338,7 @@ export default class BalanceSheet extends Component {
item
.
formula
,
item
.
formula
,
item
.
level
,
item
.
level
,
item
.
item_report
,
item
.
item_report
,
item
.
uom
,
item
.
total_actual_before
,
item
.
total_actual_before
,
item
.
january
,
item
.
january
,
item
.
february
,
item
.
february
,
...
@@ -343,33 +364,83 @@ export default class BalanceSheet extends Component {
...
@@ -343,33 +364,83 @@ export default class BalanceSheet extends Component {
})
})
}
}
uploadOI
(
type
)
{
let
data
=
[]
console
.
log
(
this
.
state
.
dataTable
)
this
.
state
.
dataTable
.
map
(
i
=>
{
data
.
push
({
"item_report_id"
:
i
[
1
],
"item_report"
:
String
(
i
[
5
]),
"total_actual_before"
:
String
(
i
[
7
]),
"january"
:
String
(
i
[
8
]),
"february"
:
String
(
i
[
9
]),
"march"
:
String
(
i
[
10
]),
"april"
:
String
(
i
[
11
]),
"may"
:
String
(
i
[
12
]),
"june"
:
String
(
i
[
13
]),
"july"
:
String
(
i
[
14
]),
"august"
:
String
(
i
[
15
]),
"september"
:
String
(
i
[
16
]),
"october"
:
String
(
i
[
17
]),
"november"
:
String
(
i
[
18
]),
"december"
:
String
(
i
[
19
]),
"total_current_year"
:
String
(
i
[
20
])
})
})
let
body
=
{
company_id
:
this
.
props
.
data
.
company
.
company_id
,
periode
:
this
.
props
.
data
.
periode
,
report_id
:
this
.
props
.
data
.
report_id
,
status
:
type
,
master_budget
:
data
}
console
.
log
(
data
);
console
.
log
(
JSON
.
stringify
(
body
))
api
.
create
(
'UPLOAD'
).
uploadOperatingInd
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
props
.
onClickClose
()
this
.
props
.
getReport
()
}
else
{
alert
(
response
.
data
.
status
)
}
}
else
{
alert
(
response
.
problem
)
}
})
}
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
total
=
0
let
indexParent
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
dataTable2
[
tableMeta
.
rowIndex
][
2
]
)
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
val
)
if
(
indexParent
>
0
)
{
dataTable2
[
tableMeta
.
rowIndex
].
map
((
item
,
index
)
=>
{
// console.log(indexParent)
if
(
index
>=
8
&&
index
<=
19
)
{
let
a
=
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
val
)
let
valItem
=
item
==
undefined
||
item
==
""
?
0
:
item
let
jagain
=
dataTable2
[
indexParent
][
tableMeta
.
columnIndex
]
total
+=
Number
(
valItem
)
a
=
dataTable2
[
indexParent
][
tableMeta
.
columnIndex
]
=
jagain
==
undefined
?
(
0
+
Number
(
val
))
:
(
jagain
+
Number
(
val
))
}
}
else
{
}
)
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
val
)
dataTable2
[
tableMeta
.
rowIndex
][
20
]
=
total
}
console
.
log
(
dataTable2
[
tableMeta
.
rowIndex
])
}
}
const
handleValue
=
(
data
)
=>
{
const
handleValue
=
(
value
,
tableMeta
)
=>
{
let
val
=
String
(
value
).
split
(
","
).
join
(
""
)
let
total
=
0
let
total
=
0
dataTable2
.
map
((
item
,
index
)
=>
{
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
val
)
if
(
data
.
rowData
[
1
]
==
item
[
2
])
{
dataTable2
[
tableMeta
.
rowIndex
].
map
((
item
,
index
)
=>
{
total
=
item
[
data
.
columnIndex
]
==
undefined
?
(
Number
(
total
)
+
0
)
:
(
Number
(
total
)
+
Number
(
item
[
data
.
columnIndex
]))
if
(
index
>=
8
&&
index
<=
19
)
{
let
valItem
=
item
==
undefined
||
item
==
""
?
0
:
item
total
+=
Number
(
valItem
)
}
}
})
})
let
indexParent
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
dataTable2
[
data
.
rowIndex
][
2
])
dataTable2
[
tableMeta
.
rowIndex
][
20
]
=
total
let
a
=
dataTable2
[
data
.
rowIndex
][
data
.
columnIndex
]
=
Number
(
total
)
return
total
// console.log(indexParent);
return
a
}
}
const
handleFormula
=
(
data
,
tableMeta
)
=>
{
const
handleFormula
=
(
data
,
tableMeta
)
=>
{
let
arrayFormula
=
tableMeta
.
rowData
[
3
].
match
(
/
[
a-zA-Z
]
+|
[
0-9
]
+|
[
-!$%^&*()_+|~=`{}
\[\]
:";'<>?,.
\/]
+
(?:\.[
0-9
]
+@|
)
/g
)
let
arrayFormula
=
tableMeta
.
rowData
[
3
].
match
(
/
[
a-zA-Z
]
+|
[
0-9
]
+|
[
-!$%^&*()_+|~=`{}
\[\]
:";'<>?,.
\/]
+
(?:\.[
0-9
]
+@|
)
/g
)
let
arrayJumlah
=
[]
let
arrayJumlah
=
[]
...
@@ -503,13 +574,27 @@ export default class BalanceSheet extends Component {
...
@@ -503,13 +574,27 @@ export default class BalanceSheet extends Component {
customBodyRender
:
(
value
,
tableMeta
,
updateValue
)
=>
{
customBodyRender
:
(
value
,
tableMeta
,
updateValue
)
=>
{
return
(
return
(
<
div
style
=
{{
textAlign
:
'right'
}}
>
<
div
style
=
{{
textAlign
:
'right'
}}
>
<
NumberFormat
<
FormControlLabel
thousandSeparator
=
{
true
}
style
=
{{
margin
:
0
}}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
// value={value}
type
=
"text"
control
=
{
placeholder
=
""
<
Input
disabled
=
{
true
}
disableUnderline
=
{
true
}
value
=
{
value
}
style
=
{{
fontSize
:
12
,
textAlign
:
'center'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
,
marginTop
:
-
10
}}
type
=
"text"
placeholder
=
""
defaultValue
=
{
value
}
color
=
{
"#5198ea"
}
value
=
{
value
}
disabled
=
{
true
}
// onBlur={(event) => {
// console.log(event.target.value)
// // updateValue(event.target.value)
// handleChangeText(event.target.value, tableMeta)
// console.log(dataTable2)
// }}
/
>
}
/
>
/
>
<
/div
>
<
/div
>
)
)
...
@@ -540,7 +625,7 @@ export default class BalanceSheet extends Component {
...
@@ -540,7 +625,7 @@ export default class BalanceSheet extends Component {
}
}
}
}
},
{
},
{
name
:
"Jan 2021"
,
name
:
`Jan
${
this
.
props
.
data
.
periode
}
`
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
...
@@ -581,7 +666,7 @@ export default class BalanceSheet extends Component {
...
@@ -581,7 +666,7 @@ export default class BalanceSheet extends Component {
}
}
}
}
,
{
,
{
name
:
"Feb 2021"
,
name
:
`Feb
${
this
.
props
.
data
.
periode
}
`
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
...
@@ -621,7 +706,7 @@ export default class BalanceSheet extends Component {
...
@@ -621,7 +706,7 @@ export default class BalanceSheet extends Component {
}
}
}
}
},
{
},
{
name
:
"Mar 2021"
,
name
:
`Mar
${
this
.
props
.
data
.
periode
}
`
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
...
@@ -661,7 +746,7 @@ export default class BalanceSheet extends Component {
...
@@ -661,7 +746,7 @@ export default class BalanceSheet extends Component {
}
}
}
}
},
{
},
{
name
:
"Apr 2021"
,
name
:
`Apr
${
this
.
props
.
data
.
periode
}
`
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
...
@@ -701,7 +786,7 @@ export default class BalanceSheet extends Component {
...
@@ -701,7 +786,7 @@ export default class BalanceSheet extends Component {
}
}
}
}
},
{
},
{
name
:
"May 2021"
,
name
:
`May
${
this
.
props
.
data
.
periode
}
`
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
...
@@ -741,7 +826,7 @@ export default class BalanceSheet extends Component {
...
@@ -741,7 +826,7 @@ export default class BalanceSheet extends Component {
}
}
}
}
},
{
},
{
name
:
"Jun 2021"
,
name
:
`Jun
${
this
.
props
.
data
.
periode
}
`
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
...
@@ -781,7 +866,7 @@ export default class BalanceSheet extends Component {
...
@@ -781,7 +866,7 @@ export default class BalanceSheet extends Component {
}
}
}
}
},
{
},
{
name
:
"Jul 2021"
,
name
:
`Jul
${
this
.
props
.
data
.
periode
}
`
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
...
@@ -821,7 +906,7 @@ export default class BalanceSheet extends Component {
...
@@ -821,7 +906,7 @@ export default class BalanceSheet extends Component {
}
}
}
}
},
{
},
{
name
:
"Aug 2021"
,
name
:
`Aug
${
this
.
props
.
data
.
periode
}
`
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
...
@@ -861,7 +946,7 @@ export default class BalanceSheet extends Component {
...
@@ -861,7 +946,7 @@ export default class BalanceSheet extends Component {
}
}
}
}
},
{
},
{
name
:
"Sep 2021"
,
name
:
`Sep
${
this
.
props
.
data
.
periode
}
`
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
...
@@ -901,7 +986,7 @@ export default class BalanceSheet extends Component {
...
@@ -901,7 +986,7 @@ export default class BalanceSheet extends Component {
}
}
}
}
},
{
},
{
name
:
"Oct 2021"
,
name
:
`Oct
${
this
.
props
.
data
.
periode
}
`
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
...
@@ -941,7 +1026,7 @@ export default class BalanceSheet extends Component {
...
@@ -941,7 +1026,7 @@ export default class BalanceSheet extends Component {
}
}
}
}
},
{
},
{
name
:
"Nov 2021"
,
name
:
`Nov
${
this
.
props
.
data
.
periode
}
`
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
...
@@ -981,7 +1066,7 @@ export default class BalanceSheet extends Component {
...
@@ -981,7 +1066,7 @@ export default class BalanceSheet extends Component {
}
}
}
}
},
{
},
{
name
:
"Dec 2021"
,
name
:
`Dec
${
this
.
props
.
data
.
periode
}
`
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#1c71b8'
,
width
:
96
}}
>
...
@@ -1021,7 +1106,7 @@ export default class BalanceSheet extends Component {
...
@@ -1021,7 +1106,7 @@ export default class BalanceSheet extends Component {
}
}
}
}
},
{
},
{
name
:
"31 Dec 2022 Total"
,
name
:
`31 Dec
${
this
.
props
.
data
.
periode
}
\nTotal`
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#37b5e6'
,
width
:
96
}}
>
<
TableCell
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
99
,
backgroundColor
:
'#37b5e6'
,
width
:
96
}}
>
...
@@ -1032,7 +1117,7 @@ export default class BalanceSheet extends Component {
...
@@ -1032,7 +1117,7 @@ export default class BalanceSheet extends Component {
customBodyRender
:
(
value
,
tableMeta
,
updateValue
)
=>
{
customBodyRender
:
(
value
,
tableMeta
,
updateValue
)
=>
{
return
(
return
(
<
div
style
=
{{
textAlign
:
'right'
}}
>
<
div
style
=
{{
textAlign
:
'right'
}}
>
{
tableMeta
.
rowData
[
0
]
===
4
?
{
tableMeta
.
rowData
[
0
]
===
4
?
null
null
:
:
<
div
style
=
{{
flex
:
1
}}
>
<
div
style
=
{{
flex
:
1
}}
>
...
@@ -1045,7 +1130,8 @@ export default class BalanceSheet extends Component {
...
@@ -1045,7 +1130,8 @@ export default class BalanceSheet extends Component {
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
value
=
{
value
}
value
=
{
handleValue
(
value
,
tableMeta
)}
disabled
=
{
true
}
onBlur
=
{(
event
)
=>
{
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
handleChange
(
event
.
target
.
value
,
tableMeta
)
...
@@ -1082,20 +1168,19 @@ export default class BalanceSheet extends Component {
...
@@ -1082,20 +1168,19 @@ export default class BalanceSheet extends Component {
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
Tahuna
n
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Master
Budget
Submissio
n
<
/Typography
>
<
/div
>
<
/div
>
{
this
.
state
.
loading
&&
loadingComponent
}
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
{
this
.
state
.
visible
BalanceSheet
===
true
?
{
this
.
state
.
visible
OI
===
true
?
<
Paper
style
=
{{
paddingTop
:
10
,
paddingBottom
:
20
}}
>
<
Paper
style
=
{{
paddingTop
:
10
,
paddingBottom
:
20
}}
>
<
div
style
=
{{
borderBottom
:
'solid 1px #c4c4c4'
}}
>
<
div
style
=
{{
borderBottom
:
'solid 1px #c4c4c4'
}}
>
<
Typography
style
=
{{
fontSize
:
'12px'
,
color
:
'#4b4b4b'
,
margin
:
10
}}
>
Budget
Tahunan
-
Operating
Indicator
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'12px'
,
color
:
'#4b4b4b'
,
margin
:
10
}}
>
Master
Budget
-
Operating
Indicator
<
/Typography
>
<
/div
>
<
/div
>
<
div
style
=
{{
padding
:
20
}}
>
<
div
style
=
{{
padding
:
20
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'space-between'
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'space-between'
}}
>
<
div
>
<
div
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
{
this
.
props
.
data
.
company
.
company_name
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
{
this
.
props
.
data
.
company
.
company_name
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
Period
e
:
{
this
.
props
.
data
.
periode
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
Period
:
{
this
.
props
.
data
.
periode
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
in
IDR
mn
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
in
IDR
mn
<
/Typography
>
<
/div
>
<
/div
>
<
div
style
=
{{
width
:
'50%'
}}
>
<
div
style
=
{{
width
:
'50%'
}}
>
...
@@ -1136,7 +1221,7 @@ export default class BalanceSheet extends Component {
...
@@ -1136,7 +1221,7 @@ export default class BalanceSheet extends Component {
borderColor
:
'transparent'
,
borderColor
:
'transparent'
,
margin
:
5
margin
:
5
}}
}}
onClick
=
{()
=>
null
}
onClick
=
{()
=>
this
.
downloadAllData
()
}
>
>
<
img
src
=
{
Images
.
download
}
/
>
<
img
src
=
{
Images
.
download
}
/
>
<
/button
>
<
/button
>
...
@@ -1147,87 +1232,86 @@ export default class BalanceSheet extends Component {
...
@@ -1147,87 +1232,86 @@ export default class BalanceSheet extends Component {
<
/div
>
<
/div
>
<
div
style
=
{{
marginTop
:
20
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
400
:
150
)
}}
>
<
div
style
=
{{
marginTop
:
20
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
400
:
150
)
}}
>
{
!
this
.
state
.
loading
&&
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
{
this
.
state
.
loading
&&
loadingComponent
}
<
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"
>
<
div
className
=
"col-1"
>
<
div
className
=
"col-1"
>
<
button
<
button
className
=
"button"
type
=
"button"
type
=
"button"
onClick
=
{()
=>
this
.
backToMasterBudget
(
'draft'
)}
style
=
{{
style
=
{{
backgroundColor
:
'transparent'
,
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
borderColor
:
'transparent'
,
outline
:
'none'
}}
}}
onClick
=
{()
=>
this
.
setState
({
loading
:
true
,
visibleOI
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
getDataDetail
()
},
100
)
})}
>
>
<
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'
}}
>
Cancel
<
/Typography
>
<
/div
>
<
/div
>
<
/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%'
}}
>
<
button
<
button
className
=
"button"
type
=
"button"
type
=
"button"
style
=
{{
onClick
=
{()
=>
backgroundColor
:
'transparent'
,
this
.
setState
({
loading
:
true
},
()
=>
{
cursor
:
'pointer'
,
setTimeout
(()
=>
{
borderColor
:
'transparent'
,
this
.
setState
({
loading
:
false
,
buttonError
:
false
})
outline
:
'none'
,
},
100
);
marginRight
:
20
})
}}
}
onClick
=
{()
=>
{
style
=
{{
marginRight
:
20
}}
this
.
props
.
onClickClose
()
}}
>
>
<
div
style
=
{{
backgroundColor
:
'#fff'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
border
:
'solid 1px #354960'
}}
>
<
div
style
=
{{
backgroundColor
:
'#fff'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
border
:
'solid 1px #354960'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#354960'
,
textAlign
:
'center'
}}
>
Ca
ncel
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#354960'
,
textAlign
:
'center'
}}
>
Ca
lculate
<
/Typography
>
<
/div
>
<
/div
>
<
/button
>
<
/button
>
<
button
<
button
className
=
"button"
className
=
"button"
type
=
"button"
type
=
"button"
disabled
=
{
this
.
state
.
buttonError
}
style
=
{{
style
=
{{
backgroundColor
:
'transparent'
,
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
cursor
:
this
.
state
.
buttonError
===
true
?
'default'
:
'pointer'
,
borderColor
:
'transparent'
,
borderColor
:
'transparent'
,
outline
:
'none'
,
outline
:
'none'
,
marginRight
:
20
marginRight
:
20
}}
}}
onClick
=
{()
=>
{
onClick
=
{()
=>
this
.
setState
({
loading
:
true
},
()
=>
{
this
.
setState
({
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
createData
(
"draft"
)
this
.
setState
({
loading
:
false
,
disabledSave
:
false
})
},
100
);
},
100
);
})}
})
}}
>
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
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
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Save
as
Draft
<
/Typography
>
<
/div
>
<
/div
>
<
/button
>
<
/button
>
<
button
<
button
type
=
"button"
type
=
"button"
// disabled={this.state.disabledSave}
disabled
=
{
this
.
state
.
buttonError
}
onClick
=
{()
=>
this
.
createData
()}
onClick
=
{()
=>
this
.
setState
({
loading
:
true
},
()
=>
{
style
=
{{
setTimeout
(()
=>
{
backgroundColor
:
'transparent'
,
this
.
createData
(
"submitted"
)
cursor
:
this
.
state
.
disabledSave
===
true
?
'default'
:
'pointer'
,
},
100
);
borderColor
:
'transparent'
,
})}
outline
:
'none'
,
// marginRight: 20
}}
>
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Save
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Save
&
Complete
<
/Typography
>
<
/div
>
<
/div
>
<
/button
>
<
/button
>
<
/div
>
<
/div
>
...
@@ -1238,63 +1322,96 @@ export default class BalanceSheet extends Component {
...
@@ -1238,63 +1322,96 @@ export default class BalanceSheet extends Component {
<
div
>
<
div
>
<
div
style
=
{{
padding
:
25
}}
>
<
div
style
=
{{
padding
:
25
}}
>
<
div
>
<
div
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
{
this
.
props
.
company
.
company_name
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
{
this
.
props
.
data
.
company
.
company_name
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
Period
e
:
{
this
.
props
.
periode
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
Period
:
{
this
.
props
.
data
.
periode
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
in
IDR
mn
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
in
IDR
mn
<
/Typography
>
<
/div
>
<
/div
>
{
this
.
state
.
dataLoaded
&&
(
{
this
.
state
.
dataLoaded
&&
(
<
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
}}
>
{
!
this
.
state
.
loading
&&
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
{
this
.
state
.
loading
&&
loadingComponent
}
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
<
MUIDataTable
data
=
{
dataTable2
}
data
=
{
dataTable2
}
columns
=
{
columns
}
columns
=
{
columns
}
options
=
{
options
}
options
=
{
options
}
/
>
/
>
<
/MuiThemeProvider>
}
<
/MuiThemeProvider
>
<
/div
>
<
/div
>
)}
)}
<
/div
>
<
/div
>
<
div
style
=
{{
display
:
'flex'
,
width
:
'100%'
,
placeContent
:
'flex-end'
,
padding
:
20
}}
>
<
div
className
=
"grid grid-2x"
>
<
button
<
div
className
=
"col-1"
>
type
=
"button"
<
button
onClick
=
{()
=>
this
.
setState
({
visibleBalanceSheet
:
true
},
()
=>
this
.
getItemHierarki
())}
className
=
"button"
style
=
{{
marginRight
:
20
}}
type
=
"button"
>
style
=
{{
<
div
style
=
{{
backgroundColor
:
'#fff'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
border
:
'solid 1px #354960'
}}
>
backgroundColor
:
'transparent'
,
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#354960'
,
textAlign
:
'center'
}}
>
Cancel
<
/Typography
>
cursor
:
'pointer'
,
<
/div
>
borderColor
:
'transparent'
,
<
/button
>
}}
<
button
onClick
=
{()
=>
type
=
"button"
this
.
setState
({
loading
:
true
,
visibleOI
:
true
},
()
=>
{
disabled
=
{
this
.
state
.
buttonError
==
true
?
true
:
false
}
onClick
=
{()
=>
null
}
style
=
{{
marginRight
:
20
}}
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
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
(()
=>
{
setTimeout
(()
=>
{
this
.
setState
({
loading
:
false
,
buttonError
:
false
})
this
.
getDataDetail
()
},
100
)
})}
>
<
div
style
=
{{
backgroundColor
:
'#019ce5'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Cancel
<
/Typography
>
<
/div
>
<
/button
>
<
/div
>
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
}}
>
<
button
type
=
"button"
onClick
=
{()
=>
this
.
setState
({
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
setState
({
loading
:
false
,
buttonError
:
false
})
},
100
);
})
}
style
=
{{
marginRight
:
20
}}
>
<
div
style
=
{{
backgroundColor
:
'#fff'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
,
border
:
'solid 1px #354960'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#354960'
,
textAlign
:
'center'
}}
>
Calculate
<
/Typography
>
<
/div
>
<
/button
>
<
button
className
=
"button"
type
=
"button"
disabled
=
{
this
.
state
.
buttonError
}
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
this
.
state
.
buttonError
===
true
?
'default'
:
'pointer'
,
borderColor
:
'transparent'
,
outline
:
'none'
,
marginRight
:
20
}}
onClick
=
{()
=>
this
.
setState
({
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
uploadOI
(
"draft"
)
},
100
);
},
100
);
})
})}
}}
>
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Save
as
Draft
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Calculate
<
/Typography
>
<
/div
>
<
/div
>
<
/button
>
<
/button
>
<
button
type
=
"button"
disabled
=
{
this
.
state
.
buttonError
}
onClick
=
{()
=>
this
.
setState
({
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
uploadOI
(
"submitted"
)
},
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'
}}
>
Save
&
Complete
<
/Typography
>
<
/div
>
<
/button
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/Paper>
}
<
/Paper>
}
...
@@ -1329,7 +1446,7 @@ export default class BalanceSheet extends Component {
...
@@ -1329,7 +1446,7 @@ export default class BalanceSheet extends Component {
this
.
setState
({
uploadStatus
:
'idle'
,
percentage
:
'0'
})
this
.
setState
({
uploadStatus
:
'idle'
,
percentage
:
'0'
})
}}
}}
onUpload
=
{()
=>
{
onUpload
=
{()
=>
{
this
.
state
.
judul
===
"
MASTER BUDGET - OPERATING INDICATOR
"
?
this
.
state
.
judul
===
"
OPERATING INDICATOR - MASTER BUDGET
"
?
this
.
checkUpload
()
:
this
.
checkUpload
()
:
this
.
setState
({
alert
:
true
,
messageAlert
:
"Invalid Template"
,
tipeAlert
:
'warning'
})
this
.
setState
({
alert
:
true
,
messageAlert
:
"Invalid Template"
,
tipeAlert
:
'warning'
})
}}
}}
...
...
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