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
0f02fd51
Commit
0f02fd51
authored
Sep 11, 2020
by
Rifka Kurnia Irfiana
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://103.44.149.204/d.arizona/tia-dev
into rifka
parents
e7bd862a
bd7e13f7
Changes
4
Hide 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 @
0f02fd51
...
...
@@ -49,7 +49,7 @@ export default class AuditTahunan extends Component {
item
.
company_name
,
item
.
document_periode
,
item
.
document_type
,
String
(
Number
(
item
.
document_size
)
/
1000
+
'
M
B'
),
String
(
Number
(
item
.
document_size
)
/
1000
+
'
K
B'
),
item
.
created_by
,
item
.
created_at
,
]
...
...
src/container/DocumentManagement/CreateManagementDoc.js
View file @
0f02fd51
...
...
@@ -8,11 +8,6 @@ import { format } from 'date-fns';
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
}
/>
)
;
export
default
class
CreateManagementDoc
extends
Component
{
constructor
(
props
)
{
...
...
@@ -187,88 +182,11 @@ export default class CreateManagementDoc extends Component {
formData
.
append
(
"description"
,
this
.
state
.
description
);
formData
.
append
(
"extension"
,
this
.
state
.
fileType
);
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
){
this
.
setState
({
file
:
null
})
}
...
...
@@ -277,11 +195,6 @@ export default class CreateManagementDoc extends Component {
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
}
>
{
this
.
state
.
messageAlert
}
<
/Alert
>
<
/Snackbar
>
<
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
=
"col-1"
style
=
{{
maxWidth
:
"inherit"
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
...
...
@@ -429,15 +342,6 @@ 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 @
0f02fd51
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
Images
from
'../../assets/Images'
import
ManualBookTia
from
'./ManualBookTia'
...
...
@@ -9,6 +9,12 @@ import CreateManagementDoc from './CreateManagementDoc'
import
QReview
from
'./QReview'
import
BOD
from
'./BOD'
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
{
constructor
(
props
)
{
...
...
@@ -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
)
{
console
.
log
(
id
);
this
.
setState
({
id
})
}
closeAlert
()
{
this
.
setState
({
alert
:
false
})
}
render
()
{
return
(
<
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
}}
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Management
Document
<
/Typography
>
<
/div
>
...
...
@@ -104,42 +191,51 @@ export default class DocumentManagement extends Component {
data
=
{
this
.
state
.
listData
[
this
.
state
.
tab
]}
refresh
=
{
this
.
state
.
refresh
}
/
>
:
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
>
:
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
>
<
/Paper
>
<
/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
&&
(
<
CreateManagementDoc
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
}
/
>
)}
...
...
src/container/DocumentManagement/PopUpKonfirmasi.js
View file @
0f02fd51
...
...
@@ -15,10 +15,6 @@ export default class PopUpDeleteAM extends Component {
}
componentDidMount
()
{
// if (this.props.type === 'delete') {
// this.getDetailAM()
// }
console
.
log
(
this
.
props
.
data
)
}
onClickUpload
()
{
let
payload
=
this
.
props
.
data
...
...
@@ -27,7 +23,7 @@ export default class PopUpDeleteAM extends Component {
render
()
{
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
style
=
{{
display
:
'flex'
,
justifyContent
:
'center'
,
paddingTop
:
20
}}
>
<
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