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
9040e6ad
Commit
9040e6ad
authored
Jan 10, 2024
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue Weight CAT
parent
d4c11b98
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
CorporateAnnualTargetMR.js
src/container/MonthlyReport/CorporateAnnualTargetMR.js
+17
-13
No files found.
src/container/MonthlyReport/CorporateAnnualTargetMR.js
View file @
9040e6ad
...
@@ -196,6 +196,7 @@ export default class CorporateAnnualTargetMR extends Component {
...
@@ -196,6 +196,7 @@ export default class CorporateAnnualTargetMR extends Component {
}
}
getItemHierarki
()
{
getItemHierarki
()
{
this
.
setState
({
loading
:
true
})
let
payload
=
{
let
payload
=
{
"report_id"
:
this
.
props
.
report_id
,
"report_id"
:
this
.
props
.
report_id
,
"revision"
:
Number
(
this
.
props
.
revision
),
"revision"
:
Number
(
this
.
props
.
revision
),
...
@@ -218,7 +219,7 @@ export default class CorporateAnnualTargetMR extends Component {
...
@@ -218,7 +219,7 @@ export default class CorporateAnnualTargetMR extends Component {
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
if
(
indexIDzz
===
-
1
)
{
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'
let
weight
=
String
(
item
.
weight
).
includes
(
'%'
)
?
String
(
item
.
weight
).
substr
(
0
,
String
(
item
.
weight
).
length
-
1
)
:
String
(
item
.
weight
)
//
let weight = String(item.weight).includes('%') ? String(item.weight).substr(0, String(item.weight).length - 1) : String(item.weight)
let
weightTB
=
String
(
item
.
corporate_annual_target
.
weight
).
includes
(
'%'
)
?
String
(
item
.
corporate_annual_target
.
weight
).
substr
(
0
,
String
(
item
.
corporate_annual_target
.
weight
).
length
-
1
)
:
String
(
item
.
corporate_annual_target
.
weight
)
let
weightTB
=
String
(
item
.
corporate_annual_target
.
weight
).
includes
(
'%'
)
?
String
(
item
.
corporate_annual_target
.
weight
).
substr
(
0
,
String
(
item
.
corporate_annual_target
.
weight
).
length
-
1
)
:
String
(
item
.
corporate_annual_target
.
weight
)
// console.log(weight)
// console.log(weight)
dataTable
.
push
([
dataTable
.
push
([
...
@@ -229,7 +230,8 @@ export default class CorporateAnnualTargetMR extends Component {
...
@@ -229,7 +230,8 @@ export default class CorporateAnnualTargetMR extends Component {
item
.
level
,
item
.
level
,
item
.
description
,
item
.
description
,
// item.corporate_annual_target.weight == "" ? Number(0).toFixed(1) : Number(weight).toFixed(1),
// item.corporate_annual_target.weight == "" ? Number(0).toFixed(1) : Number(weight).toFixed(1),
parentTrue
?
weight
:
weightTB
,
// parentTrue ? weight : weightTB,
weightTB
,
parentTrue
?
item
.
corporate_annual_target
.
uom
:
item
.
uom
,
parentTrue
?
item
.
corporate_annual_target
.
uom
:
item
.
uom
,
parentTrue
?
item
.
corporate_annual_target
.
jenis_kpi
==
""
?
null
:
item
.
corporate_annual_target
.
jenis_kpi
:
item
.
jenis_kpi
==
""
?
null
:
item
.
kpi_type
,
parentTrue
?
item
.
corporate_annual_target
.
jenis_kpi
==
""
?
null
:
item
.
corporate_annual_target
.
jenis_kpi
:
item
.
jenis_kpi
==
""
?
null
:
item
.
kpi_type
,
// parentTrue ? item.corporate_annual_target.kpi_type == "" ? null : { value: item.corporate_annual_target.kpi_type } : item.kpi_type == "" ? null : { value: item.kpi_type },
// parentTrue ? item.corporate_annual_target.kpi_type == "" ? null : { value: item.corporate_annual_target.kpi_type } : item.kpi_type == "" ? null : { value: item.kpi_type },
...
@@ -282,6 +284,7 @@ export default class CorporateAnnualTargetMR extends Component {
...
@@ -282,6 +284,7 @@ export default class CorporateAnnualTargetMR extends Component {
}
}
}
}
res
.
map
((
item
,
index
)
=>
{
res
.
map
((
item
,
index
)
=>
{
let
weightParent
=
String
(
item
.
corporate_annual_target
.
weight
).
includes
(
'%'
)
?
String
(
item
.
corporate_annual_target
.
weight
).
substr
(
0
,
String
(
item
.
corporate_annual_target
.
weight
).
length
-
1
)
:
String
(
item
.
corporate_annual_target
.
weight
)
dataTable
.
push
([
dataTable
.
push
([
item
.
type_report_id
,
item
.
type_report_id
,
item
.
id
,
item
.
id
,
...
@@ -289,7 +292,8 @@ export default class CorporateAnnualTargetMR extends Component {
...
@@ -289,7 +292,8 @@ export default class CorporateAnnualTargetMR extends Component {
item
.
formula
,
item
.
formula
,
item
.
level
,
item
.
level
,
item
.
description
,
item
.
description
,
item
.
weight
==
''
?
Number
(
0
)
:
Number
(
Number
(
item
.
weight
)
*
100
),
item
.
parent
==
null
?
weightParent
:
item
.
corporate_annual_target
.
weight
,
// item.weight == '' ? Number(0) : Number(Number(item.weight) * 100),
item
.
uom
,
item
.
uom
,
item
.
kpi_type
==
""
?
null
:
item
.
kpi_type
,
item
.
kpi_type
==
""
?
null
:
item
.
kpi_type
,
// item.kpi_type == "" ? null : { value: item.kpi_type },
// item.kpi_type == "" ? null : { value: item.kpi_type },
...
@@ -621,11 +625,11 @@ export default class CorporateAnnualTargetMR extends Component {
...
@@ -621,11 +625,11 @@ export default class CorporateAnnualTargetMR extends Component {
options
:
inputMaxAch
,
options
:
inputMaxAch
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
value
),
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
value
),
};
};
//
setTimeout(() => {
setTimeout
(()
=>
{
this
.
setState
({
maxAchList
:
defaultProps
},
()
=>
{
this
.
setState
({
maxAchList
:
defaultProps
},
()
=>
{
this
.
getItemHierarki
()
this
.
getItemHierarki
()
})
})
//
}, 300);
},
300
);
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
)
||
response
.
data
.
message
.
includes
(
"Token Expired"
))
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
)
||
response
.
data
.
message
.
includes
(
"Token Expired"
))
{
...
@@ -939,11 +943,11 @@ export default class CorporateAnnualTargetMR extends Component {
...
@@ -939,11 +943,11 @@ export default class CorporateAnnualTargetMR extends Component {
})
})
}
}
// console.log(Number(lastTotal))
// console.log(Number(lastTotal))
console
.
log
(
this
.
state
.
parameterPerfom
)
//
console.log(this.state.parameterPerfom)
console
.
log
(
listPerfomanceDefault
)
//
console.log(listPerfomanceDefault)
console
.
log
(
perfomanceScore
)
//
console.log(perfomanceScore)
console
.
log
(
perfomanceScoreColor
)
//
console.log(perfomanceScoreColor)
console
.
log
(
datatable3
)
//
console.log(datatable3)
// if (lastTotal >= 1.00 && lastTotal <= 2.00) {
// if (lastTotal >= 1.00 && lastTotal <= 2.00) {
// perfomanceScore = 'K'
// perfomanceScore = 'K'
// } else if (lastTotal >= 2.01 && lastTotal <= 2.75) {
// } else if (lastTotal >= 2.01 && lastTotal <= 2.75) {
...
...
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