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
3f526095
Commit
3f526095
authored
Sep 23, 2020
by
Rifka Kurnia Irfiana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upload edit managdoc
parent
ec7b4016
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
6 deletions
+24
-6
CreateManagementDoc.js
src/container/DocumentManagement/CreateManagementDoc.js
+9
-3
EditManagementDoc.js
src/container/DocumentManagement/EditManagementDoc.js
+15
-3
No files found.
src/container/DocumentManagement/CreateManagementDoc.js
View file @
3f526095
...
@@ -63,9 +63,15 @@ export default class CreateManagementDoc extends Component {
...
@@ -63,9 +63,15 @@ export default class CreateManagementDoc extends Component {
console
.
log
(
response
);
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
if
(
response
.
data
.
data
.
length
==
0
){
sizeUpload
:
response
.
data
.
data
[
0
].
value
this
.
setState
({
})
sizeUpload
:
1
})
}
else
{
this
.
setState
({
sizeUpload
:
response
.
data
.
data
[
0
].
value
})
}
}
}
}
}
})
})
...
...
src/container/DocumentManagement/EditManagementDoc.js
View file @
3f526095
...
@@ -65,9 +65,15 @@ export default class EditManagementDoc extends Component {
...
@@ -65,9 +65,15 @@ export default class EditManagementDoc extends Component {
console
.
log
(
response
);
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
if
(
response
.
data
.
data
.
length
==
0
){
sizeUpload
:
response
.
data
.
data
[
0
].
value
this
.
setState
({
})
sizeUpload
:
1
})
}
else
{
this
.
setState
({
sizeUpload
:
response
.
data
.
data
[
0
].
value
})
}
}
}
}
}
})
})
...
@@ -88,6 +94,7 @@ export default class EditManagementDoc extends Component {
...
@@ -88,6 +94,7 @@ export default class EditManagementDoc extends Component {
period
:
data
.
document_periode
,
period
:
data
.
document_periode
,
getMonthName
:
data
.
document_month
,
getMonthName
:
data
.
document_month
,
description
:
data
.
description
,
description
:
data
.
description
,
filePath
:
data
.
document_filepath
,
file
:
data
.
document_filepath
,
file
:
data
.
document_filepath
,
document_name
:
data
.
document_name
,
document_name
:
data
.
document_name
,
document_size
:
data
.
document_size
,
document_size
:
data
.
document_size
,
...
@@ -279,6 +286,10 @@ export default class EditManagementDoc extends Component {
...
@@ -279,6 +286,10 @@ export default class EditManagementDoc extends Component {
// this.setState({ errorDocument: true, msgErrorDocument: 'File Cannot be Empty' })
// this.setState({ errorDocument: true, msgErrorDocument: 'File Cannot be Empty' })
}
else
{
}
else
{
const
formData
=
new
FormData
();
const
formData
=
new
FormData
();
if
(
this
.
state
.
file
==
this
.
state
.
filePath
){
formData
.
append
(
"updated"
,
0
);
}
formData
.
append
(
"updated"
,
1
);
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
(
"settingId"
,
this
.
state
.
getDocument
.
document_category_id
);
formData
.
append
(
"settingId"
,
this
.
state
.
getDocument
.
document_category_id
);
...
@@ -290,6 +301,7 @@ export default class EditManagementDoc extends Component {
...
@@ -290,6 +301,7 @@ export default class EditManagementDoc extends Component {
this
.
setState
({
formData
},
()
=>
{
this
.
setState
({
formData
},
()
=>
{
this
.
props
.
updateDocument
(
this
.
state
.
formData
)
this
.
props
.
updateDocument
(
this
.
state
.
formData
)
})
})
console
.
log
(
JSON
.
stringify
(
formData
))
}
}
}
}
...
...
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