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
d9ebeac5
Commit
d9ebeac5
authored
Feb 24, 2021
by
rifkaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
list md cat
parent
2f5785b5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
289 deletions
+8
-289
CreateMasterDataCAT.js
...container/MasterData/MasterDataCAT/CreateMasterDataCAT.js
+0
-281
EditMasterDataCAT.js
src/container/MasterData/MasterDataCAT/EditMasterDataCAT.js
+8
-1
MasterDataCAT.js
src/container/MasterData/MasterDataCAT/MasterDataCAT.js
+0
-7
No files found.
src/container/MasterData/MasterDataCAT/CreateMasterDataCAT.js
View file @
d9ebeac5
...
...
@@ -32,16 +32,6 @@ export default class CreateMasterDataCAT extends Component {
}
componentDidMount
()
{
this
.
getInputType
()
this
.
getPerusahaan
()
this
.
getReportType
()
// this.getParent()
let
date
=
format
(
new
Date
,
'yyyy-MM-dd'
)
// console.log(date);
this
.
setState
({
startDate
:
date
,
endDate
:
date
})
this
.
getPeriode
()
this
.
getDetailUser
()
}
...
...
@@ -225,255 +215,6 @@ export default class CreateMasterDataCAT extends Component {
this
.
props
.
createReportItems
(
payload
)
}
getKPIType
()
{
let
body
=
{
group
:
'CAT'
,
company_id
:
this
.
state
.
company
.
company_id
,
type
:
'KPI_TYPE'
}
api
.
create
().
getAllSettingByType
(
body
).
then
(
response
=>
{
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
inputKPI
=
data
.
map
((
item
)
=>
{
return
{
value
:
item
.
value
}
})
let
defaultProps
=
{
options
:
inputKPI
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
value
),
};
this
.
setState
({
listKPI
:
defaultProps
,
inputKPI
:
response
.
data
.
data
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
// alert(response.data.message)
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
})
}
getMaxAch
()
{
let
body
=
{
group
:
'CAT'
,
company_id
:
this
.
state
.
company
.
company_id
,
type
:
'MAX_ACHIEVEMENT'
}
api
.
create
().
getAllSettingByType
(
body
).
then
(
response
=>
{
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
inputMaxAch
=
data
.
map
((
item
)
=>
{
return
{
value
:
item
.
value
}
})
let
defaultProps
=
{
options
:
inputMaxAch
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
value
),
};
this
.
setState
({
listMaxAch
:
defaultProps
,
inputMaxAch
:
response
.
data
.
data
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
// alert(response.data.message)
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
})
}
getInputType
()
{
api
.
create
().
getInputType
().
then
((
response
)
=>
{
// console.log(response.data)
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
inputData
=
data
.
map
((
item
)
=>
{
return
{
type_item_report_id
:
item
.
type_item_report_id
,
type_item_report_name
:
item
.
type_item_report_name
}
})
let
defaultProps
=
{
options
:
inputData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
type_item_report_name
),
};
this
.
setState
({
listInputType
:
defaultProps
,
inputData
:
response
.
data
.
data
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
// alert(response.data.message)
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
})
}
getPerusahaan
()
{
api
.
create
().
getPerusahaanActive
().
then
((
response
)
=>
{
// console.log(response)
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
companyData
=
data
.
map
((
item
)
=>
{
return
{
company_id
:
item
.
company_id
,
company_name
:
item
.
company_name
}
})
companyData
.
push
({
company_id
:
0
,
company_name
:
'Default'
})
let
typeProps
=
{
options
:
companyData
.
sort
((
a
,
b
)
=>
a
.
company_id
-
b
.
company_id
),
getOptionLabel
:
(
option
)
=>
option
.
company_name
,
};
this
.
setState
({
listCompany
:
typeProps
,
companyData
:
response
.
data
.
data
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
// alert(response.data.message)
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
})
}
getReportType
()
{
api
.
create
().
getReportType
().
then
((
response
)
=>
{
// console.log(response)
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
reportTypeData
=
data
.
map
((
item
)
=>
{
return
{
report_id
:
item
.
report_id
,
report_name
:
item
.
report_name
,
}
})
let
defaultProps
=
{
options
:
reportTypeData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
report_name
),
};
this
.
setState
({
listReportType
:
defaultProps
,
reportTypeData
:
response
.
data
.
data
})
}
else
{
// alert(response.data.message)
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
})
}
getParent
()
{
if
(
this
.
state
.
reportType
!==
null
&&
this
.
state
.
company
!==
null
)
{
let
payload
=
{
"report_id"
:
this
.
state
.
reportType
.
report_id
,
"company_id"
:
this
.
state
.
company
.
company_id
}
api
.
create
().
getReportParent
(
payload
).
then
((
response
)
=>
{
// console.log(response)
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
parentData
=
data
.
map
((
item
)
=>
{
return
{
item_report_id
:
item
.
item_report_id
,
description
:
item
.
description
}
})
let
defaultProps
=
{
options
:
parentData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
description
),
};
this
.
setState
({
listParent
:
defaultProps
,
parentData
:
response
.
data
.
data
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
// alert(response.data.message)
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
})
}
}
handleDate
(
item
)
{
let
value
=
format
(
item
,
'dd MMMM yyyy'
)
return
value
}
clearMessage
()
{
this
.
setState
({
errorFormula
:
false
,
msgErrorFormula
:
''
,
...
...
@@ -518,19 +259,6 @@ export default class CreateMasterDataCAT extends Component {
<
div
className
=
"grid grid-2x grid-mobile-none gap-15px"
style
=
{{
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
div
className
=
"column-1"
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
{
/* <Autocomplete
{...this.state.listCompany}
id="company"
onChange={(event, newInputValue) => this.setState({ company: newInputValue, kpiDisable: false, maxAchDisable: false }, () => {
this.getParent()
this.clearMessage()
this.getKPIType()
this.getMaxAch()
})}
debug
value={this.state.company}
/> */
}
<
Autocomplete
{...
this
.
state
.
listCompany
}
id
=
"company"
...
...
@@ -540,7 +268,6 @@ export default class CreateMasterDataCAT extends Component {
})}
disableClearable
style
=
{{
width
:
250
}}
// renderInput={(params) => <TextField {...params} label="Company" margin="normal" style={{ marginTop: 7 }} />}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Company Name"
...
...
@@ -564,10 +291,6 @@ export default class CreateMasterDataCAT extends Component {
<
Autocomplete
{...
this
.
state
.
listPeriode
}
id
=
"year"
// onChange={(event, newInputValue) => this.setState({ reportType: newInputValue, kpiDisable: true, maxAchDisable: true }, () => {
// newInputValue == null || (newInputValue.report_name !== 'CAT') ? this.setState({ kpiTypeValue: null, maxAchValue: null, formulaYTDValue: null }, () => this.clearMessage())
// : this.clearMessage();
// })}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
periode
:
newInputValue
,
loading
:
true
,
previewTable
:
false
},
()
=>
{
this
.
getParentIR
()
})}
...
...
@@ -662,11 +385,7 @@ export default class CreateMasterDataCAT extends Component {
name
=
"itemReportName1"
label
=
"Item Report Name"
disabled
// onChange={(e) => this.handleChange(e, null)}
// value={this.state.order}
value
=
{
this
.
handleReportName
(
item
.
description
)}
// error={this.state.errorOrder}
// helperText={this.state.msgErrorOrder}
inputProps
=
{{
min
:
0
,
style
:
{
...
...
src/container/MasterData/MasterDataCAT/EditMasterDataCAT.js
View file @
d9ebeac5
...
...
@@ -177,9 +177,9 @@ export default class EditMasterDataCAT extends Component {
dataSource
[
indexID
].
weight
=
e
.
target
.
value
this
.
setState
({
getParent
:
dataSource
},
()
=>
{
console
.
log
(
this
.
state
.
getParent
);
this
.
clearMessage
()
})
}
console
.
log
(
e
.
target
.
value
)
}
handleReportName
(
item
)
{
...
...
@@ -334,6 +334,13 @@ export default class EditMasterDataCAT extends Component {
})
}
clearMessage
()
{
this
.
setState
({
errorFormula
:
false
,
msgErrorFormula
:
''
,
errorWeight
:
false
,
msgErrorWeight
:
''
})
}
closeAlert
()
{
this
.
setState
({
alert
:
false
})
}
...
...
src/container/MasterData/MasterDataCAT/MasterDataCAT.js
View file @
d9ebeac5
...
...
@@ -955,13 +955,6 @@ export default class MasterDataCAT extends Component {
}
}
]
const
data
=
[
[
""
,
"1"
,
"KPI"
,
"TIA"
,
"1"
,
"Financial Perspective"
,
"0"
,
"-"
,
"35%"
,
"Formula"
,
"Aktif"
],
[
""
,
"2"
,
"KPI"
,
"TIA"
,
"2"
,
"Trading Profit"
,
"1"
,
"Rp Bio"
,
"35%"
,
"Formula"
,
"Aktif"
],
[
""
,
"3"
,
"KPI"
,
"TIA"
,
"3"
,
"Revenue"
,
"1"
,
"Rp Bio"
,
"0%"
,
"Formula"
,
"Aktif"
],
[
""
,
"4"
,
"KPI"
,
"TIA"
,
"4"
,
"EBITDA"
,
"1"
,
"Rp Bio"
,
"0%"
,
"Formula"
,
"Non Aktif"
],
[
""
,
"-"
,
"-"
,
"-"
,
"-"
,
"-"
,
"-"
,
"-"
,
"-"
,
"-"
,
"-"
],
]
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
...
...
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