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
bc7aa7ec
Commit
bc7aa7ec
authored
Sep 29, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rifka' into 'master'
update issue managdoc See merge request
!388
parents
6590125a
f3ba480d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
159 additions
and
89 deletions
+159
-89
AllDocument.js
src/container/DocumentManagement/AllDocument.js
+2
-2
CreateManagementDoc.js
src/container/DocumentManagement/CreateManagementDoc.js
+88
-51
DocumentManagement.js
src/container/DocumentManagement/DocumentManagement.js
+6
-3
EditManagementDoc.js
src/container/DocumentManagement/EditManagementDoc.js
+63
-33
No files found.
src/container/DocumentManagement/AllDocument.js
View file @
bc7aa7ec
...
...
@@ -259,13 +259,13 @@ export default class getAllDocument extends Component {
}
},
"File Name"
,
"Description"
,
"Company Name"
,
{
name
:
"
Monthly
"
,
name
:
"
Period Month
"
,
options
:
{
display
:
String
(
this
.
props
.
data
.
value
).
includes
(
'Manual Book TIA'
)
?
false
:
true
}
},
{
name
:
"Period"
,
name
:
"Period
Year
"
,
options
:
{
display
:
String
(
this
.
props
.
data
.
value
).
includes
(
'Manual Book TIA'
)
?
false
:
true
}
...
...
src/container/DocumentManagement/CreateManagementDoc.js
View file @
bc7aa7ec
...
...
@@ -29,8 +29,12 @@ export default class CreateManagementDoc extends Component {
msgErrorDocument
:
''
,
listPeriode
:
null
,
periode
:
null
,
errorPeriode
:
false
,
msgErrorPeriode
:
''
,
listMonth
:
null
,
monthId
:
null
,
errorMonth
:
false
,
msgErrorMonth
:
''
,
description
:
''
,
errorDesc
:
false
,
msgErrorDesc
:
''
,
...
...
@@ -51,6 +55,8 @@ export default class CreateManagementDoc extends Component {
this
.
getPeriode
()
this
.
getMonth
()
this
.
getFileSize
()
console
.
log
(
this
.
props
.
setting_id
)
console
.
log
(
this
.
props
.
name
)
}
getFileSize
(){
...
...
@@ -202,6 +208,10 @@ export default class CreateManagementDoc extends Component {
msgErrorPerusahaan
:
''
,
errorDocument
:
false
,
msgErrorDocument
:
''
,
errorMonth
:
false
,
msgErrorMonth
:
''
,
errorPeriode
:
false
,
msgErrorPeriode
:
''
,
})
}
...
...
@@ -221,17 +231,37 @@ export default class CreateManagementDoc extends Component {
}
validasi
()
{
console
.
log
(
this
.
state
.
monthId
.
month_id
)
if
(
String
(
this
.
props
.
name
).
includes
(
'Manual Book TIA'
)){
if
(
R
.
isNil
(
this
.
state
.
getPerusahaan
))
{
this
.
setState
({
errorPerusahaan
:
true
,
msgErrorPerusahaan
:
'Company Cannot be Empty'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
getDocument
))
{
this
.
setState
({
errorDocument
:
true
,
msgErrorDocument
:
'Category Cannot be Empty'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
file
))
{
this
.
setState
({
alert
:
true
,
messageAlert
:
'File Cannot be Empty'
,
tipeAlert
:
'warning'
})
}
else
{
const
formData
=
new
FormData
();
formData
.
append
(
"file"
,
this
.
state
.
file
);
formData
.
append
(
"companyId"
,
this
.
state
.
getPerusahaan
.
company_id
);
formData
.
append
(
"settingId"
,
this
.
state
.
getDocument
.
document_category_id
);
formData
.
append
(
"description"
,
this
.
state
.
description
);
formData
.
append
(
"extension"
,
this
.
state
.
fileType
);
formData
.
append
(
"documentPeriode"
,
null
);
formData
.
append
(
"documentMonth"
,
null
);
this
.
setState
({
formData
},
()
=>
{
this
.
props
.
createDocument
(
this
.
state
.
formData
,
this
.
props
.
setting_id
)
})
}
}
else
{
if
(
R
.
isNil
(
this
.
state
.
getPerusahaan
))
{
this
.
setState
({
errorPerusahaan
:
true
,
msgErrorPerusahaan
:
'Company Cannot be Empty'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
getDocument
))
{
this
.
setState
({
errorDocument
:
true
,
msgErrorDocument
:
'Category Cannot be Empty'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
periode
))
{
this
.
setState
({
errorPeriode
:
true
,
msgErrorPeriode
:
'Period Cannot be Empty'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
monthId
))
{
this
.
setState
({
errorMonth
:
true
,
msgErrorMonth
:
'Month Cannot be Empty'
})
}
// else if (R.isNil(this.state.periode)) {
// this.setState({ errorPeriode: true, msgErrorPeriode: 'Period Cannot be Empty' })
// } else if (R.isNil(this.state.monthId)) {
// this.setState({ errorMonth: true, msgErrorMonth: 'Month Cannot be Empty' })
// }
else
if
(
R
.
isNil
(
this
.
state
.
file
))
{
this
.
setState
({
alert
:
true
,
messageAlert
:
'File Cannot be Empty'
,
tipeAlert
:
'warning'
})
}
else
{
...
...
@@ -239,15 +269,16 @@ export default class CreateManagementDoc extends Component {
formData
.
append
(
"file"
,
this
.
state
.
file
);
formData
.
append
(
"companyId"
,
this
.
state
.
getPerusahaan
.
company_id
);
formData
.
append
(
"settingId"
,
this
.
state
.
getDocument
.
document_category_id
);
formData
.
append
(
"documentPeriode"
,
this
.
state
.
periode
.
periode
);
formData
.
append
(
"documentMonth"
,
this
.
state
.
monthId
.
month_id
);
formData
.
append
(
"description"
,
this
.
state
.
description
);
formData
.
append
(
"extension"
,
this
.
state
.
fileType
);
formData
.
append
(
"documentPeriode"
,
this
.
state
.
periode
.
periode
);
formData
.
append
(
"documentMonth"
,
this
.
state
.
monthId
.
month_id
);
this
.
setState
({
formData
},
()
=>
{
this
.
props
.
createDocument
(
this
.
state
.
formData
,
this
.
props
.
setting_id
)
})
}
}
}
deleteFile
(
e
){
this
.
setState
({
file
:
null
})
...
...
@@ -298,25 +329,6 @@ export default class CreateManagementDoc extends Component {
value
=
{
this
.
state
.
getPerusahaan
}
/
>
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Autocomplete
{...
this
.
state
.
listMonth
}
// debug
clearOnEscape
id
=
"month"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
monthId
:
newInputValue
},
()
=>
{
this
.
clearMessage
()
})}
style
=
{{
width
:
250
}}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Monthly"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
/>
}
value
=
{
this
.
state
.
monthId
}
/
>
<
/div
>
<
/div
>
<
div
className
=
"column-2"
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
...
...
@@ -336,28 +348,53 @@ export default class CreateManagementDoc extends Component {
value
=
{
this
.
state
.
getDocument
}
/
>
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
/div
>
{
String
(
this
.
props
.
name
).
includes
(
'Manual Book TIA'
)
?
false
:
(
<
div
className
=
"column-1"
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Autocomplete
{...
this
.
state
.
listMonth
}
// debug
clearOnEscape
id
=
"month"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
monthId
:
newInputValue
},
()
=>
this
.
clearMessage
())}
style
=
{{
width
:
250
}}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Period Month"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
error
=
{
this
.
state
.
errorMonth
}
helperText
=
{
this
.
state
.
msgErrorMonth
}
/>
}
value
=
{
this
.
state
.
monthId
}
/
>
<
/div
>
<
/div
>
)}
{
String
(
this
.
props
.
name
).
includes
(
'Manual Book TIA'
)
?
false
:
(
<
div
className
=
"column-2"
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Autocomplete
{...
this
.
state
.
listPeriode
}
// debug
clearOnEscape
id
=
"periode"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
periode
:
newInputValue
},
()
=>
{
this
.
clearMessage
()
})}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
periode
:
newInputValue
},
()
=>
this
.
clearMessage
())}
style
=
{{
width
:
250
}}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Period"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
<
TextField
{...
params
}
label
=
"Period
Year
"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
error
=
{
this
.
state
.
errorPeriode
}
helperText
=
{
this
.
state
.
msgErrorPeriode
}
/>
}
value
=
{
this
.
state
.
periode
}
/
>
<
/div
>
<
/div
>
)}
<
/div
>
<
div
style
=
{{
paddingLeft
:
30
,
paddingRight
:
30
}}
>
<
div
style
=
{{
paddingLeft
:
30
,
paddingRight
:
30
,
paddingTop
:
10
}}
>
<
UploadFile
type
=
{
this
.
state
.
uploadStatus
}
percentage
=
{
this
.
state
.
percentage
}
...
...
src/container/DocumentManagement/DocumentManagement.js
View file @
bc7aa7ec
...
...
@@ -28,6 +28,7 @@ export default class DocumentManagement extends Component {
btnedit
:
false
,
btndelete
:
false
,
load
:
false
,
name
:
''
}
}
...
...
@@ -66,7 +67,7 @@ export default class DocumentManagement extends Component {
this
.
getPermission
()
}
getDataDocument
(
id
)
{
getDataDocument
(
id
,
name
)
{
// let payload = {
// "setting_group_id": 7,
// "setting_type_id": 167,
...
...
@@ -80,6 +81,7 @@ export default class DocumentManagement extends Component {
this
.
setState
({
listData
:
response
.
data
.
data
,
id
:
id
===
undefined
?
response
.
data
.
data
[
0
].
setting_id
:
id
,
name
:
name
===
undefined
?
response
.
data
.
data
[
0
].
value
:
name
,
loadTable
:
true
,
refresh
:
id
===
undefined
?
''
:
'create'
})
...
...
@@ -184,7 +186,7 @@ export default class DocumentManagement extends Component {
<
/Alert
>
<
/Snackbar
>
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
78
,
display
:
'flex'
,
alignItems
:
'center'
,
paddingLeft
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Management
Docu
ment
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Document
Manage
ment
<
/Typography
>
<
/div
>
<
div
style
=
{{
padding
:
20
}}
>
<
Paper
style
=
{{
padding
:
20
}}
>
...
...
@@ -216,7 +218,7 @@ export default class DocumentManagement extends Component {
{
this
.
state
.
listData
.
map
((
item
,
index
)
=>
{
return
(
<
Tab
onClick
=
{()
=>
this
.
setState
({
id
:
item
.
setting_id
,
refresh
:
''
,
loadTable
:
false
},
()
=>
this
.
setState
({
loadTable
:
true
}))}
onClick
=
{()
=>
this
.
setState
({
name
:
item
.
value
,
id
:
item
.
setting_id
,
refresh
:
''
,
loadTable
:
false
},
()
=>
this
.
setState
({
loadTable
:
true
}))}
label
=
{
item
.
value
}
/
>
)
...
...
@@ -292,6 +294,7 @@ export default class DocumentManagement extends Component {
// getDataDocument={this.getDataDocument.bind(this)}
createDocument
=
{
this
.
createDocument
.
bind
(
this
)}
setting_id
=
{
this
.
state
.
id
}
name
=
{
this
.
state
.
name
}
/
>
)}
<
/div
>
...
...
src/container/DocumentManagement/EditManagementDoc.js
View file @
bc7aa7ec
...
...
@@ -34,6 +34,10 @@ export default class EditManagementDoc extends Component {
description
:
''
,
errorDesc
:
false
,
msgErrorDesc
:
''
,
errorMonth
:
false
,
msgErrorMonth
:
''
,
errorPeriode
:
false
,
msgErrorPeriode
:
''
,
file
:
null
,
alert
:
false
,
tipeAlert
:
''
,
...
...
@@ -44,7 +48,8 @@ export default class EditManagementDoc extends Component {
document_name
:
""
,
document_size
:
0
,
loadUpload
:
false
,
sizeUpload
:
"1"
sizeUpload
:
"1"
,
name
:
''
}
}
...
...
@@ -52,6 +57,7 @@ export default class EditManagementDoc extends Component {
this
.
getFileSize
()
if
(
this
.
props
.
type
===
'edit'
)
{
this
.
getDetailDoc
()
console
.
log
(
this
.
props
.
data
)
}
}
...
...
@@ -97,7 +103,8 @@ export default class EditManagementDoc extends Component {
fileType
:
data
.
document_type
,
created
:
data
.
created
,
updated
:
data
.
updated
===
null
?
""
:
data
.
updated
,
loadUpload
:
true
loadUpload
:
true
,
name
:
data
.
values
},
()
=>
{
this
.
getDataCompany
()
this
.
getDataDocument
()
...
...
@@ -250,6 +257,10 @@ export default class EditManagementDoc extends Component {
msgErrorPerusahaan
:
''
,
errorDocument
:
false
,
msgErrorDocument
:
''
,
errorMonth
:
false
,
msgErrorMonth
:
''
,
errorPeriode
:
false
,
msgErrorPeriode
:
''
,
})
}
...
...
@@ -270,15 +281,23 @@ export default class EditManagementDoc extends Component {
}
validasi
()
{
console
.
log
(
this
.
state
.
file
);
if
(
String
(
this
.
props
.
name
).
includes
(
'Manual Book TIA'
)){
}
else
{
if
(
R
.
isNil
(
this
.
state
.
periode
))
{
this
.
setState
({
errorPeriode
:
true
,
msgErrorPeriode
:
'Period Cannot be Empty'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
monthId
))
{
this
.
setState
({
errorMonth
:
true
,
msgErrorMonth
:
'Month Cannot be Empty'
})
}
}
if
(
R
.
isNil
(
this
.
state
.
getPerusahaan
))
{
this
.
setState
({
errorPerusahaan
:
true
,
msgErrorPerusahaan
:
'Company Cannot be Empty'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
getDocument
))
{
this
.
setState
({
errorDocument
:
true
,
msgErrorDocument
:
'Category Cannot be Empty'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
file
))
{
this
.
setState
({
alert
:
true
,
messageAlert
:
'File Cannot be Empty'
,
tipeAlert
:
'warning'
})
// this.setState({ errorDocument: true, msgErrorDocument: 'File Cannot be Empty' })
}
else
{
}
else
{
const
formData
=
new
FormData
();
if
(
this
.
state
.
file
==
this
.
state
.
filePath
){
formData
.
append
(
"updated"
,
0
);
...
...
@@ -287,10 +306,15 @@ export default class EditManagementDoc extends Component {
formData
.
append
(
"updated"
,
1
);
formData
.
append
(
"file"
,
this
.
state
.
file
);
}
formData
.
append
(
"companyId"
,
this
.
state
.
getPerusahaan
.
company_id
);
formData
.
append
(
"settingId"
,
this
.
state
.
getDocument
.
document_category_id
);
if
(
String
(
this
.
props
.
name
).
includes
(
'Manual Book TIA'
)){
formData
.
append
(
"documentMonth"
,
null
);
formData
.
append
(
"documentPeriode"
,
null
);
}
else
{
formData
.
append
(
"documentMonth"
,
this
.
state
.
monthId
.
month_id
);
formData
.
append
(
"documentPeriode"
,
this
.
state
.
periode
.
periode
);
}
formData
.
append
(
"companyId"
,
this
.
state
.
getPerusahaan
.
company_id
);
formData
.
append
(
"settingId"
,
this
.
state
.
getDocument
.
document_category_id
);
formData
.
append
(
"description"
,
this
.
state
.
description
);
formData
.
append
(
"extension"
,
this
.
state
.
fileType
);
formData
.
append
(
"documentId"
,
this
.
props
.
idoc
);
...
...
@@ -355,25 +379,6 @@ export default class EditManagementDoc extends Component {
value
=
{
this
.
state
.
getPerusahaan
}
/
>
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Autocomplete
{...
this
.
state
.
listMonth
}
// debug
clearOnEscape
id
=
"month"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
monthId
:
newInputValue
},
()
=>
{
this
.
clearMessage
()
})}
style
=
{{
width
:
250
}}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Monthly"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
/>
}
value
=
{
this
.
state
.
monthId
}
/
>
<
/div
>
<
/div
>
<
div
className
=
"column-2"
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
...
...
@@ -393,28 +398,53 @@ export default class EditManagementDoc extends Component {
value
=
{
this
.
state
.
getDocument
}
/
>
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
/div
>
{
String
(
this
.
state
.
name
).
includes
(
'Manual Book TIA'
)
?
false
:
(
<
div
className
=
"column-1"
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Autocomplete
{...
this
.
state
.
listMonth
}
// debug
clearOnEscape
id
=
"month"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
monthId
:
newInputValue
},
()
=>
this
.
clearMessage
())}
style
=
{{
width
:
250
}}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Period Month"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
error
=
{
this
.
state
.
errorMonth
}
helperText
=
{
this
.
state
.
msgErrorMonth
}
/>
}
value
=
{
this
.
state
.
monthId
}
/
>
<
/div
>
<
/div
>
)}
{
String
(
this
.
state
.
name
).
includes
(
'Manual Book TIA'
)
?
false
:
(
<
div
className
=
"column-2"
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Autocomplete
{...
this
.
state
.
listPeriode
}
// debug
clearOnEscape
id
=
"periode"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
periode
:
newInputValue
},
()
=>
{
this
.
clearMessage
()
})}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
periode
:
newInputValue
},
()
=>
this
.
clearMessage
())}
style
=
{{
width
:
250
}}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Period"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
<
TextField
{...
params
}
label
=
"Period
Year
"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
error
=
{
this
.
state
.
errorPeriode
}
helperText
=
{
this
.
state
.
msgErrorPeriode
}
/>
}
value
=
{
this
.
state
.
periode
}
/
>
<
/div
>
<
/div
>
)}
<
/div
>
<
div
style
=
{{
paddingLeft
:
30
,
paddingRight
:
30
}}
>
<
div
style
=
{{
paddingLeft
:
30
,
paddingRight
:
30
,
paddingTop
:
10
}}
>
{
this
.
state
.
loadUpload
&&
(
<
UploadFile
type
=
{
this
.
state
.
uploadStatus
}
...
...
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