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
9f9ad787
Commit
9f9ad787
authored
Jul 14, 2022
by
muhammad ridwan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixing and using one component
parent
7b555da0
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
741 deletions
+60
-741
CarfmDocument.js
src/container/CRFM/CarfmDocument.js
+37
-10
CreateCarfmDoc.js
src/container/CRFM/CreateCarfmDoc.js
+19
-11
InternalAudit.js
src/container/CRFM/InternalAudit.js
+0
-357
RiskManagement.js
src/container/CRFM/RiskManagement.js
+0
-357
homeRoutes.js
src/router/homeRoutes.js
+4
-6
No files found.
src/container/CRFM/
AntiFraud
.js
→
src/container/CRFM/
CarfmDocument
.js
View file @
9f9ad787
...
...
@@ -9,11 +9,11 @@ import api from '../../api';
import
PropagateLoader
from
"react-spinners/PropagateLoader"
import
TableDocument
from
"./TableDocument"
;
import
PopUpKonfirmasi
from
"../DocumentManagement/PopUpKonfirmasi"
;
import
CreateC
rafmDoc
from
"./CreateCra
fmDoc"
;
import
CreateC
arfmDoc
from
"./CreateCar
fmDoc"
;
const
Alert
=
withStyles
({})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
export
default
class
RiskManage
ment
extends
Component
{
export
default
class
CarfmDocu
ment
extends
Component
{
constructor
(
props
)
{
super
(
props
);
...
...
@@ -27,21 +27,48 @@ export default class RiskManagement extends Component {
name
:
''
,
userCompActive
:
[],
isHasAccessDocument
:
false
,
submenu_id
:
27
,
submenu_name
:
"
anti-fraud
"
,
menu_title
:
"
Anti-Fraud
"
submenu_id
:
0
,
submenu_name
:
""
,
menu_title
:
""
}
}
componentDidMount
()
{
async
componentDidMount
()
{
// this.getPermission()
await
this
.
getMenuName
();
this
.
getDataCarfm
();
this
.
getDetailUser
();
}
getDataCarfm
(){
async
getMenuName
(){
await
api
.
create
().
getMenuByUser
().
then
(
response
=>
{
if
(
response
.
data
){
if
(
response
.
data
.
status
===
'success'
){
response
.
data
.
data
.
map
(
(
item
)
=>
{
let
arr
=
window
.
location
.
href
.
split
(
'/'
);
if
(
item
.
class_id
==
arr
.
slice
(
-
1
)[
0
]){
this
.
setState
({
submenu_id
:
item
.
menu_id
,
submenu_name
:
item
.
menu_name
.
toLowerCase
(),
menu_title
:
item
.
menu_name
.
replace
(
/
\b\w
/g
,
c
=>
c
.
toUpperCase
())
})
}
}
)
}
}
}
)
}
getDataCarfm
(
create
){
let
payload
=
{
submenu_id
:
this
.
state
.
submenu_id
}
...
...
@@ -63,7 +90,7 @@ export default class RiskManagement extends Component {
isHasAccessDocument
:
dataList
.
length
==
0
?
false
:
true
,
listData
:
dataList
,
loadTable
:
true
,
refresh
:
''
refresh
:
create
==
undefined
?
''
:
create
},
()
=>
{
this
.
getPermission
(
this
.
state
.
submenu_name
)
})
...
...
@@ -213,7 +240,7 @@ export default class RiskManagement extends Component {
this
.
setState
({
konfirmasi
:
true
,
formData
:
payload
,
docId
:
response
.
data
.
data
.
document_id
,
loading
:
false
})
}
else
if
(
response
.
data
.
message
===
"Data was Saved Successfully"
)
{
this
.
getDataCarfm
()
this
.
getDataCarfm
(
'create'
)
this
.
setState
({
visibleCreate
:
false
,
loading
:
false
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
}
else
{
...
...
@@ -339,7 +366,7 @@ export default class RiskManagement extends Component {
/>
)}
{this.state.visibleCreate && (
<CreateC
ra
fmDoc
<CreateC
ar
fmDoc
onClickClose={() => this.setState({ visibleCreate: false })}
// getDataDocument={this.getDataDocument.bind(this)}
createDocument={this.createDocument.bind(this)}
...
...
src/container/CRFM/CreateC
ra
fmDoc.js
→
src/container/CRFM/CreateC
ar
fmDoc.js
View file @
9f9ad787
...
...
@@ -14,7 +14,7 @@ import PropagateLoader from "react-spinners/PropagateLoader"
const
Alert
=
withStyles
({
})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
export
default
class
CreateC
ra
fmDoc
extends
Component
{
export
default
class
CreateC
ar
fmDoc
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
...
...
@@ -48,7 +48,8 @@ export default class CreateCrafmDoc extends Component {
docId
:
''
,
sizeUpload
:
"1"
,
disabledPeriode
:
false
,
menuName
:
null
menuName
:
null
,
saveDisable
:
false
}
}
...
...
@@ -253,7 +254,7 @@ export default class CreateCrafmDoc extends Component {
validasi
()
{
if
(
this
.
state
.
disabledPeriode
===
true
)
{
if
(
R
.
isNil
(
this
.
state
.
file
))
{
this
.
setState
({
alert
:
true
,
messageAlert
:
'File Cannot be Empty'
,
tipeAlert
:
'warning'
})
this
.
setState
({
alert
:
true
,
messageAlert
:
'File Cannot be Empty'
,
tipeAlert
:
'warning'
,
saveDisable
:
false
})
}
else
{
const
formData
=
new
FormData
();
formData
.
append
(
"file"
,
this
.
state
.
file
);
...
...
@@ -276,14 +277,14 @@ export default class CreateCrafmDoc extends Component {
}
else
{
if
(
R
.
isNil
(
this
.
state
.
getPerusahaan
))
{
this
.
setState
({
errorPerusahaan
:
true
,
msgErrorPerusahaan
:
'Company Cannot be Empty'
})
this
.
setState
({
errorPerusahaan
:
true
,
msgErrorPerusahaan
:
'Company Cannot be Empty'
,
saveDisable
:
false
})
}
else
if
(
R
.
isNil
(
this
.
state
.
periode
))
{
this
.
setState
({
errorPeriode
:
true
,
msgErrorPeriode
:
'Period Cannot be Empty'
})
this
.
setState
({
errorPeriode
:
true
,
msgErrorPeriode
:
'Period Cannot be Empty'
,
saveDisable
:
false
})
}
else
if
(
R
.
isNil
(
this
.
state
.
monthId
))
{
this
.
setState
({
errorMonth
:
true
,
msgErrorMonth
:
'Month Cannot be Empty'
})
this
.
setState
({
errorMonth
:
true
,
msgErrorMonth
:
'Month Cannot be Empty'
,
saveDisable
:
false
})
}
else
if
(
R
.
isNil
(
this
.
state
.
file
))
{
this
.
setState
({
alert
:
true
,
messageAlert
:
'File Cannot be Empty'
,
tipeAlert
:
'warning'
})
this
.
setState
({
alert
:
true
,
messageAlert
:
'File Cannot be Empty'
,
tipeAlert
:
'warning'
,
saveDisable
:
false
})
}
else
{
const
formData
=
new
FormData
();
formData
.
append
(
"file"
,
this
.
state
.
file
);
...
...
@@ -484,13 +485,19 @@ export default class CreateCrafmDoc extends Component {
<
/button
>
<
/div
>
<
div
className
=
"column-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
alignItems
:
'center'
}}
>
<
button
{
!
this
.
state
.
saveDisable
&&
<
button
disabled
=
{
this
.
state
.
saveDisable
}
type
=
"button"
onClick
=
{()
=>
{
this
.
props
.
handleLoading
(
1
)
{
this
.
setState
({
saveDisable
:
true
});
this
.
props
.
handleLoading
(
1
);
setTimeout
(()
=>
{
this
.
validasi
()
console
.
log
(
this
.
validasi
());
console
.
log
(
"vlidasi "
+
this
.
validasi
());
},
100
)
}
}
...
...
@@ -498,7 +505,8 @@ export default class CreateCrafmDoc extends Component {
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Save
<
/span
>
<
/div
>
<
/button
>
<
/button>
}
<
/div
>
<
/div
>
<
/div
>
...
...
src/container/CRFM/InternalAudit.js
deleted
100644 → 0
View file @
7b555da0
This diff is collapsed.
Click to expand it.
src/container/CRFM/RiskManagement.js
deleted
100644 → 0
View file @
7b555da0
This diff is collapsed.
Click to expand it.
src/router/homeRoutes.js
View file @
9f9ad787
...
...
@@ -20,9 +20,7 @@ import SubHolding from '../container/Reports/SubHolding';
import
SummaryTriputra
from
'../container/SummaryTriputra/SummaryOfTriputra'
;
import
MasterDataCAT
from
'../container/MasterData/MasterDataCAT/MasterDataCAT'
;
import
ProgressReport
from
'../container/ProgressReport/ProgressReport'
;
import
InternalAudit
from
"../container/CRFM/InternalAudit"
;
import
AntiFraud
from
"../container/CRFM/AntiFraud"
;
import
RiskManagement
from
"../container/CRFM/RiskManagement"
;
import
CarfmDocument
from
"../container/CRFM/CarfmDocument"
;
const
routes
=
[
{
...
...
@@ -115,15 +113,15 @@ const routes = [
},
{
path
:
"/home/internal-audit"
,
main
:
InternalAudi
t
main
:
CarfmDocumen
t
},
{
path
:
"/home/anti-fraud"
,
main
:
AntiFraud
main
:
CarfmDocument
},
{
path
:
"/home/risk-management"
,
main
:
RiskManage
ment
main
:
CarfmDocu
ment
},
{
path
:
"*"
,
...
...
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