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
Show 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 {
...
@@ -52,8 +52,41 @@ export default class CashFlowMR extends Component {
}
}
componentDidMount
()
{
componentDidMount
()
{
// 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
()
this
.
getItemHierarki
()
// this.getSettingControl()
})
}
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
()
{
getItemHierarki
()
{
...
@@ -180,7 +213,7 @@ export default class CashFlowMR extends Component {
...
@@ -180,7 +213,7 @@ export default class CashFlowMR extends Component {
let
tst
=
'@'
+
String
(
item
).
replace
(
'[M-1]'
,
'[M1]'
)
let
tst
=
'@'
+
String
(
item
).
replace
(
'[M-1]'
,
'[M1]'
)
// console.log(dataTable2[tableMeta.rowIndex]);
// console.log(dataTable2[tableMeta.rowIndex]);
// console.log(tableMeta);
// console.log(tableMeta);
console
.
log
(
tst
);
//
console.log(tst);
let
indexID
=
dataTable2
[
tableMeta
.
rowIndex
][
6
].
formula
.
findIndex
((
val
)
=>
val
.
item_formula
==
tst
)
let
indexID
=
dataTable2
[
tableMeta
.
rowIndex
][
6
].
formula
.
findIndex
((
val
)
=>
val
.
item_formula
==
tst
)
// console.log(indexID);
// console.log(indexID);
...
@@ -450,7 +483,7 @@ export default class CashFlowMR extends Component {
...
@@ -450,7 +483,7 @@ export default class CashFlowMR extends Component {
// console.log(tableMeta);
// console.log(tableMeta);
return
(
return
(
<
div
style
=
{{
textAlign
:
'right'
}}
>
<
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'
}}
>
<
span
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
}}
>
<
NumberFormat
<
NumberFormat
thousandSeparator
=
{
true
}
thousandSeparator
=
{
true
}
...
@@ -460,7 +493,55 @@ export default class CashFlowMR extends Component {
...
@@ -460,7 +493,55 @@ export default class CashFlowMR extends Component {
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
handleValueFormula
(
tableMeta
,
6
)).
toFixed
(
1
)}
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
>
<
/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