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
b6c52c49
Commit
b6c52c49
authored
Sep 10, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'deni-dev(pc)' into 'master'
mandoc See merge request
!282
parents
4faf9bbd
23aff7bd
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
35 deletions
+75
-35
index.js
src/api/index.js
+1
-1
AuditTahunan.js
src/container/DocumentManagement/AuditTahunan.js
+15
-6
CreateManagementDoc.js
src/container/DocumentManagement/CreateManagementDoc.js
+16
-4
DocumentManagement.js
src/container/DocumentManagement/DocumentManagement.js
+43
-24
No files found.
src/api/index.js
View file @
b6c52c49
...
...
@@ -176,7 +176,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const
uploadFoto
=
(
body
)
=>
api
.
post
(
'attachment/upload_foto'
,
body
)
// MANAGEMENT DOCUMENT
const
getDocumentCategory
=
(
)
=>
api
.
get
(
'document_category/get_all_document_category'
)
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
)
...
...
src/container/DocumentManagement/AuditTahunan.js
View file @
b6c52c49
...
...
@@ -14,23 +14,32 @@ export default class AuditTahunan extends Component {
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"
:
1
"setting_id"
:
this
.
props
.
data
.
setting_id
}
api
.
create
().
getAllDocument
(
payload
).
then
(
respone
=>
{
let
dataTable
=
respone
.
data
.
data
.
map
(
item
=>
{
api
.
create
().
getAllDocument
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
let
dataTable
=
response
.
data
.
data
.
map
(
item
=>
{
return
[
item
.
document_name
,
item
.
description
,
...
...
src/container/DocumentManagement/CreateManagementDoc.js
View file @
b6c52c49
...
...
@@ -83,15 +83,21 @@ export default class CreateManagementDoc extends Component {
}
getDataDocument
()
{
api
.
create
().
getDocumentCategory
().
then
(
response
=>
{
let
payload
=
{
"setting_group_id"
:
7
,
"setting_type_id"
:
167
,
"company_id"
:
0
}
api
.
create
().
getDocumentCategory
(
payload
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
==
'success'
)
{
let
data
=
response
.
data
.
data
let
typeData
=
data
.
map
((
item
)
=>
{
return
{
document_category_id
:
item
.
document_category
_id
,
document_category_name
:
item
.
document_category_nam
e
document_category_id
:
item
.
setting
_id
,
document_category_name
:
item
.
valu
e
}
})
let
typeProps
=
{
...
...
@@ -173,7 +179,7 @@ export default class CreateManagementDoc extends Component {
const
formData
=
new
FormData
();
formData
.
append
(
"file"
,
this
.
state
.
file
);
formData
.
append
(
"companyId"
,
this
.
state
.
getPerusahaan
.
company_id
);
formData
.
append
(
"
documentCategory
Id"
,
this
.
state
.
getDocument
.
document_category_id
);
formData
.
append
(
"
setting
Id"
,
this
.
state
.
getDocument
.
document_category_id
);
formData
.
append
(
"documentPeriode"
,
this
.
state
.
periode
.
periode
);
formData
.
append
(
"description"
,
this
.
state
.
description
);
formData
.
append
(
"extension"
,
this
.
state
.
fileType
);
...
...
@@ -186,6 +192,12 @@ 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
()
}
}
})
}
...
...
src/container/DocumentManagement/DocumentManagement.js
View file @
b6c52c49
...
...
@@ -20,21 +20,37 @@ export default class DocumentManagement extends Component {
selectTab
=
(
event
,
newEvent
)
=>
{
this
.
setState
({
tab
:
newEvent
})
console
.
log
(
this
.
state
.
tab
)
//
console.log(this.state.tab)
}
componentDidMount
()
{
this
.
getDataDocument
()
}
getDataDocument
()
{
api
.
create
().
getDocumentCategory
().
then
(
response
=>
{
getDataDocument
(
id
)
{
let
payload
=
{
"setting_group_id"
:
7
,
"setting_type_id"
:
167
,
"company_id"
:
0
}
api
.
create
().
getDocumentCategory
(
payload
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
listData
:
response
.
data
.
data
,
id
:
response
.
data
.
data
[
0
].
document_category_id
,
loadTable
:
true
id
:
id
===
undefined
?
response
.
data
.
data
[
0
].
setting_id
:
id
,
loadTable
:
true
,
refresh
:
id
===
undefined
?
''
:
'create'
})
console
.
log
(
this
.
state
.
listData
)
// console.log(this.state.listData)
}
else
{
}
}
else
{
}
})
}
...
...
@@ -54,7 +70,7 @@ export default class DocumentManagement extends Component {
<
div
style
=
{{
display
:
'grid'
,
justifyContent
:
'flex-end'
}}
>
<
button
type
=
"button"
onClick
=
{()
=>
this
.
setState
({
visibleCreate
:
true
})}
onClick
=
{()
=>
this
.
setState
({
visibleCreate
:
true
,
refresh
:
''
})}
style
=
{{
marginRight
:
25
}}
>
<
div
style
=
{{
width
:
150
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
...
...
@@ -74,19 +90,20 @@ export default class DocumentManagement extends Component {
{
this
.
state
.
listData
.
map
((
item
,
index
)
=>
{
return
(
<
Tab
onClick
=
{()
=>
this
.
setState
({
id
:
item
.
document_category
_id
})}
label
=
{
item
.
document_category_nam
e
}
onClick
=
{()
=>
this
.
setState
({
id
:
item
.
setting
_id
})}
label
=
{
item
.
valu
e
}
/
>
)
})}
<
/Tabs
>
{
this
.
state
.
loadTable
&&
(
this
.
state
.
id
===
2
?
this
.
state
.
id
===
6854
2
?
<
AuditTahunan
data
=
{
this
.
state
.
listData
[
this
.
state
.
tab
]}
refresh
=
{
this
.
state
.
refresh
}
/
>
:
this
.
state
.
id
===
1
?
this
.
state
.
id
===
6854
1
?
<
ManualBookTia
/>
:
this
.
state
.
id
===
3
?
...
...
@@ -104,6 +121,8 @@ export default class DocumentManagement extends Component {
{
this
.
state
.
visibleCreate
&&
(
<
CreateManagementDoc
onClickClose
=
{()
=>
this
.
setState
({
visibleCreate
:
false
})}
getDataDocument
=
{
this
.
getDataDocument
.
bind
(
this
)}
setting_id
=
{
this
.
state
.
id
}
/
>
)}
<
/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