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
e148ce96
Commit
e148ce96
authored
Sep 16, 2020
by
Rifka Kurnia Irfiana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update edit managdoc
parent
064c7fd4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
188 additions
and
19 deletions
+188
-19
AuditTahunan.js
src/container/DocumentManagement/AuditTahunan.js
+43
-2
BOD.js
src/container/DocumentManagement/BOD.js
+43
-1
DocumentManagement.js
src/container/DocumentManagement/DocumentManagement.js
+15
-9
EditManagementDoc.js
src/container/DocumentManagement/EditManagementDoc.js
+16
-5
ManualBookTia.js
src/container/DocumentManagement/ManualBookTia.js
+28
-1
QReview.js
src/container/DocumentManagement/QReview.js
+43
-1
No files found.
src/container/DocumentManagement/AuditTahunan.js
View file @
e148ce96
...
@@ -9,6 +9,7 @@ import ReactTooltip from 'react-tooltip';
...
@@ -9,6 +9,7 @@ import ReactTooltip from 'react-tooltip';
import
PopUpDelete
from
"./PopUpDelete"
;
import
PopUpDelete
from
"./PopUpDelete"
;
import
api
from
'../../api'
;
import
api
from
'../../api'
;
import
CreateManagementDoc
from
'./CreateManagementDoc'
;
import
CreateManagementDoc
from
'./CreateManagementDoc'
;
import
EditManagementDoc
from
'./EditManagementDoc'
;
var
ct
=
require
(
"../../library/CustomTable"
);
var
ct
=
require
(
"../../library/CustomTable"
);
...
@@ -24,6 +25,7 @@ export default class AuditTahunan extends Component {
...
@@ -24,6 +25,7 @@ export default class AuditTahunan extends Component {
this
.
state
=
{
this
.
state
=
{
dataTable
:
[],
dataTable
:
[],
visibleCreate
:
false
,
visibleCreate
:
false
,
visibleEdit
:
false
,
refresh
:
''
,
refresh
:
''
,
alert
:
false
,
alert
:
false
,
popupDel
:
false
,
popupDel
:
false
,
...
@@ -122,7 +124,11 @@ export default class AuditTahunan extends Component {
...
@@ -122,7 +124,11 @@ export default class AuditTahunan extends Component {
})
})
}
}
if
(
type
===
'edit'
)
{
if
(
type
===
'edit'
)
{
alert
(
"edit"
)
this
.
setState
({
id
:
this
.
state
.
docId
[
val
],
rowData
:
index
,
visibleEdit
:
true
})
}
}
}
}
...
@@ -153,7 +159,33 @@ export default class AuditTahunan extends Component {
...
@@ -153,7 +159,33 @@ export default class AuditTahunan extends Component {
}
}
})
})
}
}
updateDocument
(
payload
)
{
api
.
create
().
updateDocument
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
getData
()
this
.
setState
({
konfirmasi
:
false
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
,
visibleEdit
:
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'
})
}
})
}
closeAlert
()
{
closeAlert
()
{
this
.
setState
({
alert
:
false
})
this
.
setState
({
alert
:
false
})
...
@@ -252,6 +284,15 @@ export default class AuditTahunan extends Component {
...
@@ -252,6 +284,15 @@ export default class AuditTahunan extends Component {
deleteDoc
=
{
this
.
deleteDoc
.
bind
(
this
)}
deleteDoc
=
{
this
.
deleteDoc
.
bind
(
this
)}
/
>
/
>
)}
)}
{
this
.
state
.
visibleEdit
&&
(
<
EditManagementDoc
type
=
{
"edit"
}
onClickClose
=
{()
=>
this
.
setState
({
visibleEdit
:
false
})}
data
=
{
this
.
state
.
rowData
}
idoc
=
{
this
.
state
.
id
}
updateDocument
=
{
this
.
updateDocument
.
bind
(
this
)}
/
>
)}
<
/div
>
<
/div
>
)
)
}
}
...
...
src/container/DocumentManagement/BOD.js
View file @
e148ce96
...
@@ -9,6 +9,7 @@ import Images from '../../assets/Images';
...
@@ -9,6 +9,7 @@ import Images from '../../assets/Images';
import
ReactTooltip
from
'react-tooltip'
;
import
ReactTooltip
from
'react-tooltip'
;
import
PopUpDelete
from
"./PopUpDelete"
;
import
PopUpDelete
from
"./PopUpDelete"
;
import
CreateManagementDoc
from
'./CreateManagementDoc'
;
import
CreateManagementDoc
from
'./CreateManagementDoc'
;
import
EditManagementDoc
from
'./EditManagementDoc'
;
var
ct
=
require
(
"../../library/CustomTable"
);
var
ct
=
require
(
"../../library/CustomTable"
);
...
@@ -24,6 +25,7 @@ export default class BOD extends Component {
...
@@ -24,6 +25,7 @@ export default class BOD extends Component {
this
.
state
=
{
this
.
state
=
{
dataTable
:
[],
dataTable
:
[],
visibleCreate
:
false
,
visibleCreate
:
false
,
visibleEdit
:
false
,
refresh
:
''
,
refresh
:
''
,
alert
:
false
,
alert
:
false
,
popupDel
:
false
,
popupDel
:
false
,
...
@@ -125,10 +127,41 @@ export default class BOD extends Component {
...
@@ -125,10 +127,41 @@ export default class BOD extends Component {
})
})
}
}
if
(
type
===
'edit'
)
{
if
(
type
===
'edit'
)
{
alert
(
"edit"
)
this
.
setState
({
id
:
this
.
state
.
docId
[
val
],
rowData
:
index
,
visibleEdit
:
true
})
}
}
}
}
updateDocument
(
payload
)
{
api
.
create
().
updateDocument
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
getData
()
this
.
setState
({
konfirmasi
:
false
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
,
visibleEdit
:
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'
})
}
})
}
closeAlert
()
{
closeAlert
()
{
this
.
setState
({
alert
:
false
})
this
.
setState
({
alert
:
false
})
}
}
...
@@ -255,6 +288,15 @@ export default class BOD extends Component {
...
@@ -255,6 +288,15 @@ export default class BOD extends Component {
deleteDoc
=
{
this
.
deleteDoc
.
bind
(
this
)}
deleteDoc
=
{
this
.
deleteDoc
.
bind
(
this
)}
/
>
/
>
)}
)}
{
this
.
state
.
visibleEdit
&&
(
<
EditManagementDoc
type
=
{
"edit"
}
onClickClose
=
{()
=>
this
.
setState
({
visibleEdit
:
false
})}
data
=
{
this
.
state
.
rowData
}
idoc
=
{
this
.
state
.
id
}
updateDocument
=
{
this
.
updateDocument
.
bind
(
this
)}
/
>
)}
<
/div
>
<
/div
>
)
)
}
}
...
...
src/container/DocumentManagement/DocumentManagement.js
View file @
e148ce96
...
@@ -186,14 +186,21 @@ export default class DocumentManagement extends Component {
...
@@ -186,14 +186,21 @@ export default class DocumentManagement extends Component {
<
/div
>
<
/div
>
<
div
style
=
{{
padding
:
20
}}
>
<
div
style
=
{{
padding
:
20
}}
>
<
Paper
style
=
{{
padding
:
20
}}
>
<
Paper
style
=
{{
padding
:
20
}}
>
<
div
style
=
{{
display
:
'grid'
,
justifyContent
:
'flex-end'
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
}}
>
<
button
{
this
.
state
.
btncreate
&&
<
span
>
type
=
"button"
<
a
data
-
tip
=
{
'Add'
}
data
-
for
=
"add"
>
onClick
=
{()
=>
this
.
setState
({
visibleCreate
:
true
,
refresh
:
''
})}
<
div
style
=
{{
display
:
'grid'
,
justifyContent
:
'flex-end'
}}
>
style
=
{{
marginRight
:
25
,
background
:
'transparent'
}}
<
button
>
type
=
"button"
<
img
src
=
{
Images
.
add
}
/
>
onClick
=
{()
=>
this
.
setState
({
visibleCreate
:
true
,
refresh
:
''
})}
<
/button
>
style
=
{{
marginRight
:
25
,
background
:
'transparent'
}}
>
<
img
src
=
{
Images
.
add
}
/
>
<
/button
>
<
/div
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"add"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/span>
}
<
/div
>
<
/div
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
Tabs
<
Tabs
...
@@ -275,7 +282,6 @@ export default class DocumentManagement extends Component {
...
@@ -275,7 +282,6 @@ export default class DocumentManagement extends Component {
// getDataDocument={this.getDataDocument.bind(this)}
// getDataDocument={this.getDataDocument.bind(this)}
createDocument
=
{
this
.
createDocument
.
bind
(
this
)}
createDocument
=
{
this
.
createDocument
.
bind
(
this
)}
setting_id
=
{
this
.
state
.
id
}
setting_id
=
{
this
.
state
.
id
}
btncreate
=
{
this
.
state
.
btncreate
}
/
>
/
>
)}
)}
<
/div
>
<
/div
>
...
...
src/container/DocumentManagement/EditManagementDoc.js
View file @
e148ce96
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
import
Images
from
'../../assets/Images'
import
Images
from
'../../assets/Images'
import
{
TextField
,
withStyles
,
Snackbar
}
from
'@material-ui/core'
import
{
TextField
,
withStyles
,
Snackbar
,
Typography
}
from
'@material-ui/core'
import
MuiAlert
from
'@material-ui/lab/Alert'
;
import
MuiAlert
from
'@material-ui/lab/Alert'
;
import
api
from
'../../api'
import
api
from
'../../api'
import
Autocomplete
from
'@material-ui/lab/Autocomplete'
import
Autocomplete
from
'@material-ui/lab/Autocomplete'
...
@@ -61,11 +61,11 @@ export default class EditManagementDoc extends Component {
...
@@ -61,11 +61,11 @@ export default class EditManagementDoc extends Component {
categoryId
:
data
.
setting_id
,
categoryId
:
data
.
setting_id
,
categoryName
:
data
.
values
,
categoryName
:
data
.
values
,
period
:
data
.
document_periode
,
period
:
data
.
document_periode
,
description
:
data
.
description
description
:
data
.
description
,
// id: data.approval_matrix_id,
// id: data.approval_matrix_id,
// status: data.status,
// status: data.status,
//
created: data.created,
created
:
data
.
created
,
//
updated: data.updated === null ? "" : data.updated
updated
:
data
.
updated
===
null
?
""
:
data
.
updated
},
()
=>
{
},
()
=>
{
this
.
getDataCompany
()
this
.
getDataCompany
()
this
.
getDataDocument
()
this
.
getDataDocument
()
...
@@ -225,8 +225,9 @@ export default class EditManagementDoc extends Component {
...
@@ -225,8 +225,9 @@ export default class EditManagementDoc extends Component {
formData
.
append
(
"documentPeriode"
,
this
.
state
.
periode
.
periode
);
formData
.
append
(
"documentPeriode"
,
this
.
state
.
periode
.
periode
);
formData
.
append
(
"description"
,
this
.
state
.
description
);
formData
.
append
(
"description"
,
this
.
state
.
description
);
formData
.
append
(
"extension"
,
this
.
state
.
fileType
);
formData
.
append
(
"extension"
,
this
.
state
.
fileType
);
formData
.
append
(
"documentId"
,
this
.
props
.
idoc
);
this
.
setState
({
formData
},
()
=>
{
this
.
setState
({
formData
},
()
=>
{
this
.
props
.
createDocument
(
this
.
state
.
formData
,
this
.
props
.
setting_id
)
this
.
props
.
updateDocument
(
this
.
state
.
formData
)
})
})
}
}
}
}
...
@@ -368,6 +369,16 @@ export default class EditManagementDoc extends Component {
...
@@ -368,6 +369,16 @@ export default class EditManagementDoc extends Component {
>
>
<
/TextField
>
<
/TextField
>
<
/div
>
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
paddingLeft
:
30
,
paddingRight
:
30
,
borderRadius
:
5
,
paddingBottom
:
20
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
Typography
style
=
{{
fontSize
:
11
,
width
:
'12%'
}}
>
Created
By
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
11
}}
>
:
{
this
.
state
.
created
}
<
/Typography
>
<
/div
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
Typography
style
=
{{
fontSize
:
11
,
width
:
'12%'
}}
>
Updated
By
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
11
}}
>
:
{
this
.
state
.
updated
==
-
null
?
""
:
this
.
state
.
updated
}
<
/Typography
>
<
/div
>
<
/div
>
<
div
className
=
"border-top grid grid-2x"
style
=
{{
height
:
56
,
backgroundColor
:
'#f5f5f5'
,
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
div
className
=
"border-top grid grid-2x"
style
=
{{
height
:
56
,
backgroundColor
:
'#f5f5f5'
,
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
div
className
=
"column-1"
style
=
{{
alignSelf
:
'center'
}}
>
<
div
className
=
"column-1"
style
=
{{
alignSelf
:
'center'
}}
>
<
button
<
button
...
...
src/container/DocumentManagement/ManualBookTia.js
View file @
e148ce96
...
@@ -161,6 +161,33 @@ export default class ManualBookTia extends Component {
...
@@ -161,6 +161,33 @@ export default class ManualBookTia extends Component {
})
})
}
}
updateDocument
(
payload
)
{
api
.
create
().
updateDocument
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
getData
()
this
.
setState
({
konfirmasi
:
false
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
,
visibleEdit
:
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'
})
}
})
}
render
()
{
render
()
{
let
columns
=
[{
let
columns
=
[{
name
:
"Action"
,
name
:
"Action"
,
...
@@ -260,7 +287,7 @@ export default class ManualBookTia extends Component {
...
@@ -260,7 +287,7 @@ export default class ManualBookTia extends Component {
onClickClose
=
{()
=>
this
.
setState
({
visibleEdit
:
false
})}
onClickClose
=
{()
=>
this
.
setState
({
visibleEdit
:
false
})}
data
=
{
this
.
state
.
rowData
}
data
=
{
this
.
state
.
rowData
}
idoc
=
{
this
.
state
.
id
}
idoc
=
{
this
.
state
.
id
}
// updateAM={this.updateAM
.bind(this)}
updateDocument
=
{
this
.
updateDocument
.
bind
(
this
)}
/
>
/
>
)}
)}
<
/div
>
<
/div
>
...
...
src/container/DocumentManagement/QReview.js
View file @
e148ce96
...
@@ -9,6 +9,7 @@ import ReactTooltip from 'react-tooltip';
...
@@ -9,6 +9,7 @@ import ReactTooltip from 'react-tooltip';
import
api
from
'../../api'
;
import
api
from
'../../api'
;
import
PopUpDelete
from
"./PopUpDelete"
;
import
PopUpDelete
from
"./PopUpDelete"
;
import
CreateManagementDoc
from
'./CreateManagementDoc'
;
import
CreateManagementDoc
from
'./CreateManagementDoc'
;
import
EditManagementDoc
from
'./EditManagementDoc'
;
var
ct
=
require
(
"../../library/CustomTable"
);
var
ct
=
require
(
"../../library/CustomTable"
);
...
@@ -24,6 +25,7 @@ export default class QReview extends Component {
...
@@ -24,6 +25,7 @@ export default class QReview extends Component {
this
.
state
=
{
this
.
state
=
{
dataTable
:
[],
dataTable
:
[],
visibleCreate
:
false
,
visibleCreate
:
false
,
visibleEdit
:
false
,
refresh
:
''
,
refresh
:
''
,
alert
:
false
,
alert
:
false
,
popupDel
:
false
,
popupDel
:
false
,
...
@@ -121,7 +123,11 @@ export default class QReview extends Component {
...
@@ -121,7 +123,11 @@ export default class QReview extends Component {
})
})
}
}
if
(
type
===
'edit'
)
{
if
(
type
===
'edit'
)
{
alert
(
"edit"
)
this
.
setState
({
id
:
this
.
state
.
docId
[
val
],
rowData
:
index
,
visibleEdit
:
true
})
}
}
}
}
...
@@ -157,6 +163,33 @@ export default class QReview extends Component {
...
@@ -157,6 +163,33 @@ export default class QReview extends Component {
})
})
}
}
updateDocument
(
payload
)
{
api
.
create
().
updateDocument
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
getData
()
this
.
setState
({
konfirmasi
:
false
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
,
visibleEdit
:
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'
})
}
})
}
render
()
{
render
()
{
let
columns
=
[{
let
columns
=
[{
name
:
"Action"
,
name
:
"Action"
,
...
@@ -247,6 +280,15 @@ export default class QReview extends Component {
...
@@ -247,6 +280,15 @@ export default class QReview extends Component {
deleteDoc
=
{
this
.
deleteDoc
.
bind
(
this
)}
deleteDoc
=
{
this
.
deleteDoc
.
bind
(
this
)}
/
>
/
>
)}
)}
{
this
.
state
.
visibleEdit
&&
(
<
EditManagementDoc
type
=
{
"edit"
}
onClickClose
=
{()
=>
this
.
setState
({
visibleEdit
:
false
})}
data
=
{
this
.
state
.
rowData
}
idoc
=
{
this
.
state
.
id
}
updateDocument
=
{
this
.
updateDocument
.
bind
(
this
)}
/
>
)}
<
/div
>
<
/div
>
)
)
}
}
...
...
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