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
0d0a8cbf
Commit
0d0a8cbf
authored
Sep 11, 2020
by
Rifka Kurnia Irfiana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update all menu management document
parent
d22556a7
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
409 additions
and
54 deletions
+409
-54
index.js
src/api/index.js
+2
-0
AuditTahunan.js
src/container/DocumentManagement/AuditTahunan.js
+1
-1
BOD.js
src/container/DocumentManagement/BOD.js
+37
-19
CreateManagementDoc.js
src/container/DocumentManagement/CreateManagementDoc.js
+80
-5
DocumentManagement.js
src/container/DocumentManagement/DocumentManagement.js
+30
-12
ManualBookETMS.js
src/container/DocumentManagement/ManualBookETMS.js
+75
-0
ManualBookTia.js
src/container/DocumentManagement/ManualBookTia.js
+40
-1
PopUpKonfirmasi.js
src/container/DocumentManagement/PopUpKonfirmasi.js
+99
-0
QReview.js
src/container/DocumentManagement/QReview.js
+45
-16
No files found.
src/api/index.js
View file @
0d0a8cbf
...
...
@@ -179,6 +179,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const
getDocumentCategory
=
(
body
)
=>
api
.
post
(
'setting/get_all_setting_document_category'
,
body
)
const
getAllDocument
=
(
body
)
=>
api
.
post
(
'document/get_all_document'
,
body
)
const
uploadDocument
=
(
body
)
=>
api
.
post
(
'document/upload_document'
,
body
)
const
updateDocument
=
(
body
)
=>
api
.
post
(
'document/update_document'
,
body
)
// ------
// STEP 3
...
...
@@ -286,6 +287,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
getDocumentCategory
,
getAllDocument
,
uploadDocument
,
updateDocument
,
createSubmitReport
,
getSubmission
}
...
...
src/container/DocumentManagement/AuditTahunan.js
View file @
0d0a8cbf
...
...
@@ -44,7 +44,7 @@ export default class AuditTahunan extends Component {
item
.
document_name
,
item
.
description
,
item
.
company_name
,
""
,
item
.
document_periode
,
item
.
document_type
,
String
(
Number
(
item
.
document_size
)
/
1000
+
' MB'
),
item
.
created_by
,
...
...
src/container/DocumentManagement/BOD.js
View file @
0d0a8cbf
...
...
@@ -9,40 +9,58 @@ var ct = require("../../library/CustomTable");
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
const
options
=
ct
.
customOptionsManagementDocument
();
export
default
class
AuditTahunan
extends
Component
{
export
default
class
BOD
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
dataTable
:
[],
visibleCreate
:
false
visibleCreate
:
false
,
refresh
:
''
}
}
componentDidMount
()
{
console
.
log
(
this
.
props
.
data
)
//
console.log(this.props.data)
this
.
getData
()
}
componentWillReceiveProps
(
props
)
{
// console.log(props);
const
{
refresh
,
id
}
=
this
.
props
;
if
(
props
.
refresh
!==
refresh
)
{
this
.
getData
()
}
}
getData
()
{
let
payload
=
{
"company_id"
:
1
,
"document_category_id"
:
4
"setting_id"
:
this
.
props
.
data
.
setting_id
}
api
.
create
().
getAllDocument
(
payload
).
then
(
respone
=>
{
let
dataTable
=
respone
.
data
.
data
.
map
(
item
=>
{
return
[
item
.
document_name
,
item
.
description
,
item
.
company_name
,
""
,
item
.
document_type
,
String
(
Number
(
item
.
document_size
)
/
1000
+
' MB'
),
item
.
created_by
,
item
.
created_at
,
]
})
this
.
setState
({
dataTable
})
api
.
create
().
getAllDocument
(
payload
).
then
((
response
)
=>
{
console
.
log
(
response
)
if
(
response
.
problem
){
alert
(
response
.
problem
)
}
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
==
'success'
)
{
let
dataTable
=
response
.
data
.
data
.
map
(
item
=>
{
return
[
item
.
document_name
,
item
.
description
,
item
.
company_name
,
item
.
document_periode
,
item
.
document_type
,
String
(
Number
(
item
.
document_size
)
/
1000
+
' MB'
),
item
.
created_by
,
item
.
created_at
,
]
})
this
.
setState
({
dataTable
})
}
}
}
})
}
...
...
src/container/DocumentManagement/CreateManagementDoc.js
View file @
0d0a8cbf
...
...
@@ -9,6 +9,7 @@ import UploadFile from "../../library/Upload";
import
{
ExcelRenderer
}
from
'react-excel-renderer'
;
import
*
as
R
from
'ramda'
import
MuiAlert
from
'@material-ui/lab/Alert'
;
import
PopUpKonfirmasi
from
"./PopUpKonfirmasi"
;
const
Alert
=
withStyles
({
})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
...
...
@@ -36,7 +37,9 @@ export default class CreateManagementDoc extends Component {
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
,
fileType
:
''
fileType
:
''
,
konfirmasi
:
false
,
docId
:
''
}
}
...
...
@@ -192,11 +195,72 @@ export default class CreateManagementDoc extends Component {
createDocument
(){
api
.
create
().
uploadDocument
(
this
.
state
.
formData
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
props
.
getDataDocument
(
this
.
props
.
setting_id
)
this
.
props
.
onClickClose
()
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
message
===
"The Document Already Exists in The System, Do You Want to Overwrite It?"
)
{
let
docId
=
response
.
data
.
data
this
.
setState
({
docId
})
this
.
setState
({
konfirmasi
:
true
})
// console.log(this.state.docId)
}
else
if
(
response
.
data
.
message
===
"Upload Document Success"
)
{
this
.
props
.
getDataDocument
(
this
.
props
.
setting_id
)
this
.
props
.
onClickClose
()
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
})
}
createUploadDocument
=
(
payload
)
=>
{
const
docuID
=
Object
.
values
(
payload
)
const
formDatas
=
new
FormData
();
formDatas
.
append
(
"file"
,
this
.
state
.
file
);
formDatas
.
append
(
"companyId"
,
this
.
state
.
getPerusahaan
.
company_id
);
formDatas
.
append
(
"settingId"
,
this
.
state
.
getDocument
.
document_category_id
);
formDatas
.
append
(
"documentPeriode"
,
this
.
state
.
periode
.
periode
);
formDatas
.
append
(
"description"
,
this
.
state
.
description
);
formDatas
.
append
(
"extension"
,
this
.
state
.
fileType
);
formDatas
.
append
(
"documentId"
,
docuID
[
0
]);
api
.
create
().
updateDocument
(
formDatas
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
props
.
getDataDocument
(
this
.
props
.
setting_id
)
this
.
props
.
onClickClose
()
this
.
setState
({
konfirmasi
:
false
})
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
})
}
...
...
@@ -211,6 +275,7 @@ export default class CreateManagementDoc extends Component {
render
()
{
return
(
<
div
>
<
div
className
=
"test app-popup-show"
>
<
Snackbar
open
=
{
this
.
state
.
alert
}
autoHideDuration
=
{
6000
}
onClose
=
{()
=>
this
.
closeAlert
()}
>
<
Alert
onClose
=
{()
=>
this
.
closeAlert
()}
severity
=
{
this
.
state
.
tipeAlert
}
>
...
...
@@ -364,6 +429,16 @@ export default class CreateManagementDoc extends Component {
<
/div
>
<
/div
>
<
/div
>
{
this
.
state
.
konfirmasi
&&
(
<
PopUpKonfirmasi
onClickClosePopUp
=
{()
=>
this
.
setState
({
konfirmasi
:
false
})}
data
=
{
this
.
state
.
docId
}
// getList={() => this.getData.bind(this)}
// deleteAM={this.deleteAM.bind(this)}
uploadDocId
=
{
this
.
createUploadDocument
.
bind
(
this
)}
/
>
)}
<
/div
>
)
}
}
src/container/DocumentManagement/DocumentManagement.js
View file @
0d0a8cbf
...
...
@@ -7,6 +7,8 @@ import api from '../../api'
import
AuditTahunan
from
'./AuditTahunan'
import
CreateManagementDoc
from
'./CreateManagementDoc'
import
QReview
from
'./QReview'
import
BOD
from
'./BOD'
import
ManualBookETMS
from
'./ManualBookETMS'
export
default
class
DocumentManagement
extends
Component
{
constructor
(
props
)
{
...
...
@@ -20,7 +22,7 @@ export default class DocumentManagement extends Component {
selectTab
=
(
event
,
newEvent
)
=>
{
this
.
setState
({
tab
:
newEvent
})
//
console.log(this.state.tab)
console
.
log
(
this
.
state
.
tab
)
}
componentDidMount
()
{
...
...
@@ -44,7 +46,7 @@ export default class DocumentManagement extends Component {
loadTable
:
true
,
refresh
:
id
===
undefined
?
''
:
'create'
})
//
console.log(this.state.listData)
console
.
log
(
this
.
state
.
listData
)
}
else
{
}
...
...
@@ -102,16 +104,32 @@ export default class DocumentManagement extends Component {
data
=
{
this
.
state
.
listData
[
this
.
state
.
tab
]}
refresh
=
{
this
.
state
.
refresh
}
/
>
:
this
.
state
.
id
===
68541
?
<
ManualBookTia
/>
:
this
.
state
.
id
===
68544
?
<
QReview
data
=
{
this
.
state
.
listData
[
this
.
state
.
tab
]}
/
>
:
<
span
>
Test2
<
/span
>
:
this
.
state
.
id
===
68541
?
<
ManualBookTia
data
=
{
this
.
state
.
listData
[
this
.
state
.
tab
]}
refresh
=
{
this
.
state
.
refresh
}
/
>
:
this
.
state
.
id
===
68544
?
<
QReview
data
=
{
this
.
state
.
listData
[
this
.
state
.
tab
]}
refresh
=
{
this
.
state
.
refresh
}
/
>
:
this
.
state
.
id
===
68543
?
<
BOD
data
=
{
this
.
state
.
listData
[
this
.
state
.
tab
]}
refresh
=
{
this
.
state
.
refresh
}
/
>
:
this
.
state
.
id
===
68545
?
<
ManualBookETMS
data
=
{
this
.
state
.
listData
[
this
.
state
.
tab
]}
refresh
=
{
this
.
state
.
refresh
}
/
>
:
<
span
>
Test2
<
/span
>
)}
<
/div
>
...
...
src/container/DocumentManagement/ManualBookETMS.js
0 → 100644
View file @
0d0a8cbf
import
React
,
{
Component
}
from
'react'
import
MUIDataTable
from
'mui-datatables'
import
{
createMuiTheme
,
MuiThemeProvider
}
from
'@material-ui/core'
;
import
api
from
'../../api'
;
var
ct
=
require
(
"../../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
const
options
=
ct
.
customOptions
();
export
default
class
ManualBookETMS
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
dataTable
:
[],
visibleCreate
:
false
,
refresh
:
''
}
}
componentDidMount
()
{
// console.log(this.props.data)
this
.
getData
()
}
componentWillReceiveProps
(
props
)
{
// console.log(props);
const
{
refresh
,
id
}
=
this
.
props
;
if
(
props
.
refresh
!==
refresh
)
{
this
.
getData
()
}
}
getData
()
{
let
payload
=
{
"setting_id"
:
this
.
props
.
data
.
setting_id
}
api
.
create
().
getAllDocument
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
let
dataTable
=
response
.
data
.
data
.
map
(
item
=>
{
return
[
item
.
document_name
,
item
.
description
,
item
.
company_name
,
item
.
document_type
,
String
(
Number
(
item
.
document_size
)
/
1000
+
' MB'
),
item
.
created_by
,
item
.
created_at
,
]
})
this
.
setState
({
dataTable
})
})
}
render
()
{
let
columns
=
[
"Nama File"
,
"Keterangan"
,
"Perusahaan"
,
"Tipe"
,
"Ukuran"
,
"Ditambahkan Oleh"
,
"Ditambahkan Tanggal"
]
return
(
<
div
style
=
{{
width
:
'100%'
}}
>
<
div
style
=
{{
padding
:
25
}}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
theme
=
{
getMuiTheme
()}
data
=
{
this
.
state
.
dataTable
}
columns
=
{
columns
}
options
=
{
options
}
/
>
<
/MuiThemeProvider
>
<
/div
>
<
/div
>
)
}
}
src/container/DocumentManagement/ManualBookTia.js
View file @
0d0a8cbf
import
React
,
{
Component
}
from
'react'
import
MUIDataTable
from
'mui-datatables'
import
{
createMuiTheme
,
MuiThemeProvider
}
from
'@material-ui/core'
;
import
api
from
'../../api'
;
var
ct
=
require
(
"../../library/CustomTable"
);
...
...
@@ -11,10 +12,48 @@ export default class ManualBookTia extends Component {
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
dataTable
:
[]
dataTable
:
[],
visibleCreate
:
false
,
refresh
:
''
}
}
componentDidMount
()
{
// console.log(this.props.data)
this
.
getData
()
}
componentWillReceiveProps
(
props
)
{
// console.log(props);
const
{
refresh
,
id
}
=
this
.
props
;
if
(
props
.
refresh
!==
refresh
)
{
this
.
getData
()
}
}
getData
()
{
let
payload
=
{
"setting_id"
:
this
.
props
.
data
.
setting_id
}
api
.
create
().
getAllDocument
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
let
dataTable
=
response
.
data
.
data
.
map
(
item
=>
{
return
[
item
.
document_name
,
item
.
description
,
item
.
company_name
,
item
.
document_periode
,
item
.
document_type
,
String
(
Number
(
item
.
document_size
)
/
1000
+
' MB'
),
item
.
created_by
,
item
.
created_at
,
]
})
this
.
setState
({
dataTable
})
})
}
render
()
{
let
columns
=
[
"Nama File"
,
"Keterangan"
,
"Perusahaan"
,
"Tipe"
,
"Ukuran"
,
"Ditambahkan Oleh"
,
"Ditambahkan Tanggal"
...
...
src/container/DocumentManagement/PopUpKonfirmasi.js
0 → 100644
View file @
0d0a8cbf
import
React
,
{
Component
}
from
'react'
;
import
Images
from
'../../assets/Images'
;
import
{
Typography
}
from
'@material-ui/core'
;
import
api
from
"../../api"
;
import
Constant
from
'../../library/Constant'
;
export
default
class
PopUpDeleteAM
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
id
:
''
,
getApprovedBy
:
null
,
getTypes
:
null
,
}
}
componentDidMount
()
{
// if (this.props.type === 'delete') {
// this.getDetailAM()
// }
console
.
log
(
this
.
props
.
data
)
}
// getDetailAM() {
// api.create().getDetailAM(this.props.data[1]).then(response => {
// console.log(response.data)
// if (response.data) {
// if (response.ok) {
// if (response.data.status === "success") {
// let data = response.data.data
// this.setState({
// id: data.approval_matrix_id,
// getTypes: data.approval_type_name,
// getApprovedBy: data.fullname
// })
// } else {
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
// 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' })
// }
// } else {
// this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
// }
// })
// }
onClickUpload
()
{
let
payload
=
this
.
props
.
data
this
.
props
.
uploadDocId
(
payload
)
}
render
()
{
return
(
<
div
className
=
"test app-popup-show"
>
<
div
className
=
"popup-content background-white border-radius"
style
=
{{
borderRadius
:
8
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'center'
,
paddingTop
:
20
}}
>
<
img
src
=
{
Images
.
failed
}
/
>
<
/div
>
<
div
style
=
{{
display
:
'grid'
,
justifyContent
:
'center'
,
marginTop
:
20
,
paddingBottom
:
20
}}
>
<
span
style
=
{{
textAlign
:
'center'
,
fontSize
:
14
,
fontWeight
:
'bold'
,
fontFamily
:
'Nunito Sans, sans-serif'
}}
>
The
Document
Already
Exists
in
The
System
,
<
br
/>
Do
You
Want
to
Overwrite
It
?
<
/span
>
<
/div
>
<
div
className
=
"border-top grid grid-2x"
style
=
{{
height
:
56
,
backgroundColor
:
'#f5f5f5'
,
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
div
className
=
"column-1"
style
=
{{
alignSelf
:
'center'
}}
>
<
button
type
=
"button"
onClick
=
{()
=>
this
.
props
.
onClickClosePopUp
()}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Cancel
<
/span
>
<
/div
>
<
/button
>
<
/div
>
<
div
className
=
"column-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
alignItems
:
'center'
}}
>
<
button
type
=
"button"
onClick
=
{()
=>
this
.
onClickUpload
()}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Rewrite
<
/span
>
<
/div
>
<
/button
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
);
}
}
src/container/DocumentManagement/QReview.js
View file @
0d0a8cbf
import
React
,
{
Component
}
from
'react'
import
MUIDataTable
from
'mui-datatables'
import
{
createMuiTheme
,
MuiThemeProvider
}
from
'@material-ui/core'
;
import
{
withStyles
}
from
'@material-ui/core/styles'
;
import
{
createMuiTheme
,
MuiThemeProvider
,
Snackbar
}
from
'@material-ui/core'
;
import
api
from
'../../api'
;
import
MuiAlert
from
'@material-ui/lab/Alert'
;
import
Constant
from
'../../library/Constant'
;
import
CreateManagementDoc
from
'./CreateManagementDoc'
;
...
...
@@ -9,7 +12,10 @@ var ct = require("../../library/CustomTable");
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
const
options
=
ct
.
customOptionsManagementDocument
();
export
default
class
AuditTahunan
extends
Component
{
const
Alert
=
withStyles
({
})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
export
default
class
QReview
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
...
...
@@ -37,24 +43,42 @@ export default class AuditTahunan extends Component {
"setting_id"
:
this
.
props
.
data
.
setting_id
}
api
.
create
().
getAllDocument
(
payload
).
then
(
response
=>
{
api
.
create
().
getAllDocument
(
payload
).
then
(
(
response
)
=>
{
console
.
log
(
response
)
if
(
response
.
problem
){
alert
(
response
.
problem
)
}
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
==
'success'
)
{
let
dataTable
=
response
.
data
.
data
.
map
(
item
=>
{
return
[
item
.
document_name
,
item
.
description
,
item
.
company_name
,
item
.
document_periode
,
item
.
document_type
,
String
(
Number
(
item
.
document_size
)
/
1000
+
' MB'
),
item
.
created_by
,
item
.
created_at
,
]
})
this
.
setState
({
dataTable
})
}
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
.
data
.
message
,
tipeAlert
:
'error'
,
loading
:
false
})
}
}
else
{
let
dataTable
=
response
.
data
.
data
.
map
(
item
=>
{
return
[
item
.
document_name
,
item
.
description
,
item
.
company_name
,
""
,
item
.
document_type
,
String
(
Number
(
item
.
document_size
)
/
1000
+
' MB'
),
item
.
created_by
,
item
.
created_at
,
]
})
this
.
setState
({
dataTable
})
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
}
})
}
...
...
@@ -66,6 +90,11 @@ export default class AuditTahunan extends Component {
return
(
<
div
style
=
{{
width
:
'100%'
}}
>
<
div
style
=
{{
padding
:
25
}}
>
<
Snackbar
open
=
{
this
.
state
.
alert
}
autoHideDuration
=
{
6000
}
onClose
=
{()
=>
this
.
closeAlert
()}
>
<
Alert
onClose
=
{()
=>
this
.
closeAlert
()}
severity
=
{
this
.
state
.
tipeAlert
}
>
{
this
.
state
.
messageAlert
}
<
/Alert
>
<
/Snackbar
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
theme
=
{
getMuiTheme
()}
...
...
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