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
8c9c1125
Commit
8c9c1125
authored
Feb 04, 2021
by
Dida Adams Arizona
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'didam' into 'master'
update month periode See merge request
!1099
parents
b76eabbb
7d6e8282
Changes
4
Hide 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 @
8c9c1125
...
@@ -449,7 +449,7 @@ export default class BudgetTahunan extends Component {
...
@@ -449,7 +449,7 @@ export default class BudgetTahunan extends Component {
options
:
periodeData
,
options
:
periodeData
,
getOptionLabel
:
(
option
)
=>
option
.
periode
,
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
)
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
===
periode
)
// // console.log(this.props.location.state.rawData)
// // console.log(this.props.location.state.rawData)
// console.log(this.state.lastPeriod)
// console.log(this.state.lastPeriod)
...
...
src/container/HomePage.js
View file @
8c9c1125
...
@@ -100,8 +100,13 @@ class HomePage extends Component {
...
@@ -100,8 +100,13 @@ class HomePage extends Component {
options
:
MR
,
options
:
MR
,
getOptionLabel
:
(
option
)
=>
option
.
name
,
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
.
getListUserSubcoMB
()
this
.
getListUserSubcoMR
()
this
.
getListUserSubcoMR
()
})
})
...
@@ -109,9 +114,10 @@ class HomePage extends Component {
...
@@ -109,9 +114,10 @@ class HomePage extends Component {
getMonth
()
{
getMonth
()
{
api
.
create
().
getMonthTransaction
().
then
(
response
=>
{
api
.
create
().
getMonthTransaction
().
then
(
response
=>
{
let
dateNow
=
new
Date
let
dateNow
=
new
Date
()
dateNow
.
setMonth
(
dateNow
.
getMonth
()
-
1
);
let
month
=
format
(
dateNow
,
'MMMM'
)
let
month
=
format
(
dateNow
,
'MMMM'
)
console
.
log
(
response
);
// console.log(month
);
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
if
(
response
.
data
.
status
===
"success"
)
{
// console.log(response);
// console.log(response);
...
@@ -312,7 +318,7 @@ class HomePage extends Component {
...
@@ -312,7 +318,7 @@ class HomePage extends Component {
let
listDashboard
=
[]
let
listDashboard
=
[]
let
rawData
=
[]
let
rawData
=
[]
api
.
create
().
getDashboard
().
then
((
response
)
=>
{
api
.
create
().
getDashboard
().
then
((
response
)
=>
{
//
console.log(response);
console
.
log
(
response
);
if
(
String
(
response
.
data
.
status
).
toLocaleLowerCase
()
==
'success'
)
{
if
(
String
(
response
.
data
.
status
).
toLocaleLowerCase
()
==
'success'
)
{
let
data
=
response
.
data
.
data
let
data
=
response
.
data
.
data
data
.
map
((
item
,
index
)
=>
{
data
.
map
((
item
,
index
)
=>
{
...
@@ -398,6 +404,14 @@ class HomePage extends Component {
...
@@ -398,6 +404,14 @@ class HomePage extends Component {
}
}
render
()
{
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"
,
const
columns
=
[
"#"
,
"ID"
,
"Company"
,
"Report Type"
,
"Revision"
,
{
{
name
:
""
,
name
:
""
,
...
@@ -416,7 +430,7 @@ class HomePage extends Component {
...
@@ -416,7 +430,7 @@ class HomePage extends Component {
state
:
{
state
:
{
userType
:
'approver'
,
userType
:
'approver'
,
rawData
:
this
.
state
.
rawData
[
tableMeta
.
rowIndex
],
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
<
button
...
...
src/container/Laporan/SubHolding.js
View file @
8c9c1125
...
@@ -165,8 +165,13 @@ export default class SubHolding extends Component {
...
@@ -165,8 +165,13 @@ export default class SubHolding extends Component {
options
:
periodeData
,
options
:
periodeData
,
getOptionLabel
:
(
option
)
=>
option
.
periode
,
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
)
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(data)
// console.log(this.state.latestPeriode)
// console.log(this.state.latestPeriode)
...
@@ -189,8 +194,9 @@ export default class SubHolding extends Component {
...
@@ -189,8 +194,9 @@ export default class SubHolding extends Component {
getMonth
()
{
getMonth
()
{
api
.
create
().
getMonthTransaction
().
then
(
response
=>
{
api
.
create
().
getMonthTransaction
().
then
(
response
=>
{
let
dateNow
=
new
Date
let
dateNow
=
new
Date
()
let
month
=
format
(
dateNow
,
'MMMM'
)
dateNow
.
setMonth
(
dateNow
.
getMonth
()
-
1
);
let
month
=
format
(
dateNow
,
'MMMM'
)
console
.
log
(
response
);
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
if
(
response
.
data
.
status
===
"success"
)
{
...
@@ -832,7 +838,7 @@ export default class SubHolding extends Component {
...
@@ -832,7 +838,7 @@ export default class SubHolding extends Component {
FRID
=
null
FRID
=
null
}
}
this
.
setState
({
FRID
},
()
=>
{
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
=>
{
api
.
create
().
getReportFR
(
payloads
).
then
(
response
=>
{
console
.
log
(
payload
);
console
.
log
(
payload
);
console
.
log
(
response
);
console
.
log
(
response
);
...
...
src/container/MonthlyReport.js
View file @
8c9c1125
...
@@ -307,7 +307,8 @@ export default class MonthlyReport extends Component {
...
@@ -307,7 +307,8 @@ export default class MonthlyReport extends Component {
getMonth
()
{
getMonth
()
{
api
.
create
().
getMonthTransaction
().
then
(
response
=>
{
api
.
create
().
getMonthTransaction
().
then
(
response
=>
{
let
dateNow
=
new
Date
let
dateNow
=
new
Date
()
dateNow
.
setMonth
(
dateNow
.
getMonth
()
-
1
);
let
month
=
format
(
dateNow
,
'MMMM'
)
let
month
=
format
(
dateNow
,
'MMMM'
)
console
.
log
(
response
);
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
)
{
...
@@ -402,11 +403,16 @@ export default class MonthlyReport extends Component {
...
@@ -402,11 +403,16 @@ export default class MonthlyReport extends Component {
getOptionLabel
:
(
option
)
=>
option
.
periode
,
getOptionLabel
:
(
option
)
=>
option
.
periode
,
};
};
let
periode
=
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
))
:
this
.
state
.
lastPeriod
===
undefined
?
String
(
Number
(
currentYear
))
:
this
.
state
.
lastPeriod
)
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(data)
console
.
log
(
this
.
state
.
lastPeriod
)
//
console.log(this.state.lastPeriod)
// console.log(periodeData)
// console.log(periodeData)
console
.
log
(
index
)
//
console.log(index)
this
.
setState
({
listPeriode
:
defaultProps
,
periode
:
index
===
-
1
?
periodeData
[
0
]
:
periodeData
[
index
]
},
()
=>
{
this
.
setState
({
listPeriode
:
defaultProps
,
periode
:
index
===
-
1
?
periodeData
[
0
]
:
periodeData
[
index
]
},
()
=>
{
// if (this.state.isApprover === true && this.state.submittedOnly) {
// if (this.state.isApprover === true && this.state.submittedOnly) {
this
.
getDetailUser
()
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