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
ac71facb
Commit
ac71facb
authored
Feb 04, 2021
by
Riri Novita
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://103.44.149.204/d.arizona/tia-dev
into riri
parents
38df86c4
7794bcff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
17 deletions
+19
-17
SubHolding.js
src/container/Laporan/SubHolding.js
+19
-17
No files found.
src/container/Laporan/SubHolding.js
View file @
ac71facb
...
...
@@ -266,22 +266,6 @@ export default class SubHolding extends Component {
}
getReportType
()
{
console
.
log
(
'sini deh'
)
let
data
=
this
.
state
.
listPeriode
.
options
let
currentYear
=
new
Date
().
getFullYear
()
let
periode
=
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
this
.
state
.
lastPeriod
)
let
dateNow
=
new
Date
()
dateNow
.
setMonth
(
dateNow
.
getMonth
()
-
1
);
let
yearNow
=
dateNow
.
getFullYear
()
// console.log(data)
// console.log(yearNow)
// console.log(periode)
if
(
String
(
this
.
state
.
report
.
label
).
toLocaleLowerCase
().
includes
(
'summary'
))
{
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
.
periode
==
yearNow
)
// console.log(index)
this
.
setState
({
periode
:
data
[
index
]})
}
let
payload
=
{
"company_id"
:
this
.
state
.
company
.
company_id
,
"periode"
:
this
.
state
.
periode
.
periode
,
...
...
@@ -3049,7 +3033,25 @@ export default class SubHolding extends Component {
getOptionLabel
=
{(
option
)
=>
titleCase
(
option
.
label
)}
id
=
"typereport"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
report
:
newInputValue
,
loading
:
true
,
previewTable
:
false
},
()
=>
{
this
.
getReportType
()
console
.
log
(
'sini deh'
)
let
data
=
this
.
state
.
listPeriode
.
options
let
currentYear
=
new
Date
().
getFullYear
()
let
periode
=
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
this
.
state
.
lastPeriod
)
let
dateNow
=
new
Date
()
dateNow
.
setMonth
(
dateNow
.
getMonth
()
-
1
);
let
yearNow
=
dateNow
.
getFullYear
()
// console.log(data)
// console.log(yearNow)
// console.log(periode)
if
(
String
(
this
.
state
.
report
.
label
).
toLocaleLowerCase
().
includes
(
'summary'
))
{
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
.
periode
==
yearNow
)
// console.log(index)
this
.
setState
({
periode
:
data
[
index
]},
()
=>
{
this
.
getReportType
()
})
}
else
{
this
.
getReportType
()
}
})}
disableClearable
style
=
{{
width
:
250
}}
...
...
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