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
2a3e7bc5
Commit
2a3e7bc5
authored
Dec 03, 2020
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test oi
parent
004a6e53
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
140 additions
and
55 deletions
+140
-55
OperatingIndicatorMR.js
src/container/MonthlyReport/OperatingIndicatorMR.js
+96
-11
ProfitLossMR.js
src/container/MonthlyReport/ProfitLossMR.js
+3
-3
OperatingIndicator.js
src/container/OprIndicator/OperatingIndicator.js
+41
-41
No files found.
src/container/MonthlyReport/OperatingIndicatorMR.js
View file @
2a3e7bc5
This diff is collapsed.
Click to expand it.
src/container/MonthlyReport/ProfitLossMR.js
View file @
2a3e7bc5
...
@@ -1436,7 +1436,7 @@ export default class ProfitLossMR extends Component {
...
@@ -1436,7 +1436,7 @@ export default class ProfitLossMR extends Component {
{
tableMeta
.
rowData
[
0
]
===
4
||
tableMeta
.
rowData
[
0
]
===
1
?
{
tableMeta
.
rowData
[
0
]
===
4
||
tableMeta
.
rowData
[
0
]
===
1
?
null
null
:
:
Number
(
tableMeta
.
rowData
[
1
9
])
<=
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
19
])
>=
this
.
state
.
maxValue
?
Number
(
tableMeta
.
rowData
[
1
4
])
<=
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
14
])
>=
this
.
state
.
maxValue
?
<
div
style
=
{{
flex
:
1
}}
>
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
<
FormControlLabel
style
=
{{
margin
:
0
}}
style
=
{{
margin
:
0
}}
...
@@ -1491,7 +1491,7 @@ export default class ProfitLossMR extends Component {
...
@@ -1491,7 +1491,7 @@ export default class ProfitLossMR extends Component {
{
tableMeta
.
rowData
[
0
]
===
4
||
tableMeta
.
rowData
[
0
]
===
1
?
{
tableMeta
.
rowData
[
0
]
===
4
||
tableMeta
.
rowData
[
0
]
===
1
?
null
null
:
:
Number
(
tableMeta
.
rowData
[
20
])
<=
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
20
])
>=
this
.
state
.
maxValue
?
Number
(
tableMeta
.
rowData
[
16
])
<=
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
16
])
>=
this
.
state
.
maxValue
?
<
div
style
=
{{
flex
:
1
}}
>
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
<
FormControlLabel
style
=
{{
margin
:
0
}}
style
=
{{
margin
:
0
}}
...
@@ -1546,7 +1546,7 @@ export default class ProfitLossMR extends Component {
...
@@ -1546,7 +1546,7 @@ export default class ProfitLossMR extends Component {
{
tableMeta
.
rowData
[
0
]
===
4
||
tableMeta
.
rowData
[
0
]
===
1
?
{
tableMeta
.
rowData
[
0
]
===
4
||
tableMeta
.
rowData
[
0
]
===
1
?
null
null
:
:
Number
(
tableMeta
.
rowData
[
21
])
<=
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
21
])
>=
this
.
state
.
maxValue
?
Number
(
tableMeta
.
rowData
[
18
])
<=
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
18
])
>=
this
.
state
.
maxValue
?
<
div
style
=
{{
flex
:
1
}}
>
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
<
FormControlLabel
style
=
{{
margin
:
0
}}
style
=
{{
margin
:
0
}}
...
...
src/container/OprIndicator/OperatingIndicator.js
View file @
2a3e7bc5
...
@@ -89,45 +89,45 @@ export default class OperatingIndicator extends Component {
...
@@ -89,45 +89,45 @@ export default class OperatingIndicator extends Component {
})
})
}
}
getMonth
()
{
//
getMonth() {
api
.
create
().
getMonthTransaction
().
then
(
response
=>
{
//
api.create().getMonthTransaction().then(response => {
console
.
log
(
response
);
//
console.log(response);
let
dateNow
=
new
Date
//
let dateNow = new Date
let
month
=
format
(
dateNow
,
'MMMM'
)
//
let month = format(dateNow, 'MMMM')
if
(
response
.
data
)
{
//
if (response.data) {
if
(
response
.
data
.
status
===
"success"
)
{
//
if (response.data.status === "success") {
console
.
log
(
response
);
//
console.log(response);
let
data
=
response
.
data
.
data
//
let data = response.data.data
let
monthData
=
data
.
map
((
item
)
=>
{
//
let monthData = data.map((item) => {
return
{
//
return {
month_id
:
item
.
id
,
//
month_id: item.id,
month_value
:
String
(
item
.
month_name
).
substr
(
0
,
3
)
//
month_value: String(item.month_name).substr(0, 3)
}
//
}
})
//
})
let
defaultProps
=
{
//
let defaultProps = {
options
:
monthData
,
//
options: monthData,
getOptionLabel
:
(
option
)
=>
option
.
month_value
,
//
getOptionLabel: (option) => option.month_value,
};
//
};
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
.
month_name
==
month
)
//
let index = data.sort((a, b) => a - b).findIndex((val) => val.month_name == month)
console
.
log
(
index
);
//
console.log(index);
this
.
setState
({
listMonth
:
defaultProps
,
month
:
index
==
-
1
?
monthData
[
0
]
:
monthData
[
index
]
},
()
=>
{
//
this.setState({ listMonth: defaultProps, month: index == -1 ? monthData[0] : monthData[index] }, () => {
this
.
getLastPeriod
()
//
this.getLastPeriod()
})
//
})
}
else
{
//
} else {
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
//
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
//
if (response.data.message.includes("Someone Logged In")) {
setTimeout
(()
=>
{
//
setTimeout(() => {
localStorage
.
removeItem
(
Constant
.
TOKEN
)
//
localStorage.removeItem(Constant.TOKEN)
window
.
location
.
reload
();
//
window.location.reload();
},
1000
);
//
}, 1000);
}
//
}
})
//
})
}
//
}
}
else
{
//
} else {
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
//
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
}
//
}
})
//
})
}
//
}
getReportAttachment
()
{
getReportAttachment
()
{
let
payload
=
{
let
payload
=
{
...
@@ -233,7 +233,7 @@ export default class OperatingIndicator extends Component {
...
@@ -233,7 +233,7 @@ export default class OperatingIndicator extends Component {
};
};
this
.
setState
({
listCompany
:
defaultProps
,
company
:
arrayBaru
.
length
<
1
?
companyData
[
0
]
:
arrayBaru
[
0
]
},
()
=>
{
this
.
setState
({
listCompany
:
defaultProps
,
company
:
arrayBaru
.
length
<
1
?
companyData
[
0
]
:
arrayBaru
[
0
]
},
()
=>
{
this
.
get
Month
()
this
.
get
LastPeriod
()
})
})
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
...
@@ -671,7 +671,7 @@ export default class OperatingIndicator extends Component {
...
@@ -671,7 +671,7 @@ export default class OperatingIndicator extends Component {
data
=
{
this
.
state
.
dataDetail
}
data
=
{
this
.
state
.
dataDetail
}
height
=
{
this
.
props
.
height
}
height
=
{
this
.
props
.
height
}
width
=
{
this
.
props
.
width
}
width
=
{
this
.
props
.
width
}
month
=
{
this
.
state
.
month
}
//
month={this.state.month}
company
=
{
this
.
state
.
company
}
company
=
{
this
.
state
.
company
}
onClickClose
=
{()
=>
this
.
setState
({
visibleDetailMonthly
:
false
,
visibleOperatingIndicator
:
true
},
()
=>
{
onClickClose
=
{()
=>
this
.
setState
({
visibleDetailMonthly
:
false
,
visibleOperatingIndicator
:
true
},
()
=>
{
this
.
getOperatingID
()
this
.
getOperatingID
()
...
...
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