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
b1a25c48
Commit
b1a25c48
authored
Oct 05, 2020
by
d.arizona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
2dcba2e2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
BudgetTahunan.js
src/container/BudgetTahunan.js
+10
-2
CorporateAnnualTarget.js
src/container/BudgetTahunan/CorporateAnnualTarget.js
+2
-1
No files found.
src/container/BudgetTahunan.js
View file @
b1a25c48
...
...
@@ -68,9 +68,12 @@ export default class BudgetTahunan extends Component {
maxDateRevision
:
new
Date
(),
btnApprove
:
false
}
this
.
myRef
=
React
.
createRef
()
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
}
scrollToMyRef
=
()
=>
window
.
scrollTo
(
0
,
this
.
myRef
.
current
.
offsetTop
)
componentDidMount
()
{
this
.
setState
({
loading
:
true
})
this
.
props
.
selectIndex
(
'Master Budget & CAT'
)
...
...
@@ -422,6 +425,7 @@ export default class BudgetTahunan extends Component {
}
approvalSubmission
(
type
)
{
this
.
scrollToMyRef
()
this
.
setState
({
loading
:
true
})
let
body
=
{
"approval_id"
:
this
.
props
.
location
.
state
==
undefined
?
this
.
state
.
approverID
:
this
.
state
.
rawData
.
approval_id
,
...
...
@@ -671,6 +675,10 @@ export default class BudgetTahunan extends Component {
}
render
()
{
const
handleMaxDate
=
()
=>
{
let
handleDate
=
Number
(
moment
(
this
.
state
.
maxDateRevision
).
format
(
'YYYYMMDD'
))
-
Number
(
moment
(
this
.
state
.
minDateRevision
).
format
(
'YYYYMMDD'
))
return
handleDate
<
0
?
moment
(
this
.
state
.
minDateRevision
).
format
(
'YYYY/MM/DD'
)
:
moment
(
this
.
state
.
maxDateRevision
).
format
(
'YYYY/MM/DD'
)
}
const
columns
=
[
"#"
,
"Report Type"
,
{
name
:
"Revision"
,
...
...
@@ -892,7 +900,7 @@ export default class BudgetTahunan extends Component {
<
/div
>
);
return
(
<
div
style
=
{{
flex
:
1
,
backgroundColor
:
'#f8f8f8'
}}
>
<
div
style
=
{{
flex
:
1
,
backgroundColor
:
'#f8f8f8'
}}
ref
=
{
this
.
myRef
}
>
<
Snackbar
open
=
{
this
.
state
.
alert
}
autoHideDuration
=
{
6000
}
onClose
=
{()
=>
this
.
closeAlert
()}
>
<
Alert
onClose
=
{()
=>
this
.
closeAlert
()}
severity
=
{
this
.
state
.
tipeAlert
}
>
{
this
.
state
.
messageAlert
}
...
...
@@ -1360,7 +1368,7 @@ export default class BudgetTahunan extends Component {
id
=
"startDate"
label
=
"Valid From"
format
=
"dd-MM-yyyy"
onChange
=
{(
e
)
=>
this
.
setState
({
minDateRevision
:
moment
(
e
).
format
(
'YYYY/MM/DD'
)})}
onChange
=
{(
e
)
=>
this
.
setState
({
minDateRevision
:
moment
(
e
).
format
(
'YYYY/MM/DD'
)}
,
()
=>
this
.
setState
({
maxDateRevision
:
handleMaxDate
()})
)}
value
=
{
moment
(
this
.
state
.
minDateRevision
).
format
(
'YYYY/MM/DD'
)}
KeyboardButtonProps
=
{{
'aria-label'
:
'change date'
,
...
...
src/container/BudgetTahunan/CorporateAnnualTarget.js
View file @
b1a25c48
...
...
@@ -264,10 +264,11 @@ export default class CorporateAnnualTarget extends Component {
nilaiTotal
=
i
[
6
]
==
'SUM'
?
total
:
i
[
6
]
==
'AVG'
?
total
/
12
:
lastValz
}
console
.
log
(
nilaiTotal
)
// console.log(i[2] === undefined ? "" : String(Number(i[2]*100)).length > 3? String(Number(i[2]*100).toFixed(0) + '%') : String(Number(i[2]*100)) + '%')
payload
.
push
({
item_report_id
:
i
[
0
]
===
undefined
?
""
:
reg
.
test
(
String
(
i
[
0
]))
===
false
?
""
:
String
(
i
[
0
]).
trim
(),
item_report
:
i
[
1
]
===
undefined
?
""
:
String
(
i
[
1
]).
trim
(),
weight
:
i
[
2
]
===
undefined
?
""
:
String
(
Number
(
i
[
2
]
*
100
)
+
'%'
)
,
weight
:
i
[
2
]
===
undefined
?
""
:
String
(
Number
(
i
[
2
]
*
100
)
).
length
>
3
?
String
(
Number
(
i
[
2
]
*
100
).
toFixed
(
0
)
+
'%'
)
:
String
(
Number
(
i
[
2
]
*
100
))
+
'%'
,
uom
:
i
[
3
]
===
undefined
?
""
:
String
(
i
[
3
]).
trim
(),
kpi_type
:
i
[
4
]
===
undefined
?
""
:
String
(
i
[
4
]).
trim
(),
max_ach
:
i
[
5
]
===
undefined
?
""
:
String
(
i
[
5
]).
toLocaleLowerCase
()
!==
'unlimited'
?
String
(
Number
(
i
[
5
]
*
100
)
+
'%'
)
:
String
(
i
[
5
]).
trim
(),
...
...
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