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
259d8c8a
Commit
259d8c8a
authored
Sep 11, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rifka' into 'master'
update all menu managdoc See merge request
!287
parents
f639c475
85241424
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 @
259d8c8a
...
@@ -179,6 +179,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
...
@@ -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
getDocumentCategory
=
(
body
)
=>
api
.
post
(
'setting/get_all_setting_document_category'
,
body
)
const
getAllDocument
=
(
body
)
=>
api
.
post
(
'document/get_all_document'
,
body
)
const
getAllDocument
=
(
body
)
=>
api
.
post
(
'document/get_all_document'
,
body
)
const
uploadDocument
=
(
body
)
=>
api
.
post
(
'document/upload_document'
,
body
)
const
uploadDocument
=
(
body
)
=>
api
.
post
(
'document/upload_document'
,
body
)
const
updateDocument
=
(
body
)
=>
api
.
post
(
'document/update_document'
,
body
)
// ------
// ------
// STEP 3
// STEP 3
...
@@ -286,6 +287,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
...
@@ -286,6 +287,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
getDocumentCategory
,
getDocumentCategory
,
getAllDocument
,
getAllDocument
,
uploadDocument
,
uploadDocument
,
updateDocument
,
createSubmitReport
,
createSubmitReport
,
getSubmission
getSubmission
}
}
...
...
src/container/DocumentManagement/AuditTahunan.js
View file @
259d8c8a
...
@@ -44,7 +44,7 @@ export default class AuditTahunan extends Component {
...
@@ -44,7 +44,7 @@ export default class AuditTahunan extends Component {
item
.
document_name
,
item
.
document_name
,
item
.
description
,
item
.
description
,
item
.
company_name
,
item
.
company_name
,
""
,
item
.
document_periode
,
item
.
document_type
,
item
.
document_type
,
String
(
Number
(
item
.
document_size
)
/
1000
+
' MB'
),
String
(
Number
(
item
.
document_size
)
/
1000
+
' MB'
),
item
.
created_by
,
item
.
created_by
,
...
...
src/container/DocumentManagement/BOD.js
View file @
259d8c8a
...
@@ -9,40 +9,58 @@ var ct = require("../../library/CustomTable");
...
@@ -9,40 +9,58 @@ var ct = require("../../library/CustomTable");
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
const
options
=
ct
.
customOptionsManagementDocument
();
const
options
=
ct
.
customOptionsManagementDocument
();
export
default
class
AuditTahunan
extends
Component
{
export
default
class
BOD
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
this
.
state
=
{
this
.
state
=
{
dataTable
:
[],
dataTable
:
[],
visibleCreate
:
false
visibleCreate
:
false
,
refresh
:
''
}
}
}
}
componentDidMount
()
{
componentDidMount
()
{
console
.
log
(
this
.
props
.
data
)
//
console.log(this.props.data)
this
.
getData
()
this
.
getData
()
}
}
componentWillReceiveProps
(
props
)
{
// console.log(props);
const
{
refresh
,
id
}
=
this
.
props
;
if
(
props
.
refresh
!==
refresh
)
{
this
.
getData
()
}
}
getData
()
{
getData
()
{
let
payload
=
{
let
payload
=
{
"company_id"
:
1
,
"setting_id"
:
this
.
props
.
data
.
setting_id
"document_category_id"
:
4
}
}
api
.
create
().
getAllDocument
(
payload
).
then
(
respone
=>
{
api
.
create
().
getAllDocument
(
payload
).
then
((
response
)
=>
{
let
dataTable
=
respone
.
data
.
data
.
map
(
item
=>
{
console
.
log
(
response
)
return
[
if
(
response
.
problem
){
item
.
document_name
,
alert
(
response
.
problem
)
item
.
description
,
}
item
.
company_name
,
if
(
response
.
data
)
{
""
,
if
(
response
.
ok
)
{
item
.
document_type
,
if
(
response
.
data
.
status
==
'success'
)
{
String
(
Number
(
item
.
document_size
)
/
1000
+
' MB'
),
let
dataTable
=
response
.
data
.
data
.
map
(
item
=>
{
item
.
created_by
,
return
[
item
.
created_at
,
item
.
document_name
,
]
item
.
description
,
})
item
.
company_name
,
this
.
setState
({
dataTable
})
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 @
259d8c8a
...
@@ -9,6 +9,7 @@ import UploadFile from "../../library/Upload";
...
@@ -9,6 +9,7 @@ import UploadFile from "../../library/Upload";
import
{
ExcelRenderer
}
from
'react-excel-renderer'
;
import
{
ExcelRenderer
}
from
'react-excel-renderer'
;
import
*
as
R
from
'ramda'
import
*
as
R
from
'ramda'
import
MuiAlert
from
'@material-ui/lab/Alert'
;
import
MuiAlert
from
'@material-ui/lab/Alert'
;
import
PopUpKonfirmasi
from
"./PopUpKonfirmasi"
;
const
Alert
=
withStyles
({
const
Alert
=
withStyles
({
})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
...
@@ -36,7 +37,9 @@ export default class CreateManagementDoc extends Component {
...
@@ -36,7 +37,9 @@ export default class CreateManagementDoc extends Component {
alert
:
false
,
alert
:
false
,
tipeAlert
:
''
,
tipeAlert
:
''
,
messageAlert
:
''
,
messageAlert
:
''
,
fileType
:
''
fileType
:
''
,
konfirmasi
:
false
,
docId
:
''
}
}
}
}
...
@@ -192,11 +195,72 @@ export default class CreateManagementDoc extends Component {
...
@@ -192,11 +195,72 @@ export default class CreateManagementDoc extends Component {
createDocument
(){
createDocument
(){
api
.
create
().
uploadDocument
(
this
.
state
.
formData
).
then
(
response
=>
{
api
.
create
().
uploadDocument
(
this
.
state
.
formData
).
then
(
response
=>
{
console
.
log
(
response
)
console
.
log
(
response
)
if
(
response
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
if
(
response
.
ok
)
{
this
.
props
.
getDataDocument
(
this
.
props
.
setting_id
)
if
(
response
.
data
.
message
===
"The Document Already Exists in The System, Do You Want to Overwrite It?"
)
{
this
.
props
.
onClickClose
()
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 {
...
@@ -211,6 +275,7 @@ export default class CreateManagementDoc extends Component {
render
()
{
render
()
{
return
(
return
(
<
div
>
<
div
className
=
"test app-popup-show"
>
<
div
className
=
"test app-popup-show"
>
<
Snackbar
open
=
{
this
.
state
.
alert
}
autoHideDuration
=
{
6000
}
onClose
=
{()
=>
this
.
closeAlert
()}
>
<
Snackbar
open
=
{
this
.
state
.
alert
}
autoHideDuration
=
{
6000
}
onClose
=
{()
=>
this
.
closeAlert
()}
>
<
Alert
onClose
=
{()
=>
this
.
closeAlert
()}
severity
=
{
this
.
state
.
tipeAlert
}
>
<
Alert
onClose
=
{()
=>
this
.
closeAlert
()}
severity
=
{
this
.
state
.
tipeAlert
}
>
...
@@ -364,6 +429,16 @@ export default class CreateManagementDoc extends Component {
...
@@ -364,6 +429,16 @@ export default class CreateManagementDoc extends Component {
<
/div
>
<
/div
>
<
/div
>
<
/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 @
259d8c8a
...
@@ -7,6 +7,8 @@ import api from '../../api'
...
@@ -7,6 +7,8 @@ import api from '../../api'
import
AuditTahunan
from
'./AuditTahunan'
import
AuditTahunan
from
'./AuditTahunan'
import
CreateManagementDoc
from
'./CreateManagementDoc'
import
CreateManagementDoc
from
'./CreateManagementDoc'
import
QReview
from
'./QReview'
import
QReview
from
'./QReview'
import
BOD
from
'./BOD'
import
ManualBookETMS
from
'./ManualBookETMS'
export
default
class
DocumentManagement
extends
Component
{
export
default
class
DocumentManagement
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -20,7 +22,7 @@ export default class DocumentManagement extends Component {
...
@@ -20,7 +22,7 @@ export default class DocumentManagement extends Component {
selectTab
=
(
event
,
newEvent
)
=>
{
selectTab
=
(
event
,
newEvent
)
=>
{
this
.
setState
({
tab
:
newEvent
})
this
.
setState
({
tab
:
newEvent
})
//
console.log(this.state.tab)
console
.
log
(
this
.
state
.
tab
)
}
}
componentDidMount
()
{
componentDidMount
()
{
...
@@ -44,7 +46,7 @@ export default class DocumentManagement extends Component {
...
@@ -44,7 +46,7 @@ export default class DocumentManagement extends Component {
loadTable
:
true
,
loadTable
:
true
,
refresh
:
id
===
undefined
?
''
:
'create'
refresh
:
id
===
undefined
?
''
:
'create'
})
})
//
console.log(this.state.listData)
console
.
log
(
this
.
state
.
listData
)
}
else
{
}
else
{
}
}
...
@@ -102,16 +104,32 @@ export default class DocumentManagement extends Component {
...
@@ -102,16 +104,32 @@ export default class DocumentManagement extends Component {
data
=
{
this
.
state
.
listData
[
this
.
state
.
tab
]}
data
=
{
this
.
state
.
listData
[
this
.
state
.
tab
]}
refresh
=
{
this
.
state
.
refresh
}
refresh
=
{
this
.
state
.
refresh
}
/
>
/
>
:
:
this
.
state
.
id
===
68541
?
this
.
state
.
id
===
68541
?
<
ManualBookTia
/>
<
ManualBookTia
:
data
=
{
this
.
state
.
listData
[
this
.
state
.
tab
]}
this
.
state
.
id
===
68544
?
refresh
=
{
this
.
state
.
refresh
}
<
QReview
/
>
data
=
{
this
.
state
.
listData
[
this
.
state
.
tab
]}
:
/
>
this
.
state
.
id
===
68544
?
:
<
QReview
<
span
>
Test2
<
/span
>
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
>
<
/div
>
...
...
src/container/DocumentManagement/ManualBookETMS.js
0 → 100644
View file @
259d8c8a
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 @
259d8c8a
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
import
MUIDataTable
from
'mui-datatables'
import
MUIDataTable
from
'mui-datatables'
import
{
createMuiTheme
,
MuiThemeProvider
}
from
'@material-ui/core'
;
import
{
createMuiTheme
,
MuiThemeProvider
}
from
'@material-ui/core'
;
import
api
from
'../../api'
;
var
ct
=
require
(
"../../library/CustomTable"
);
var
ct
=
require
(
"../../library/CustomTable"
);
...
@@ -11,10 +12,48 @@ export default class ManualBookTia extends Component {
...
@@ -11,10 +12,48 @@ export default class ManualBookTia extends Component {
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
this
.
state
=
{
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
()
{
render
()
{
let
columns
=
[
let
columns
=
[
"Nama File"
,
"Keterangan"
,
"Perusahaan"
,
"Tipe"
,
"Ukuran"
,
"Ditambahkan Oleh"
,
"Ditambahkan Tanggal"
"Nama File"
,
"Keterangan"
,
"Perusahaan"
,
"Tipe"
,
"Ukuran"
,
"Ditambahkan Oleh"
,
"Ditambahkan Tanggal"
...
...
src/container/DocumentManagement/PopUpKonfirmasi.js
0 → 100644
View file @
259d8c8a
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 @
259d8c8a
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
import
MUIDataTable
from
'mui-datatables'
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
api
from
'../../api'
;
import
MuiAlert
from
'@material-ui/lab/Alert'
;
import
Constant
from
'../../library/Constant'
;
import
CreateManagementDoc
from
'./CreateManagementDoc'
;
import
CreateManagementDoc
from
'./CreateManagementDoc'
;
...
@@ -9,7 +12,10 @@ var ct = require("../../library/CustomTable");
...
@@ -9,7 +12,10 @@ var ct = require("../../library/CustomTable");
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
const
options
=
ct
.
customOptionsManagementDocument
();
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
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
this
.
state
=
{
this
.
state
=
{
...
@@ -37,24 +43,42 @@ export default class AuditTahunan extends Component {
...
@@ -37,24 +43,42 @@ export default class AuditTahunan extends Component {
"setting_id"
:
this
.
props
.
data
.
setting_id
"setting_id"
:
this
.
props
.
data
.
setting_id
}
}
api
.
create
().
getAllDocument
(
payload
).
then
(
response
=>
{
api
.
create
().
getAllDocument
(
payload
).
then
(
(
response
)
=>
{
console
.
log
(
response
)
console
.
log
(
response
)
if
(
response
.
problem
){
if
(
response
.
problem
){
alert
(
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
{
}
else
{
let
dataTable
=
response
.
data
.
data
.
map
(
item
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
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
})
}
}
})
})
}
}
...
@@ -66,6 +90,11 @@ export default class AuditTahunan extends Component {
...
@@ -66,6 +90,11 @@ export default class AuditTahunan extends Component {
return
(
return
(
<
div
style
=
{{
width
:
'100%'
}}
>
<
div
style
=
{{
width
:
'100%'
}}
>
<
div
style
=
{{
padding
:
25
}}
>
<
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
()}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
<
MUIDataTable
theme
=
{
getMuiTheme
()}
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