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
41fcce8c
Commit
41fcce8c
authored
Sep 10, 2020
by
faisalhamdi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://103.44.149.204/d.arizona/tia-dev
into faisal
parents
e7779ee7
b6c52c49
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 @
41fcce8c
...
@@ -176,7 +176,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
...
@@ -176,7 +176,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const
uploadFoto
=
(
body
)
=>
api
.
post
(
'attachment/upload_foto'
,
body
)
const
uploadFoto
=
(
body
)
=>
api
.
post
(
'attachment/upload_foto'
,
body
)
// MANAGEMENT DOCUMENT
// 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
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
)
...
...
src/container/DocumentManagement/AuditTahunan.js
View file @
41fcce8c
...
@@ -14,23 +14,32 @@ export default class AuditTahunan extends Component {
...
@@ -14,23 +14,32 @@ export default class AuditTahunan extends Component {
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"
:
1
}
}
api
.
create
().
getAllDocument
(
payload
).
then
(
respone
=>
{
api
.
create
().
getAllDocument
(
payload
).
then
(
response
=>
{
let
dataTable
=
respone
.
data
.
data
.
map
(
item
=>
{
console
.
log
(
response
)
let
dataTable
=
response
.
data
.
data
.
map
(
item
=>
{
return
[
return
[
item
.
document_name
,
item
.
document_name
,
item
.
description
,
item
.
description
,
...
...
src/container/DocumentManagement/CreateManagementDoc.js
View file @
41fcce8c
...
@@ -83,15 +83,21 @@ export default class CreateManagementDoc extends Component {
...
@@ -83,15 +83,21 @@ export default class CreateManagementDoc extends Component {
}
}
getDataDocument
()
{
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
);
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
==
'success'
)
{
if
(
response
.
data
.
status
==
'success'
)
{
let
data
=
response
.
data
.
data
let
data
=
response
.
data
.
data
let
typeData
=
data
.
map
((
item
)
=>
{
let
typeData
=
data
.
map
((
item
)
=>
{
return
{
return
{
document_category_id
:
item
.
document_category
_id
,
document_category_id
:
item
.
setting
_id
,
document_category_name
:
item
.
document_category_nam
e
document_category_name
:
item
.
valu
e
}
}
})
})
let
typeProps
=
{
let
typeProps
=
{
...
@@ -173,7 +179,7 @@ export default class CreateManagementDoc extends Component {
...
@@ -173,7 +179,7 @@ export default class CreateManagementDoc extends Component {
const
formData
=
new
FormData
();
const
formData
=
new
FormData
();
formData
.
append
(
"file"
,
this
.
state
.
file
);
formData
.
append
(
"file"
,
this
.
state
.
file
);
formData
.
append
(
"companyId"
,
this
.
state
.
getPerusahaan
.
company_id
);
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
(
"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
);
...
@@ -186,6 +192,12 @@ export default class CreateManagementDoc extends Component {
...
@@ -186,6 +192,12 @@ 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
.
status
===
"success"
)
{
this
.
props
.
getDataDocument
(
this
.
props
.
setting_id
)
this
.
props
.
onClickClose
()
}
}
})
})
}
}
...
...
src/container/DocumentManagement/DocumentManagement.js
View file @
41fcce8c
...
@@ -20,21 +20,37 @@ export default class DocumentManagement extends Component {
...
@@ -20,21 +20,37 @@ 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
()
{
this
.
getDataDocument
()
this
.
getDataDocument
()
}
}
getDataDocument
()
{
getDataDocument
(
id
)
{
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
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
this
.
setState
({
listData
:
response
.
data
.
data
,
listData
:
response
.
data
.
data
,
id
:
response
.
data
.
data
[
0
].
document_category_id
,
id
:
id
===
undefined
?
response
.
data
.
data
[
0
].
setting_id
:
id
,
loadTable
:
true
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 {
...
@@ -54,7 +70,7 @@ export default class DocumentManagement extends Component {
<
div
style
=
{{
display
:
'grid'
,
justifyContent
:
'flex-end'
}}
>
<
div
style
=
{{
display
:
'grid'
,
justifyContent
:
'flex-end'
}}
>
<
button
<
button
type
=
"button"
type
=
"button"
onClick
=
{()
=>
this
.
setState
({
visibleCreate
:
true
})}
onClick
=
{()
=>
this
.
setState
({
visibleCreate
:
true
,
refresh
:
''
})}
style
=
{{
marginRight
:
25
}}
style
=
{{
marginRight
:
25
}}
>
>
<
div
style
=
{{
width
:
150
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
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 {
...
@@ -74,19 +90,20 @@ export default class DocumentManagement extends Component {
{
this
.
state
.
listData
.
map
((
item
,
index
)
=>
{
{
this
.
state
.
listData
.
map
((
item
,
index
)
=>
{
return
(
return
(
<
Tab
<
Tab
onClick
=
{()
=>
this
.
setState
({
id
:
item
.
document_category
_id
})}
onClick
=
{()
=>
this
.
setState
({
id
:
item
.
setting
_id
})}
label
=
{
item
.
document_category_nam
e
}
label
=
{
item
.
valu
e
}
/
>
/
>
)
)
})}
})}
<
/Tabs
>
<
/Tabs
>
{
this
.
state
.
loadTable
&&
(
{
this
.
state
.
loadTable
&&
(
this
.
state
.
id
===
2
?
this
.
state
.
id
===
6854
2
?
<
AuditTahunan
<
AuditTahunan
data
=
{
this
.
state
.
listData
[
this
.
state
.
tab
]}
data
=
{
this
.
state
.
listData
[
this
.
state
.
tab
]}
refresh
=
{
this
.
state
.
refresh
}
/
>
/
>
:
:
this
.
state
.
id
===
1
?
this
.
state
.
id
===
6854
1
?
<
ManualBookTia
/>
<
ManualBookTia
/>
:
:
this
.
state
.
id
===
3
?
this
.
state
.
id
===
3
?
...
@@ -104,6 +121,8 @@ export default class DocumentManagement extends Component {
...
@@ -104,6 +121,8 @@ export default class DocumentManagement extends Component {
{
this
.
state
.
visibleCreate
&&
(
{
this
.
state
.
visibleCreate
&&
(
<
CreateManagementDoc
<
CreateManagementDoc
onClickClose
=
{()
=>
this
.
setState
({
visibleCreate
:
false
})}
onClickClose
=
{()
=>
this
.
setState
({
visibleCreate
:
false
})}
getDataDocument
=
{
this
.
getDataDocument
.
bind
(
this
)}
setting_id
=
{
this
.
state
.
id
}
/
>
/
>
)}
)}
<
/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