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
970bf0b5
Commit
970bf0b5
authored
Oct 03, 2020
by
d.arizona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apdet wiken
parent
963725e6
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
23 deletions
+37
-23
BudgetTahunan.js
src/container/BudgetTahunan.js
+17
-5
CorporateAnnualTarget.js
src/container/BudgetTahunan/CorporateAnnualTarget.js
+20
-18
No files found.
src/container/BudgetTahunan.js
View file @
970bf0b5
...
...
@@ -267,12 +267,20 @@ export default class BudgetTahunan extends Component {
api
.
create
().
getPeriodeTransaction
().
then
(
response
=>
{
// let dateNow = new Date
// let year = this.state.rawData ? this.state.rawData.periode : format(dateNow, 'yyyy')
let
currentYear
=
new
Date
().
getFullYear
()
console
.
log
(
currentYear
)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
let
data
=
[]
response
.
data
.
data
.
map
((
item
)
=>
{
if
((
item
==
this
.
state
.
latestPeriode
||
item
>
this
.
state
.
latestPeriode
)
&&
(
item
==
this
.
state
.
lastPeriod
||
item
<
this
.
state
.
lastPeriod
))
{
data
.
push
(
item
)
if
(
this
.
state
.
isApprover
)
{
if
(
item
>=
2000
&&
item
<=
(
Number
(
currentYear
)
+
1
))
{
data
.
push
(
item
)
}
}
else
{
if
((
item
>=
2000
)
&&
(
item
==
this
.
state
.
lastPeriod
||
item
<
this
.
state
.
lastPeriod
))
{
data
.
push
(
item
)
}
}
})
let
periodeData
=
data
.
map
((
item
)
=>
{
...
...
@@ -284,7 +292,11 @@ export default class BudgetTahunan extends Component {
options
:
periodeData
,
getOptionLabel
:
(
option
)
=>
option
.
periode
,
};
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
===
this
.
state
.
lastPeriod
)
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
===
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
this
.
state
.
lastPeriod
))
console
.
log
(
data
)
console
.
log
(
this
.
state
.
lastPeriod
)
console
.
log
(
periodeData
)
console
.
log
(
index
)
this
.
setState
({
listPeriode
:
defaultProps
,
periode
:
index
===
-
1
?
periodeData
[
0
]
:
periodeData
[
index
]
},
()
=>
{
if
(
this
.
state
.
isApprover
===
true
)
{
this
.
getCompanySubmitted
()
...
...
@@ -913,7 +925,7 @@ export default class BudgetTahunan extends Component {
<
div
style
=
{{
width
:
'50%'
}}
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'#4b4b4b'
,
fontWeight
:
'bold'
}}
>
Attachment
:
<
/Typography
>
<
/div
>
{
!
this
.
state
.
isApprover
&&
(
{
!
this
.
state
.
isApprover
&&
(
this
.
state
.
lastStatus
!==
'SUBMITTED'
&&
this
.
state
.
lastStatus
!==
'APPROVED'
)
&&
(
<
div
style
=
{{
width
:
'50%'
}}
>
<
button
style
=
{{
...
...
@@ -959,7 +971,7 @@ export default class BudgetTahunan extends Component {
:
null
}
<
/div
>
{
!
this
.
state
.
isApprover
&&
(
{
!
this
.
state
.
isApprover
&&
(
this
.
state
.
lastStatus
!==
'SUBMITTED'
&&
this
.
state
.
lastStatus
!==
'APPROVED'
)
&&
(
<
div
style
=
{{
width
:
'50%'
}}
>
{
this
.
state
.
listAttachment
.
length
>
0
?
this
.
state
.
listAttachment
.
map
((
item
)
=>
{
...
...
src/container/BudgetTahunan/CorporateAnnualTarget.js
View file @
970bf0b5
This diff is collapsed.
Click to expand it.
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