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
fcc1a02e
Commit
fcc1a02e
authored
Sep 21, 2020
by
Dida Adams Arizona
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'didam' into 'master'
apdet See merge request
!347
parents
1ce85757
f6c68730
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
25 deletions
+77
-25
index.js
src/api/index.js
+3
-1
CorporateAnnualTarget.js
src/container/BudgetTahunan/CorporateAnnualTarget.js
+74
-24
No files found.
src/api/index.js
View file @
fcc1a02e
...
@@ -195,6 +195,7 @@ const create = (type = "") => {
...
@@ -195,6 +195,7 @@ const create = (type = "") => {
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
)
const
checkUploadMB
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/check_import'
,
body
)
const
uploadMasterBudget
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/import_master_budget'
,
body
)
const
uploadMasterBudget
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/import_master_budget'
,
body
)
const
validateSubmitReport
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/validate_save'
,
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
)
...
@@ -339,7 +340,8 @@ const create = (type = "") => {
...
@@ -339,7 +340,8 @@ const create = (type = "") => {
getAllSettingByType
,
getAllSettingByType
,
getOpetratingIndID
,
getOpetratingIndID
,
createAllItemReport
,
createAllItemReport
,
deleteAllItemReport
deleteAllItemReport
,
validateSubmitReport
}
}
}
}
...
...
src/container/BudgetTahunan/CorporateAnnualTarget.js
View file @
fcc1a02e
...
@@ -195,9 +195,12 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -195,9 +195,12 @@ export default class CorporateAnnualTarget extends Component {
async
downloadAllData
()
{
async
downloadAllData
()
{
console
.
log
(
'masuk'
)
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
(
let
res
=
await
fetch
(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=
${
this
.
props
.
submissionID
}
&&report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&revision=
${
this
.
props
.
revision
}
`
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=
${
this
.
props
.
submissionID
}
&&report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&revision=
${
this
.
props
.
revision
}
`
)
)
res
=
await
res
.
blob
()
res
=
await
res
.
blob
()
console
.
log
(
res
)
console
.
log
(
res
)
this
.
setState
({
loading
:
false
})
this
.
setState
({
loading
:
false
})
...
@@ -332,9 +335,9 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -332,9 +335,9 @@ export default class CorporateAnnualTarget extends Component {
"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
]),
"kpi_type"
:
String
(
i
[
9
].
value
)
==
undefined
||
String
(
i
[
9
])
==
null
?
String
(
i
[
9
])
:
(
String
(
i
[
9
].
value
)
==
undefined
?
String
(
i
[
9
].
value
)
:
String
(
i
[
9
].
value
))
,
"kpi_type"
:
i
[
9
]
==
null
?
""
:
i
[
9
].
value
,
"max_ach"
:
String
(
i
[
10
].
value
)
==
undefined
||
String
(
i
[
10
])
==
null
?
String
(
i
[
10
])
:
(
String
(
i
[
10
].
value
)
==
undefined
?
String
(
i
[
10
].
value
)
:
String
(
i
[
10
].
value
))
,
"max_ach"
:
i
[
10
]
==
null
?
""
:
i
[
10
].
value
,
"formula"
:
String
(
i
[
11
].
value
)
==
undefined
||
String
(
i
[
11
])
==
null
?
String
(
i
[
11
])
:
(
String
(
i
[
11
].
value
)
==
undefined
?
String
(
i
[
11
].
value
)
:
String
(
i
[
11
].
value
))
,
"formula"
:
i
[
11
]
==
null
?
""
:
i
[
11
].
value
,
"total_actual_before"
:
String
(
i
[
12
]),
"total_actual_before"
:
String
(
i
[
12
]),
"january"
:
String
(
i
[
13
]),
"january"
:
String
(
i
[
13
]),
"february"
:
String
(
i
[
14
]),
"february"
:
String
(
i
[
14
]),
...
@@ -558,6 +561,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -558,6 +561,7 @@ export default class CorporateAnnualTarget extends Component {
const
handleChangeText
=
(
value
,
tableMeta
)
=>
{
const
handleChangeText
=
(
value
,
tableMeta
)
=>
{
console
.
log
(
value
)
console
.
log
(
value
)
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
value
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
value
// this.setState({dataTable: dataTable2})
}
}
const
handleValue
=
(
data
)
=>
{
const
handleValue
=
(
data
)
=>
{
...
@@ -717,6 +721,11 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -717,6 +721,11 @@ export default class CorporateAnnualTarget extends Component {
options
:
{
options
:
{
filter
:
false
,
filter
:
false
,
display
:
this
.
state
.
visibleCAT
,
display
:
this
.
state
.
visibleCAT
,
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
key
=
{
columnMeta
.
index
}
style
=
{{
...
style
,
top
:
0
,
zIndex
:
102
,
backgroundColor
:
'#dbdbdb'
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'left'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
return
(
// handleAction(tableMeta.rowData[2]) &&
// handleAction(tableMeta.rowData[2]) &&
...
@@ -747,7 +756,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -747,7 +756,7 @@ export default class CorporateAnnualTarget extends Component {
backgroundColor
:
'transparent'
,
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
borderColor
:
'transparent'
,
marginLeft
:
10
marginLeft
:
5
}}
}}
onClick
=
{()
=>
{
onClick
=
{()
=>
{
this
.
setState
({
loading
:
true
})
this
.
setState
({
loading
:
true
})
...
@@ -773,6 +782,28 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -773,6 +782,28 @@ export default class CorporateAnnualTarget extends Component {
setCellProps
:
()
=>
({
style
}),
setCellProps
:
()
=>
({
style
}),
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
return
(
tableMeta
.
rowData
[
1
]
==
""
?
<
div
style
=
{{
textAlign
:
'left'
,
paddingLeft
:
20
*
Number
(
tableMeta
.
rowData
[
4
])
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
control
=
{
<
Input
disableUnderline
=
{
true
}
style
=
{{
color
:
tableMeta
.
rowData
[
1
]
==
""
?
"#5198ea"
:
"black"
,
fontSize
:
12
,
textAlign
:
'left'
,
borderColor
:
'transparent'
,
margin
:
0
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
defaultValue
=
{
val
}
// disabled={!handleAction(tableMeta.rowData[2])}
onBlur
=
{(
event
)
=>
{
console
.
log
(
event
.
target
.
value
)
handleChangeText
(
event
.
target
.
value
,
tableMeta
)
console
.
log
(
dataTable2
)
}}
/
>
}
/
>
<
/div
>
:
<
div
style
=
{{
width
:
300
}}
>
<
div
style
=
{{
width
:
300
}}
>
{
tableMeta
.
rowData
[
22
]
?
{
tableMeta
.
rowData
[
22
]
?
tableMeta
.
rowData
[
22
].
length
>
0
?
tableMeta
.
rowData
[
22
].
length
>
0
?
...
@@ -877,31 +908,30 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -877,31 +908,30 @@ export default class CorporateAnnualTarget extends Component {
null
:
null
:
<
FormControlLabel
<
FormControlLabel
style
=
{{
margin
:
0
}}
style
=
{{
margin
:
0
}}
value
=
{
value
}
//
value={value}
control
=
{
control
=
{
<
TextField
<
Input
InputProps
=
{{
disableUnderline
:
true
}}
disableUnderline
=
{
true
}
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
defaultValue
=
{
value
}
disabled
=
{
!
handleAction
(
tableMeta
.
rowData
[
2
])}
disabled
=
{
!
handleAction
(
tableMeta
.
rowData
[
2
])}
value
=
{
value
}
onChange
=
{(
event
)
=>
{
onChange
=
{(
event
)
=>
{
// console.log(event.target.value)
// // updateValue(event.target.value)
// handleChangeText(event.target.value, tableMeta)
// console.log(dataTable2)
}}
}}
onBlur
=
{(
event
)
=>
{
onBlur
=
{(
event
)
=>
{
let
abc
=
''
abc
=
event
.
target
.
value
console
.
log
(
abc
)
console
.
log
(
event
.
target
.
value
)
console
.
log
(
event
.
target
.
value
)
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
event
.
target
.
value
// updateValue(event.target.value)
// updateValue(event.target.value)
// handleChangeText(event.target.value, tableMeta)
handleChangeText
(
event
.
target
.
value
,
tableMeta
)
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = event.target.value
console
.
log
(
dataTable2
)
// this.setState({dataTable: dataTable2})
}}
}}
/
>
/
>
}
}
/
>
/
>
}
}
<
/div
>
<
/div
>
)
)
...
@@ -931,7 +961,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -931,7 +961,7 @@ export default class CorporateAnnualTarget extends Component {
style
=
{{
padding
:
0
,
margin
:
0
}}
style
=
{{
padding
:
0
,
margin
:
0
}}
renderInput
=
{(
params
)
=>
renderInput
=
{(
params
)
=>
<
div
ref
=
{
params
.
InputProps
.
ref
}
style
=
{{
padding
:
0
,
margin
:
0
}}
>
<
div
ref
=
{
params
.
InputProps
.
ref
}
style
=
{{
padding
:
0
,
margin
:
0
}}
>
<
input
style
=
{{
borderColor
:
'white'
,
width
:
96
,
textAlign
:
'center'
,
padding
:
0
,
margin
:
0
}}
type
=
"text"
{...
params
.
inputProps
}
/
>
<
input
style
=
{{
borderColor
:
'white'
,
width
:
96
,
textAlign
:
'center'
,
padding
:
0
,
margin
:
0
,
color
:
handleAction
(
tableMeta
.
rowData
[
2
])?
"#5198ea"
:
"black"
}}
type
=
"text"
{...
params
.
inputProps
}
/
>
<
/div
>
<
/div
>
}
}
/
>
/
>
...
@@ -965,7 +995,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -965,7 +995,7 @@ export default class CorporateAnnualTarget extends Component {
disabled
=
{
!
handleAction
(
tableMeta
.
rowData
[
2
])}
disabled
=
{
!
handleAction
(
tableMeta
.
rowData
[
2
])}
renderInput
=
{(
params
)
=>
renderInput
=
{(
params
)
=>
<
div
ref
=
{
params
.
InputProps
.
ref
}
style
=
{{
padding
:
0
,
margin
:
0
}}
>
<
div
ref
=
{
params
.
InputProps
.
ref
}
style
=
{{
padding
:
0
,
margin
:
0
}}
>
<
input
style
=
{{
borderColor
:
'white'
,
width
:
96
,
textAlign
:
'center'
,
padding
:
0
,
margin
:
0
}}
type
=
"text"
{...
params
.
inputProps
}
/
>
<
input
style
=
{{
borderColor
:
'white'
,
width
:
96
,
textAlign
:
'center'
,
padding
:
0
,
margin
:
0
,
color
:
handleAction
(
tableMeta
.
rowData
[
2
])?
"#5198ea"
:
"black"
}}
type
=
"text"
{...
params
.
inputProps
}
/
>
<
/div
>
<
/div
>
}
}
// value={this.state.parent}
// value={this.state.parent}
...
@@ -1002,7 +1032,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -1002,7 +1032,7 @@ export default class CorporateAnnualTarget extends Component {
style
=
{{
padding
:
0
,
margin
:
0
}}
style
=
{{
padding
:
0
,
margin
:
0
}}
renderInput
=
{(
params
)
=>
renderInput
=
{(
params
)
=>
<
div
ref
=
{
params
.
InputProps
.
ref
}
style
=
{{
padding
:
0
,
margin
:
0
}}
>
<
div
ref
=
{
params
.
InputProps
.
ref
}
style
=
{{
padding
:
0
,
margin
:
0
}}
>
<
input
style
=
{{
borderColor
:
'white'
,
width
:
96
,
textAlign
:
'center'
,
padding
:
0
,
margin
:
0
}}
type
=
"text"
{...
params
.
inputProps
}
/
>
<
input
style
=
{{
borderColor
:
'white'
,
width
:
96
,
textAlign
:
'center'
,
padding
:
0
,
margin
:
0
,
color
:
handleAction
(
tableMeta
.
rowData
[
2
])?
"#5198ea"
:
"black"
}}
type
=
"text"
{...
params
.
inputProps
}
/
>
<
/div
>
<
/div
>
}
}
// value={this.state.parent}
// value={this.state.parent}
...
@@ -1527,11 +1557,31 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -1527,11 +1557,31 @@ export default class CorporateAnnualTarget extends Component {
<
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
>
),
),
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
ue
,
tableMeta
)
=>
{
return
(
return
(
<
div
style
=
{{
width
:
96
}}
>
<
div
style
=
{{
width
:
96
}}
>
{
tableMeta
.
rowData
[
0
]
===
1
||
tableMeta
.
rowData
[
0
]
===
2
||
tableMeta
.
rowData
[
0
]
===
4
?
{
tableMeta
.
rowData
[
0
]
===
1
||
tableMeta
.
rowData
[
0
]
===
2
||
tableMeta
.
rowData
[
0
]
===
4
?
null
:
val
}
null
:
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
value
}
disabled
=
{
true
}
// onBlur={(event) => {
// // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
// }}
/
>
}
/>
}
<
/div
>
<
/div
>
)
)
}
}
...
...
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