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
ec20cceb
Commit
ec20cceb
authored
Jan 09, 2021
by
Riri Novita
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'riri' into 'master'
oioi See merge request
!931
parents
a9893a46
acdf1e07
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
31 deletions
+26
-31
OperatingIndicatorMR.js
src/container/MonthlyReport/OperatingIndicatorMR.js
+26
-31
No files found.
src/container/MonthlyReport/OperatingIndicatorMR.js
View file @
ec20cceb
...
@@ -79,32 +79,11 @@ export default class OperatingIndicatorMR extends Component {
...
@@ -79,32 +79,11 @@ export default class OperatingIndicatorMR extends Component {
}
}
handleViewOnly
()
{
handleViewOnly
()
{
let
check
Approver
=
fals
e
let
check
Create
=
this
.
props
.
permission
.
creat
e
let
check
LastStatus
=
false
let
check
Edit
=
this
.
props
.
permission
.
edit
let
check
Status
=
false
let
check
IsSubmit
=
this
.
props
.
isSubmit
if
(
this
.
props
.
isApprover
)
{
this
.
setState
({
viewOnly
:
checkCreate
&&
checkEdit
&&
checkIsSubmit
})
checkApprover
=
true
}
else
{
checkApprover
=
false
}
if
(
this
.
props
.
lastStatus
==
'SUBMIT'
||
this
.
props
.
lastStatus
==
'REVISION'
)
{
checkLastStatus
=
true
}
else
{
checkLastStatus
=
false
}
// else if (this.props.prevRevision) {
// viewOnly = false
// }
if
(
this
.
props
.
status
===
'revision'
||
this
.
props
.
status
===
'not-yet'
||
this
.
props
.
status
===
'draft'
||
this
.
props
.
status
===
'submitted'
)
{
checkStatus
=
true
}
else
{
checkStatus
=
false
}
this
.
setState
({
viewOnly
:
!
checkApprover
&&
checkLastStatus
&&
checkStatus
})
}
}
handleGetFor
(
type
)
{
handleGetFor
(
type
)
{
...
@@ -417,6 +396,7 @@ export default class OperatingIndicatorMR extends Component {
...
@@ -417,6 +396,7 @@ export default class OperatingIndicatorMR extends Component {
monthly_report
:
payload
monthly_report
:
payload
}
}
console
.
log
(
body
)
console
.
log
(
body
)
console
.
log
(
JSON
.
stringify
(
body
));
this
.
setState
({
payload
:
body
,
judul
:
resp
.
rows
[
1
][
0
],
judulColumn
:
resp
.
rows
[
0
][
0
]
})
this
.
setState
({
payload
:
body
,
judul
:
resp
.
rows
[
1
][
0
],
judulColumn
:
resp
.
rows
[
0
][
0
]
})
}
}
});
});
...
@@ -430,11 +410,22 @@ export default class OperatingIndicatorMR extends Component {
...
@@ -430,11 +410,22 @@ export default class OperatingIndicatorMR extends Component {
if
(
response
.
data
.
status
===
'success'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
this
.
setState
({
visibleUpload
:
false
,
visibleOI
:
false
,
loading
:
true
})
this
.
setState
({
visibleUpload
:
false
,
visibleOI
:
false
,
loading
:
true
})
let
total
=
0
let
total
=
0
let
err
=
false
let
dataTable
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
let
dataTable
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
console
.
log
(
item
);
console
.
log
(
item
);
if
(
item
.
type_report_id
!=
null
)
{
if
(
item
.
type_report_id
!=
null
)
{
total
+=
1
total
+=
1
}
}
// if (item.type_report_id === 3) {
// if (item.mtd_vs_mb === "" && (Number(item.percent_act_vs_mb) < this.state.minValue || Number(item.percent_act_vs_mb) > this.state.maxValue)) {
// err = true
// }
// if (item.mtd_vs_rb === "" && (Number(item.percent_act_vs_rb) < this.state.minValue || Number(item.percent_act_vs_rb) > this.state.maxValue)) {
// console.log('msk 2');
// err = true
// }
// }
return
[
return
[
item
.
type_report_id
,
item
.
type_report_id
,
item
.
item_report_id
,
item
.
item_report_id
,
...
@@ -461,6 +452,7 @@ export default class OperatingIndicatorMR extends Component {
...
@@ -461,6 +452,7 @@ export default class OperatingIndicatorMR extends Component {
item
.
error
item
.
error
]
]
})
})
console
.
log
(
dataTable
);
this
.
setState
({
dataTable
,
dataLoaded
:
true
,
loading
:
false
,
buttonError
:
false
,
templateNull
:
total
>
0
?
true
:
false
})
this
.
setState
({
dataTable
,
dataLoaded
:
true
,
loading
:
false
,
buttonError
:
false
,
templateNull
:
total
>
0
?
true
:
false
})
}
}
}
}
...
@@ -1418,7 +1410,7 @@ export default class OperatingIndicatorMR extends Component {
...
@@ -1418,7 +1410,7 @@ export default class OperatingIndicatorMR extends Component {
defaultValue
=
{
tableMeta
.
rowData
[
15
]}
defaultValue
=
{
tableMeta
.
rowData
[
15
]}
inputProps
=
{{
inputProps
=
{{
style
:
{
style
:
{
color
:
Number
(
tableMeta
.
rowData
[
12
])
<
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
12
])
>
this
.
state
.
maxValue
?
"#
5198ea"
:
'#5198ea
'
,
color
:
Number
(
tableMeta
.
rowData
[
12
])
<
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
12
])
>
this
.
state
.
maxValue
?
"#
000000b0"
:
'#000000b0
'
,
textAlign
:
'left'
textAlign
:
'left'
}
}
}}
}}
...
@@ -1498,12 +1490,12 @@ export default class OperatingIndicatorMR extends Component {
...
@@ -1498,12 +1490,12 @@ export default class OperatingIndicatorMR extends Component {
defaultValue
=
{
tableMeta
.
rowData
[
16
]}
defaultValue
=
{
tableMeta
.
rowData
[
16
]}
inputProps
=
{{
inputProps
=
{{
style
:
{
style
:
{
color
:
Number
(
tableMeta
.
rowData
[
14
])
<
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
14
])
>
this
.
state
.
maxValue
?
"#
5198ea"
:
'#5198ea
'
,
color
:
Number
(
tableMeta
.
rowData
[
14
])
<
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
14
])
>
this
.
state
.
maxValue
?
"#
000000b0"
:
'#000000b0
'
,
textAlign
:
'left'
textAlign
:
'left'
}
}
}}
}}
onBlur
=
{(
event
)
=>
{
onBlur
=
{(
event
)
=>
{
handleText
(
event
.
target
.
value
,
tableMeta
,
0
)
handleText
(
event
.
target
.
value
,
tableMeta
,
1
)
}}
}}
/
>
/
>
:
:
...
@@ -1532,7 +1524,7 @@ export default class OperatingIndicatorMR extends Component {
...
@@ -1532,7 +1524,7 @@ export default class OperatingIndicatorMR extends Component {
}
}
}}
}}
onBlur
=
{(
event
)
=>
{
onBlur
=
{(
event
)
=>
{
handleText
(
event
.
target
.
value
,
tableMeta
,
0
)
handleText
(
event
.
target
.
value
,
tableMeta
,
1
)
}}
}}
/
>
/
>
<
/LightTooltipError>
<
/LightTooltipError>
...
@@ -1552,7 +1544,7 @@ export default class OperatingIndicatorMR extends Component {
...
@@ -1552,7 +1544,7 @@ export default class OperatingIndicatorMR extends Component {
}
}
}}
}}
onBlur
=
{(
event
)
=>
{
onBlur
=
{(
event
)
=>
{
handleText
(
event
.
target
.
value
,
tableMeta
,
0
)
handleText
(
event
.
target
.
value
,
tableMeta
,
1
)
}}
}}
/
>
/
>
}
}
...
@@ -1675,13 +1667,16 @@ export default class OperatingIndicatorMR extends Component {
...
@@ -1675,13 +1667,16 @@ export default class OperatingIndicatorMR extends Component {
<
div
style
=
{{
marginTop
:
20
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
400
:
150
)
}}
>
<
div
style
=
{{
marginTop
:
20
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
400
:
150
)
}}
>
{
this
.
state
.
loading
&&
loadingComponent
}
{
this
.
state
.
loading
&&
loadingComponent
}
{
!
this
.
state
.
loading
&&
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
<
MUIDataTable
data
=
{
dataTable2
}
data
=
{
dataTable2
}
columns
=
{
columns
}
columns
=
{
columns
}
options
=
{
options
}
options
=
{
options
}
/
>
/
>
<
/MuiThemeProvider
>
<
/MuiThemeProvider
>
}
<
/div
>
<
/div
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
,
marginTop
:
20
}}
>
Last
Updated
by
:
{
this
.
state
.
updateBy
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
,
marginTop
:
20
}}
>
Last
Updated
by
:
{
this
.
state
.
updateBy
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
,
marginTop
:
10
}}
>
Notes
:
{
this
.
state
.
notesUpdate
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
,
marginTop
:
10
}}
>
Notes
:
{
this
.
state
.
notesUpdate
}
<
/Typography
>
...
...
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