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
45cb862c
Commit
45cb862c
authored
Sep 11, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
yuhuuuu
parent
259d8c8a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
127 additions
and
131 deletions
+127
-131
AuditTahunan.js
src/container/DocumentManagement/AuditTahunan.js
+1
-1
CreateManagementDoc.js
src/container/DocumentManagement/CreateManagementDoc.js
+1
-97
DocumentManagement.js
src/container/DocumentManagement/DocumentManagement.js
+124
-28
PopUpKonfirmasi.js
src/container/DocumentManagement/PopUpKonfirmasi.js
+1
-5
No files found.
src/container/DocumentManagement/AuditTahunan.js
View file @
45cb862c
...
@@ -46,7 +46,7 @@ export default class AuditTahunan extends Component {
...
@@ -46,7 +46,7 @@ export default class AuditTahunan extends Component {
item
.
company_name
,
item
.
company_name
,
item
.
document_periode
,
item
.
document_periode
,
item
.
document_type
,
item
.
document_type
,
String
(
Number
(
item
.
document_size
)
/
1000
+
'
M
B'
),
String
(
Number
(
item
.
document_size
)
/
1000
+
'
K
B'
),
item
.
created_by
,
item
.
created_by
,
item
.
created_at
,
item
.
created_at
,
]
]
...
...
src/container/DocumentManagement/CreateManagementDoc.js
View file @
45cb862c
...
@@ -8,11 +8,6 @@ import { format } from 'date-fns';
...
@@ -8,11 +8,6 @@ import { format } from 'date-fns';
import
UploadFile
from
"../../library/Upload"
;
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
PopUpKonfirmasi
from
"./PopUpKonfirmasi"
;
const
Alert
=
withStyles
({
})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
export
default
class
CreateManagementDoc
extends
Component
{
export
default
class
CreateManagementDoc
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -187,86 +182,9 @@ export default class CreateManagementDoc extends Component {
...
@@ -187,86 +182,9 @@ export default class CreateManagementDoc extends Component {
formData
.
append
(
"description"
,
this
.
state
.
description
);
formData
.
append
(
"description"
,
this
.
state
.
description
);
formData
.
append
(
"extension"
,
this
.
state
.
fileType
);
formData
.
append
(
"extension"
,
this
.
state
.
fileType
);
this
.
setState
({
formData
},
()
=>
{
this
.
setState
({
formData
},
()
=>
{
this
.
createDocument
()
this
.
props
.
createDocument
(
this
.
state
.
formData
,
this
.
props
.
setting_id
)
})
}
}
createDocument
(){
api
.
create
().
uploadDocument
(
this
.
state
.
formData
).
then
(
response
=>
{
console
.
log
(
response
)
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'
})
}
})
}
closeAlert
()
{
this
.
setState
({
alert
:
false
})
}
}
deleteFile
(
e
){
deleteFile
(
e
){
...
@@ -277,11 +195,6 @@ export default class CreateManagementDoc extends Component {
...
@@ -277,11 +195,6 @@ export default class CreateManagementDoc extends Component {
return
(
return
(
<
div
>
<
div
>
<
div
className
=
"test app-popup-show"
>
<
div
className
=
"test app-popup-show"
>
<
Snackbar
open
=
{
this
.
state
.
alert
}
autoHideDuration
=
{
6000
}
onClose
=
{()
=>
this
.
closeAlert
()}
>
<
Alert
onClose
=
{()
=>
this
.
closeAlert
()}
severity
=
{
this
.
state
.
tipeAlert
}
>
{
this
.
state
.
messageAlert
}
<
/Alert
>
<
/Snackbar
>
<
div
className
=
"popup-content background-white border-radius"
style
=
{{
borderRadius
:
8
}}
>
<
div
className
=
"popup-content background-white border-radius"
style
=
{{
borderRadius
:
8
}}
>
<
div
className
=
"popup-panel grid grid-2x main-color"
style
=
{{
height
:
64
,
borderTopRightRadius
:
8
,
borderTopLeftRadius
:
8
}}
>
<
div
className
=
"popup-panel grid grid-2x main-color"
style
=
{{
height
:
64
,
borderTopRightRadius
:
8
,
borderTopLeftRadius
:
8
}}
>
<
div
className
=
"col-1"
style
=
{{
maxWidth
:
"inherit"
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
div
className
=
"col-1"
style
=
{{
maxWidth
:
"inherit"
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
...
@@ -429,15 +342,6 @@ export default class CreateManagementDoc extends Component {
...
@@ -429,15 +342,6 @@ 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
>
<
/div
>
)
)
}
}
...
...
src/container/DocumentManagement/DocumentManagement.js
View file @
45cb862c
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
import
{
Tabs
,
Tab
,
Typography
,
Paper
}
from
'@material-ui/core'
import
{
Tabs
,
Tab
,
Typography
,
Paper
,
withStyles
,
Snackbar
}
from
'@material-ui/core'
import
ReactTooltip
from
'react-tooltip'
import
ReactTooltip
from
'react-tooltip'
import
Images
from
'../../assets/Images'
import
Images
from
'../../assets/Images'
import
ManualBookTia
from
'./ManualBookTia'
import
ManualBookTia
from
'./ManualBookTia'
...
@@ -9,6 +9,12 @@ import CreateManagementDoc from './CreateManagementDoc'
...
@@ -9,6 +9,12 @@ import CreateManagementDoc from './CreateManagementDoc'
import
QReview
from
'./QReview'
import
QReview
from
'./QReview'
import
BOD
from
'./BOD'
import
BOD
from
'./BOD'
import
ManualBookETMS
from
'./ManualBookETMS'
import
ManualBookETMS
from
'./ManualBookETMS'
import
PopUpKonfirmasi
from
"./PopUpKonfirmasi"
;
import
Constant
from
'../../library/Constant'
import
MuiAlert
from
'@material-ui/lab/Alert'
;
const
Alert
=
withStyles
({
})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
export
default
class
DocumentManagement
extends
Component
{
export
default
class
DocumentManagement
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -56,14 +62,95 @@ export default class DocumentManagement extends Component {
...
@@ -56,14 +62,95 @@ export default class DocumentManagement extends Component {
})
})
}
}
createDocument
(
payload
,
settingID
)
{
api
.
create
().
uploadDocument
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
message
===
"The Document Already Exists in The System, Do You Want to Overwrite It?"
)
{
this
.
setState
({
formData
:
payload
,
docId
:
response
.
data
.
data
.
document_id
},
()
=>
{
this
.
setState
({
konfirmasi
:
true
})
})
}
else
if
(
response
.
data
.
message
===
"Upload Document Success"
)
{
this
.
getDataDocument
(
settingID
)
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
,
settingID
,
visibleCreate
:
false
})
}
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
()
{
const
formData
=
this
.
state
.
formData
formData
.
append
(
"documentId"
,
this
.
state
.
docId
)
// 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]);
// console.log(payload);
api
.
create
().
updateDocument
(
formData
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
getDataDocument
(
this
.
state
.
settingID
)
this
.
setState
({
konfirmasi
:
false
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
,
visibleCreate
:
false
})
}
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'
})
}
})
}
getID
(
id
)
{
getID
(
id
)
{
console
.
log
(
id
);
console
.
log
(
id
);
this
.
setState
({
id
})
this
.
setState
({
id
})
}
}
closeAlert
()
{
this
.
setState
({
alert
:
false
})
}
render
()
{
render
()
{
return
(
return
(
<
div
style
=
{{
height
:
this
.
props
.
height
,
backgroundColor
:
'#f8f8f8'
}}
>
<
div
style
=
{{
height
:
this
.
props
.
height
,
backgroundColor
:
'#f8f8f8'
}}
>
<
Snackbar
open
=
{
this
.
state
.
alert
}
autoHideDuration
=
{
6000
}
onClose
=
{()
=>
this
.
closeAlert
()}
>
<
Alert
onClose
=
{()
=>
this
.
closeAlert
()}
severity
=
{
this
.
state
.
tipeAlert
}
>
{
this
.
state
.
messageAlert
}
<
/Alert
>
<
/Snackbar
>
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
78
,
display
:
'flex'
,
alignItems
:
'center'
,
paddingLeft
:
20
}}
>
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
78
,
display
:
'flex'
,
alignItems
:
'center'
,
paddingLeft
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Management
Document
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Management
Document
<
/Typography
>
<
/div
>
<
/div
>
...
@@ -136,10 +223,19 @@ export default class DocumentManagement extends Component {
...
@@ -136,10 +223,19 @@ export default class DocumentManagement extends Component {
<
/Paper
>
<
/Paper
>
<
/div
>
<
/div
>
{
this
.
state
.
konfirmasi
&&
(
<
PopUpKonfirmasi
onClickClosePopUp
=
{()
=>
this
.
setState
({
konfirmasi
:
false
})}
// getList={() => this.getData.bind(this)}
// deleteAM={this.deleteAM.bind(this)}
uploadDocId
=
{
this
.
createUploadDocument
.
bind
(
this
)}
/
>
)}
{
this
.
state
.
visibleCreate
&&
(
{
this
.
state
.
visibleCreate
&&
(
<
CreateManagementDoc
<
CreateManagementDoc
onClickClose
=
{()
=>
this
.
setState
({
visibleCreate
:
false
})}
onClickClose
=
{()
=>
this
.
setState
({
visibleCreate
:
false
})}
getDataDocument
=
{
this
.
getDataDocument
.
bind
(
this
)}
// getDataDocument={this.getDataDocument.bind(this)}
createDocument
=
{
this
.
createDocument
.
bind
(
this
)}
setting_id
=
{
this
.
state
.
id
}
setting_id
=
{
this
.
state
.
id
}
/
>
/
>
)}
)}
...
...
src/container/DocumentManagement/PopUpKonfirmasi.js
View file @
45cb862c
...
@@ -15,10 +15,6 @@ export default class PopUpDeleteAM extends Component {
...
@@ -15,10 +15,6 @@ export default class PopUpDeleteAM extends Component {
}
}
componentDidMount
()
{
componentDidMount
()
{
// if (this.props.type === 'delete') {
// this.getDetailAM()
// }
console
.
log
(
this
.
props
.
data
)
}
}
// getDetailAM() {
// getDetailAM() {
...
@@ -59,7 +55,7 @@ export default class PopUpDeleteAM extends Component {
...
@@ -59,7 +55,7 @@ export default class PopUpDeleteAM extends Component {
render
()
{
render
()
{
return
(
return
(
<
div
className
=
"test app-popup-show"
>
<
div
className
=
"test app-popup-show"
style
=
{{
zIndex
:
2500
}}
>
<
div
className
=
"popup-content background-white border-radius"
style
=
{{
borderRadius
:
8
}}
>
<
div
className
=
"popup-content background-white border-radius"
style
=
{{
borderRadius
:
8
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'center'
,
paddingTop
:
20
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'center'
,
paddingTop
:
20
}}
>
<
img
src
=
{
Images
.
failed
}
/
>
<
img
src
=
{
Images
.
failed
}
/
>
...
...
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