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
414c6f5f
Commit
414c6f5f
authored
Dec 03, 2020
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cat
parent
ce23bb83
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
95 deletions
+68
-95
index.js
src/api/index.js
+2
-0
CorporateAnnualTargetMR.js
src/container/MonthlyReport/CorporateAnnualTargetMR.js
+66
-95
No files found.
src/api/index.js
View file @
414c6f5f
...
...
@@ -259,6 +259,7 @@ const create = (type = "") => {
const
getHierarkiMontlyReportTP
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report_tp/get_report_hierarki'
,
body
)
const
getHierarkiMontlyReportLOCF
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report_locf/get_report_hierarki'
,
body
)
const
getHierarkiMontlyReportFAM
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report/fam/get_report_hierarki'
,
body
)
const
getHierarkiMontlyReportCAT
=
(
body
)
=>
api
.
post
(
'/transaction/monthly_report/cat/get_report_hierarki'
,
body
)
const
getLastPeriodMonthly
=
(
idCompany
)
=>
api
.
get
(
`transaction/monthly_report/get_last_periode/
${
idCompany
}
`
)
const
checkApproverMonthly
=
()
=>
api
.
get
(
'transaction/monthly_report/is_approver'
)
const
getCompanySubmittedMonthly
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report/get_company_submitted'
,
body
)
...
...
@@ -487,6 +488,7 @@ const create = (type = "") => {
getHierarkiMontlyReportPL
,
getHierarkiMontlyReportLOCF
,
getHierarkiMontlyReportFAM
,
getHierarkiMontlyReportCAT
,
checkUploadMonthlyReportTP
,
checkUploadMonthlyReportFAM
,
uploadMonthlyReportPL
,
...
...
src/container/MonthlyReport/CorporateAnnualTargetMR.js
View file @
414c6f5f
...
...
@@ -66,10 +66,10 @@ export default class CorporateAnnualTargetMR extends Component {
"periode"
:
this
.
props
.
periode
,
"company_id"
:
this
.
props
.
company
.
company_id
,
"monthly_report_id"
:
this
.
props
.
monthlyReportId
,
"month
"
:
this
.
props
.
month
"month
s"
:
this
.
props
.
month
.
month_id
}
api
.
create
().
get
DetailReportMB
(
payload
).
then
(
response
=>
{
api
.
create
().
get
HierarkiMontlyReportCAT
(
payload
).
then
(
response
=>
{
let
dataTable
=
[]
let
dataCustomerPrs
=
[]
let
dataInternalBsn
=
[]
...
...
@@ -79,27 +79,27 @@ export default class CorporateAnnualTargetMR extends Component {
const
handlePushChild
=
(
item
)
=>
{
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
if
(
indexIDzz
===
-
1
)
{
let
parentTrue
=
item
.
parent_name
==
'INTERNAL BUSINESS PROCESS PERSPECTIVE'
||
item
.
parent_name
==
'CUSTOMER PERSPECTIVE'
//
let parentTrue = item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE' || item.parent_name == 'CUSTOMER PERSPECTIVE'
if
(
item
.
parent_name
==
'INTERNAL BUSINESS PROCESS PERSPECTIVE'
)
{
if
(
item
.
type_report_id
!==
4
)
{
dataInternalBsn
.
push
({
id
:
item
.
id
,
name
:
item
.
description
,
check
:
false
})
}
}
//
if (item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE') {
//
if (item.type_report_id !== 4) {
//
dataInternalBsn.push({
//
id: item.id,
//
name: item.description,
//
check: false
//
})
//
}
//
}
if
(
item
.
parent_name
==
'CUSTOMER PERSPECTIVE'
)
{
if
(
item
.
type_report_id
!==
4
)
{
dataCustomerPrs
.
push
({
id
:
item
.
id
,
name
:
item
.
description
,
check
:
false
})
}
}
//
if (item.parent_name == 'CUSTOMER PERSPECTIVE') {
//
if (item.type_report_id !== 4) {
//
dataCustomerPrs.push({
//
id: item.id,
//
name: item.description,
//
check: false
//
})
//
}
//
}
dataTable
.
push
([
item
.
type_report_id
,
...
...
@@ -107,31 +107,17 @@ export default class CorporateAnnualTargetMR extends Component {
item
.
parent
,
item
.
formula
,
item
.
level
,
""
,
item
.
description
,
item
.
type_report_id
==
1
?
`
${
Number
(
item
.
weight
)
*
100
}
%`
:
(
String
(
item
.
cat
.
weight
).
indexOf
(
"."
)
==
-
1
?
item
.
cat
.
weight
:
`
${
Number
(
item
.
weight
)
*
100
}
%`
),
parentTrue
?
item
.
cat
.
uom
:
item
.
uom
,
parentTrue
?
item
.
cat
.
kpi_type
==
""
?
null
:
{
value
:
item
.
cat
.
kpi_type
}
:
item
.
kpi_type
==
""
?
null
:
{
value
:
item
.
kpi_type
},
parentTrue
?
item
.
cat
.
max_ach
==
""
?
null
:
{
value
:
titleCase
(
item
.
cat
.
max_ach
)
}
:
item
.
max_ach
==
""
?
null
:
{
value
:
titleCase
(
item
.
max_ach
)
},
parentTrue
?
item
.
cat
.
formula
==
""
?
null
:
{
value
:
item
.
cat
.
formula
}
:
item
.
formula_ytd
==
""
?
null
:
{
value
:
item
.
formula_ytd
},
item
.
cat
.
total_actual_before
==
""
?
item
.
cat
.
total_actual_before
:
String
(
item
.
cat
.
total_actual_before
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
total_actual_before
)
:
Number
(
item
.
cat
.
total_actual_before
).
toFixed
(
1
),
item
.
cat
.
january
==
""
?
item
.
cat
.
january
:
String
(
item
.
cat
.
january
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
january
)
:
Number
(
item
.
cat
.
january
).
toFixed
(
1
),
item
.
cat
.
february
==
""
?
item
.
cat
.
february
:
String
(
item
.
cat
.
february
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
february
)
:
Number
(
item
.
cat
.
february
).
toFixed
(
1
),
item
.
cat
.
march
==
""
?
item
.
cat
.
march
:
String
(
item
.
cat
.
march
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
march
)
:
Number
(
item
.
cat
.
march
).
toFixed
(
1
),
item
.
cat
.
april
==
""
?
item
.
cat
.
april
:
String
(
item
.
cat
.
april
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
april
)
:
Number
(
item
.
cat
.
april
).
toFixed
(
1
),
item
.
cat
.
may
==
""
?
item
.
cat
.
may
:
String
(
item
.
cat
.
may
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
may
)
:
Number
(
item
.
cat
.
may
).
toFixed
(
1
),
item
.
cat
.
june
==
""
?
item
.
cat
.
june
:
String
(
item
.
cat
.
june
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
june
)
:
Number
(
item
.
cat
.
june
).
toFixed
(
1
),
item
.
cat
.
july
==
""
?
item
.
cat
.
july
:
String
(
item
.
cat
.
july
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
july
)
:
Number
(
item
.
cat
.
july
).
toFixed
(
1
),
item
.
cat
.
august
==
""
?
item
.
cat
.
august
:
String
(
item
.
cat
.
august
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
august
)
:
Number
(
item
.
cat
.
august
).
toFixed
(
1
),
item
.
cat
.
september
==
""
?
item
.
cat
.
september
:
String
(
item
.
cat
.
september
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
september
)
:
Number
(
item
.
cat
.
september
).
toFixed
(
1
),
item
.
cat
.
october
==
""
?
item
.
cat
.
october
:
String
(
item
.
cat
.
october
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
october
)
:
Number
(
item
.
cat
.
october
).
toFixed
(
1
),
item
.
cat
.
november
==
""
?
item
.
cat
.
november
:
String
(
item
.
cat
.
november
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
november
)
:
Number
(
item
.
cat
.
november
).
toFixed
(
1
),
item
.
cat
.
december
==
""
?
item
.
cat
.
december
:
String
(
item
.
cat
.
december
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
december
)
:
Number
(
item
.
cat
.
december
).
toFixed
(
1
),
item
.
cat
.
total_current_year
==
""
?
item
.
cat
.
total_current_year
:
String
(
item
.
cat
.
total_current_year
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
total_current_year
)
:
Number
(
item
.
cat
.
total_current_year
).
toFixed
(
1
),
item
.
cat
.
total_next_year
==
""
?
item
.
cat
.
total_next_year
:
String
(
item
.
cat
.
total_next_year
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
total_next_year
)
:
Number
(
item
.
cat
.
total_next_year
).
toFixed
(
1
),
item
.
cat
.
total_more_year
==
""
?
item
.
cat
.
total_more_year
:
String
(
item
.
cat
.
total_more_year
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
total_more_year
)
:
Number
(
item
.
cat
.
total_more_year
).
toFixed
(
1
),
item
.
cat
.
strategic
,
item
.
cat
.
pic
item
.
corporate_annual_target
.
weight
===
null
?
"0"
:
item
.
corporate_annual_target
.
weight
===
""
?
"0"
:
item
.
corporate_annual_target
.
weight
,
item
.
corporate_annual_target
.
jenis_kpi
===
null
?
"0"
:
item
.
corporate_annual_target
.
jenis_kpi
===
""
?
"0"
:
item
.
corporate_annual_target
.
jenis_kpi
,
item
.
corporate_annual_target
.
max_ach
===
null
?
"0"
:
item
.
corporate_annual_target
.
max_ach
===
""
?
"0"
:
item
.
corporate_annual_target
.
max_ach
,
item
.
corporate_annual_target
.
formula_ytd
===
null
?
"0"
:
item
.
corporate_annual_target
.
formula_ytd
===
""
?
"0"
:
item
.
corporate_annual_target
.
formula_ytd
,
item
.
corporate_annual_target
.
actual_monthly
===
null
?
"0"
:
item
.
corporate_annual_target
.
actual_monthly
===
""
?
"0"
:
item
.
corporate_annual_target
.
actual_monthly
,
item
.
corporate_annual_target
.
target_monthly
===
null
?
"0"
:
item
.
corporate_annual_target
.
target_monthly
===
""
?
"0"
:
item
.
corporate_annual_target
.
target_monthly
,
item
.
corporate_annual_target
.
achivement_monthly
===
null
?
"0"
:
item
.
corporate_annual_target
.
achivement_monthly
===
""
?
"0"
:
item
.
corporate_annual_target
.
achivement_monthly
,
item
.
corporate_annual_target
.
score
===
null
?
"0"
:
item
.
corporate_annual_target
.
score
===
""
?
"0"
:
item
.
corporate_annual_target
.
score
,
item
.
corporate_annual_target
.
score_x_weight
===
null
?
"0"
:
item
.
corporate_annual_target
.
score_x_weight
===
""
?
"0"
:
item
.
corporate_annual_target
.
score_x_weight
,
item
.
corporate_annual_target
.
notes
===
null
?
"0"
:
item
.
corporate_annual_target
.
notes
===
""
?
"0"
:
item
.
corporate_annual_target
.
notes
,
])
}
if
(
item
.
children
!==
null
)
{
...
...
@@ -148,32 +134,17 @@ export default class CorporateAnnualTargetMR extends Component {
item
.
id
,
item
.
parent
,
item
.
formula
,
item
.
level
,
""
,
item
.
description
,
item
.
type_report_id
==
1
?
`
${
Number
(
item
.
weight
)
*
100
}
%`
:
item
.
cat
.
weight
,
item
.
cat
.
uom
,
item
.
kpi_type
==
""
?
null
:
{
value
:
item
.
kpi_type
},
item
.
max_ach
==
""
?
null
:
{
value
:
titleCase
(
item
.
max_ach
)
},
item
.
formula
==
""
?
null
:
{
value
:
item
.
formula_ytd
},
item
.
cat
.
total_actual_before
==
""
?
item
.
cat
.
total_actual_before
:
String
(
item
.
cat
.
total_actual_before
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
total_actual_before
)
:
Number
(
item
.
cat
.
total_actual_before
).
toFixed
(
1
),
item
.
cat
.
january
==
""
?
item
.
cat
.
january
:
String
(
item
.
cat
.
january
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
january
)
:
Number
(
item
.
cat
.
january
).
toFixed
(
1
),
item
.
cat
.
february
==
""
?
item
.
cat
.
february
:
String
(
item
.
cat
.
february
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
february
)
:
Number
(
item
.
cat
.
february
).
toFixed
(
1
),
item
.
cat
.
march
==
""
?
item
.
cat
.
march
:
String
(
item
.
cat
.
march
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
march
)
:
Number
(
item
.
cat
.
march
).
toFixed
(
1
),
item
.
cat
.
april
==
""
?
item
.
cat
.
april
:
String
(
item
.
cat
.
april
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
april
)
:
Number
(
item
.
cat
.
april
).
toFixed
(
1
),
item
.
cat
.
may
==
""
?
item
.
cat
.
may
:
String
(
item
.
cat
.
may
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
may
)
:
Number
(
item
.
cat
.
may
).
toFixed
(
1
),
item
.
cat
.
june
==
""
?
item
.
cat
.
june
:
String
(
item
.
cat
.
june
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
june
)
:
Number
(
item
.
cat
.
june
).
toFixed
(
1
),
item
.
cat
.
july
==
""
?
item
.
cat
.
july
:
String
(
item
.
cat
.
july
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
july
)
:
Number
(
item
.
cat
.
july
).
toFixed
(
1
),
item
.
cat
.
august
==
""
?
item
.
cat
.
august
:
String
(
item
.
cat
.
august
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
august
)
:
Number
(
item
.
cat
.
august
).
toFixed
(
1
),
item
.
cat
.
september
==
""
?
item
.
cat
.
september
:
String
(
item
.
cat
.
september
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
september
)
:
Number
(
item
.
cat
.
september
).
toFixed
(
1
),
item
.
cat
.
october
==
""
?
item
.
cat
.
october
:
String
(
item
.
cat
.
october
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
october
)
:
Number
(
item
.
cat
.
october
).
toFixed
(
1
),
item
.
cat
.
november
==
""
?
item
.
cat
.
november
:
String
(
item
.
cat
.
november
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
november
)
:
Number
(
item
.
cat
.
november
).
toFixed
(
1
),
item
.
cat
.
december
==
""
?
item
.
cat
.
december
:
String
(
item
.
cat
.
december
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
december
)
:
Number
(
item
.
cat
.
december
).
toFixed
(
1
),
item
.
cat
.
total_current_year
==
""
?
item
.
cat
.
total_current_year
:
String
(
item
.
cat
.
total_current_year
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
total_current_year
)
:
Number
(
item
.
cat
.
total_current_year
).
toFixed
(
1
),
item
.
cat
.
total_next_year
==
""
?
item
.
cat
.
total_next_year
:
String
(
item
.
cat
.
total_next_year
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
total_next_year
)
:
Number
(
item
.
cat
.
total_next_year
).
toFixed
(
1
),
item
.
cat
.
total_more_year
==
""
?
item
.
cat
.
total_more_year
:
String
(
item
.
cat
.
total_more_year
).
indexOf
(
"."
)
==
-
1
?
Number
(
item
.
cat
.
total_more_year
)
:
Number
(
item
.
cat
.
total_more_year
).
toFixed
(
1
),
item
.
cat
.
strategic
,
item
.
cat
.
pic
item
.
corporate_annual_target
.
weight
===
null
?
"0"
:
item
.
corporate_annual_target
.
weight
===
""
?
"0"
:
item
.
corporate_annual_target
.
weight
,
item
.
corporate_annual_target
.
jenis_kpi
===
null
?
"0"
:
item
.
corporate_annual_target
.
jenis_kpi
===
""
?
"0"
:
item
.
corporate_annual_target
.
jenis_kpi
,
item
.
corporate_annual_target
.
max_ach
===
null
?
"0"
:
item
.
corporate_annual_target
.
max_ach
===
""
?
"0"
:
item
.
corporate_annual_target
.
max_ach
,
item
.
corporate_annual_target
.
formula_ytd
===
null
?
"0"
:
item
.
corporate_annual_target
.
formula_ytd
===
""
?
"0"
:
item
.
corporate_annual_target
.
formula_ytd
,
item
.
corporate_annual_target
.
actual_monthly
===
null
?
"0"
:
item
.
corporate_annual_target
.
actual_monthly
===
""
?
"0"
:
item
.
corporate_annual_target
.
actual_monthly
,
item
.
corporate_annual_target
.
target_monthly
===
null
?
"0"
:
item
.
corporate_annual_target
.
target_monthly
===
""
?
"0"
:
item
.
corporate_annual_target
.
target_monthly
,
item
.
corporate_annual_target
.
achivement_monthly
===
null
?
"0"
:
item
.
corporate_annual_target
.
achivement_monthly
===
""
?
"0"
:
item
.
corporate_annual_target
.
achivement_monthly
,
item
.
corporate_annual_target
.
score
===
null
?
"0"
:
item
.
corporate_annual_target
.
score
===
""
?
"0"
:
item
.
corporate_annual_target
.
score
,
item
.
corporate_annual_target
.
score_x_weight
===
null
?
"0"
:
item
.
corporate_annual_target
.
score_x_weight
===
""
?
"0"
:
item
.
corporate_annual_target
.
score_x_weight
,
item
.
corporate_annual_target
.
notes
===
null
?
"0"
:
item
.
corporate_annual_target
.
notes
===
""
?
"0"
:
item
.
corporate_annual_target
.
notes
,
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
...
...
@@ -401,30 +372,30 @@ export default class CorporateAnnualTargetMR extends Component {
}
let
columns
=
[
//
{
//
name: "",
//
options: {
//
display: false
//
}
//
},
//
{
//
name: "",
//
options: {
//
display: false
//
}
//
},
//
{
//
name: "",
//
options: {
//
display: false
//
}
//
},
//
{
//
name: "",
//
options: {
//
display: false
//
}
//
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
// {
// name: "",
// options: {
...
...
@@ -1031,7 +1002,7 @@ export default class CorporateAnnualTargetMR extends Component {
<
div
style
=
{{
marginTop
:
20
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
400
:
150
)
}}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
data
=
{
data
}
data
=
{
data
Table2
}
columns
=
{
columns
}
options
=
{
options
}
/
>
...
...
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