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
7d6e8282
Commit
7d6e8282
authored
Feb 04, 2021
by
d.arizona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update month periode
parent
b76eabbb
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
15 deletions
+41
-15
BudgetTahunan.js
src/container/BudgetTahunan.js
+1
-1
HomePage.js
src/container/HomePage.js
+19
-5
SubHolding.js
src/container/Laporan/SubHolding.js
+11
-5
MonthlyReport.js
src/container/MonthlyReport.js
+10
-4
No files found.
src/container/BudgetTahunan.js
View file @
7d6e8282
...
...
@@ -449,7 +449,7 @@ export default class BudgetTahunan extends Component {
options
:
periodeData
,
getOptionLabel
:
(
option
)
=>
option
.
periode
,
};
let
periode
=
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
this
.
state
.
lastPeriod
)
let
periode
=
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
))
:
this
.
state
.
lastPeriod
)
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
===
periode
)
// // console.log(this.props.location.state.rawData)
// console.log(this.state.lastPeriod)
...
...
src/container/HomePage.js
View file @
7d6e8282
...
...
@@ -100,8 +100,13 @@ class HomePage extends Component {
options
:
MR
,
getOptionLabel
:
(
option
)
=>
option
.
name
,
};
// console.log(MR[MR.length - 1])
let
dateNow
=
new
Date
()
dateNow
.
setMonth
(
dateNow
.
getMonth
()
-
1
);
let
yearNow
=
dateNow
.
getFullYear
()
let
indexMonthMR
=
MR
.
findIndex
((
val
)
=>
val
.
value
==
yearNow
)
this
.
setState
({
listPeriodeMB
:
defaultPropsMB
,
periodeMB
:
MB
[
MB
.
length
-
1
],
listPeriodeMR
:
defaultPropsMR
,
periodeMR
:
MR
[
MR
.
length
-
1
]},
()
=>
{
this
.
setState
({
listPeriodeMB
:
defaultPropsMB
,
periodeMB
:
MB
[
MB
.
length
-
1
],
listPeriodeMR
:
defaultPropsMR
,
periodeMR
:
MR
[
indexMonthMR
]},
()
=>
{
this
.
getListUserSubcoMB
()
this
.
getListUserSubcoMR
()
})
...
...
@@ -109,9 +114,10 @@ class HomePage extends Component {
getMonth
()
{
api
.
create
().
getMonthTransaction
().
then
(
response
=>
{
let
dateNow
=
new
Date
let
dateNow
=
new
Date
()
dateNow
.
setMonth
(
dateNow
.
getMonth
()
-
1
);
let
month
=
format
(
dateNow
,
'MMMM'
)
console
.
log
(
response
);
// console.log(month
);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
// console.log(response);
...
...
@@ -312,7 +318,7 @@ class HomePage extends Component {
let
listDashboard
=
[]
let
rawData
=
[]
api
.
create
().
getDashboard
().
then
((
response
)
=>
{
//
console.log(response);
console
.
log
(
response
);
if
(
String
(
response
.
data
.
status
).
toLocaleLowerCase
()
==
'success'
)
{
let
data
=
response
.
data
.
data
data
.
map
((
item
,
index
)
=>
{
...
...
@@ -398,6 +404,14 @@ class HomePage extends Component {
}
render
()
{
const
getDataMonth
=
(
item
)
=>
{
let
months
=
item
.
months
let
dataMonth
=
this
.
state
.
listMonth
.
options
let
indexID
=
dataMonth
.
findIndex
((
val
)
=>
val
.
month_id
==
months
)
// console.log(dataMonth[indexID])
return
dataMonth
[
indexID
]
}
const
columns
=
[
"#"
,
"ID"
,
"Company"
,
"Report Type"
,
"Revision"
,
{
name
:
""
,
...
...
@@ -416,7 +430,7 @@ class HomePage extends Component {
state
:
{
userType
:
'approver'
,
rawData
:
this
.
state
.
rawData
[
tableMeta
.
rowIndex
],
month
:
String
(
tableMeta
.
rowData
[
3
]).
toLocaleLowerCase
().
includes
(
"master"
)
?
null
:
this
.
state
.
month
month
:
String
(
tableMeta
.
rowData
[
3
]).
toLocaleLowerCase
().
includes
(
"master"
)
?
null
:
getDataMonth
(
this
.
state
.
rawData
[
tableMeta
.
rowIndex
])
}
}}
>
<
button
...
...
src/container/Laporan/SubHolding.js
View file @
7d6e8282
...
...
@@ -165,8 +165,13 @@ export default class SubHolding extends Component {
options
:
periodeData
,
getOptionLabel
:
(
option
)
=>
option
.
periode
,
};
let
periode
=
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
this
.
state
.
lastPeriod
)
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
===
periode
)
let
periode
=
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
))
:
this
.
state
.
lastPeriod
)
let
dateNow
=
new
Date
()
dateNow
.
setMonth
(
dateNow
.
getMonth
()
-
1
);
let
yearNow
=
dateNow
.
getFullYear
()
console
.
log
(
yearNow
)
console
.
log
(
periode
)
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
==
String
(
this
.
state
.
report
.
label
).
toLocaleLowerCase
().
includes
(
'summary'
)
?
yearNow
:
periode
)
// console.log(data)
// console.log(this.state.latestPeriode)
...
...
@@ -189,7 +194,8 @@ export default class SubHolding extends Component {
getMonth
()
{
api
.
create
().
getMonthTransaction
().
then
(
response
=>
{
let
dateNow
=
new
Date
let
dateNow
=
new
Date
()
dateNow
.
setMonth
(
dateNow
.
getMonth
()
-
1
);
let
month
=
format
(
dateNow
,
'MMMM'
)
console
.
log
(
response
);
if
(
response
.
data
)
{
...
...
@@ -832,7 +838,7 @@ export default class SubHolding extends Component {
FRID
=
null
}
this
.
setState
({
FRID
},
()
=>
{
let
payloads
=
{...
payload
,
submission_id
:
this
.
state
.
FRID
,
months
:
this
.
state
.
month
.
month_id
,
quarter
:
0
}
let
payloads
=
{...
payload
,
report_id
:
29
,
submission_id
:
this
.
state
.
FRID
,
months
:
this
.
state
.
month
.
month_id
,
quarter
:
0
}
api
.
create
().
getReportFR
(
payloads
).
then
(
response
=>
{
console
.
log
(
payload
);
console
.
log
(
response
);
...
...
src/container/MonthlyReport.js
View file @
7d6e8282
...
...
@@ -307,7 +307,8 @@ export default class MonthlyReport extends Component {
getMonth
()
{
api
.
create
().
getMonthTransaction
().
then
(
response
=>
{
let
dateNow
=
new
Date
let
dateNow
=
new
Date
()
dateNow
.
setMonth
(
dateNow
.
getMonth
()
-
1
);
let
month
=
format
(
dateNow
,
'MMMM'
)
console
.
log
(
response
);
if
(
response
.
data
)
{
...
...
@@ -402,11 +403,16 @@ export default class MonthlyReport extends Component {
getOptionLabel
:
(
option
)
=>
option
.
periode
,
};
let
periode
=
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
))
:
this
.
state
.
lastPeriod
===
undefined
?
String
(
Number
(
currentYear
))
:
this
.
state
.
lastPeriod
)
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
===
periode
)
let
dateNow
=
new
Date
()
dateNow
.
setMonth
(
dateNow
.
getMonth
()
-
1
);
let
yearNow
=
dateNow
.
getFullYear
()
// let indexMonthMR = MR.findIndex((val) => val.value == yearNow)
// console.log(yearNow)
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
==
yearNow
)
// console.log(data)
console
.
log
(
this
.
state
.
lastPeriod
)
//
console.log(this.state.lastPeriod)
// console.log(periodeData)
console
.
log
(
index
)
//
console.log(index)
this
.
setState
({
listPeriode
:
defaultProps
,
periode
:
index
===
-
1
?
periodeData
[
0
]
:
periodeData
[
index
]
},
()
=>
{
// if (this.state.isApprover === true && this.state.submittedOnly) {
this
.
getDetailUser
()
...
...
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