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
3dcaf866
Commit
3dcaf866
authored
Jan 09, 2021
by
rifkaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cf validasi merah
parent
b1920180
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
86 additions
and
5 deletions
+86
-5
CashFlowMR.js
src/container/MonthlyReport/CashFlowMR.js
+86
-5
No files found.
src/container/MonthlyReport/CashFlowMR.js
View file @
3dcaf866
...
...
@@ -52,8 +52,41 @@ export default class CashFlowMR extends Component {
}
componentDidMount
()
{
this
.
getItemHierarki
()
// this.getSettingControl()
// this.getItemHierarki()
this
.
getSettingControl
()
}
getSettingControl
()
{
let
body
=
{
group
:
'THRESHOLD_CONTROL'
,
company_id
:
this
.
props
.
company
.
company_id
,
type
:
'CASH_FLOW'
}
api
.
create
().
getAllSettingByType
(
body
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
this
.
setState
({
minValue
:
response
.
data
.
data
[
0
]
?
response
.
data
.
data
[
0
].
min_value
:
null
,
maxValue
:
response
.
data
.
data
[
0
]
?
response
.
data
.
data
[
0
].
max_value
:
null
,
},
()
=>
{
this
.
getItemHierarki
()
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
}
})
}
getItemHierarki
()
{
...
...
@@ -180,7 +213,7 @@ export default class CashFlowMR extends Component {
let
tst
=
'@'
+
String
(
item
).
replace
(
'[M-1]'
,
'[M1]'
)
// console.log(dataTable2[tableMeta.rowIndex]);
// console.log(tableMeta);
console
.
log
(
tst
);
//
console.log(tst);
let
indexID
=
dataTable2
[
tableMeta
.
rowIndex
][
6
].
formula
.
findIndex
((
val
)
=>
val
.
item_formula
==
tst
)
// console.log(indexID);
...
...
@@ -450,7 +483,7 @@ export default class CashFlowMR extends Component {
// console.log(tableMeta);
return
(
<
div
style
=
{{
textAlign
:
'right'
}}
>
{
tableMeta
.
rowData
[
0
]
===
5
||
tableMeta
.
rowData
[
0
]
===
6
||
tableMeta
.
rowData
[
0
]
===
7
?
{
tableMeta
.
rowData
[
0
]
===
5
||
tableMeta
.
rowData
[
0
]
===
6
?
<
span
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
}}
>
<
NumberFormat
thousandSeparator
=
{
true
}
...
...
@@ -460,7 +493,55 @@ export default class CashFlowMR extends Component {
disabled
=
{
true
}
value
=
{
Number
(
handleValueFormula
(
tableMeta
,
6
)).
toFixed
(
1
)}
/
>
<
/span> : null
}
<
/span>
:
tableMeta
.
rowData
[
0
]
===
7
?
// <span style={{ fontSize: 12, textAlign: 'right' }}>
// <NumberFormat
// thousandSeparator={true}
// style={{ color: Number(handleValueFormula(tableMeta, 6)).toFixed(1) > Number(this.state.minValue) || Number(handleValueFormula(tableMeta, 6)).toFixed(1) < Number(this.state.maxValue) ? 'red' : 'black' , fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleValueFormula(tableMeta, 6)).toFixed(1)}
// />
// </span>
(
Number
(
handleValueFormula
(
tableMeta
,
6
)).
toFixed
(
1
)
>
Number
(
this
.
state
.
minValue
)
&&
Number
(
handleValueFormula
(
tableMeta
,
6
)).
toFixed
(
1
)
<
Number
(
this
.
state
.
maxValue
))
?
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
,
color
:
'black'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
handleValueFormula
(
tableMeta
,
6
)).
toFixed
(
1
)}
/>
:
<
LightTooltip
title
=
{
this
.
state
.
minValue
===
null
?
null
:
`Value Should be (
${
this
.
state
.
minValue
}
) up to (
${
this
.
state
.
maxValue
}
)`
}
arrow
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
,
color
:
'red'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
handleValueFormula
(
tableMeta
,
6
)).
toFixed
(
1
)}
/
>
<
/LightTooltip
>
:
null
}
<
/div
>
)
}
...
...
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