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
636ef873
Commit
636ef873
authored
Sep 22, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
b6c5d5a1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
45 deletions
+64
-45
BudgetTahunan.js
src/container/BudgetTahunan.js
+11
-6
CreateManagementDoc.js
src/container/DocumentManagement/CreateManagementDoc.js
+22
-1
EditManagementDoc.js
src/container/DocumentManagement/EditManagementDoc.js
+25
-32
Upload.js
src/library/Upload.js
+6
-6
No files found.
src/container/BudgetTahunan.js
View file @
636ef873
import
React
,
{
Component
}
from
'react'
;
import
{
Typography
,
Paper
,
TextField
,
MenuItem
,
Select
,
FormControlLabel
,
Snackbar
,
withStyles
}
from
'@material-ui/core'
;
import
{
Typography
,
Paper
,
TextField
,
MenuItem
,
Select
,
FormControlLabel
,
Snackbar
,
withStyles
,
createMuiTheme
,
MuiThemeProvider
}
from
'@material-ui/core'
;
import
MUIDataTable
from
'mui-datatables'
;
import
Images
from
'../assets/Images'
;
import
BalanceSheet
from
'./BudgetTahunan/BalanceSheet'
;
...
...
@@ -17,6 +17,9 @@ import { format } from 'date-fns';
import
Constant
from
'../library/Constant'
;
import
PropagateLoader
from
"react-spinners/PropagateLoader"
var
ct
=
require
(
"../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
const
Alert
=
withStyles
({
})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
...
...
@@ -500,11 +503,13 @@ export default class BudgetTahunan extends Component {
<
/div
>
<
div
style
=
{{
marginTop
:
20
}}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
data
=
{
this
.
state
.
dataTable
}
columns
=
{
columns
}
options
=
{
options
}
/
>
<
/MuiThemeProvider
>
<
/div
>
<
div
style
=
{{
display
:
'flex'
,
marginTop
:
20
}}
>
<
div
style
=
{{
width
:
'50%'
}}
>
...
...
src/container/DocumentManagement/CreateManagementDoc.js
View file @
636ef873
...
...
@@ -40,7 +40,8 @@ export default class CreateManagementDoc extends Component {
messageAlert
:
''
,
fileType
:
''
,
konfirmasi
:
false
,
docId
:
''
docId
:
''
,
sizeUpload
:
"1"
}
}
...
...
@@ -49,6 +50,25 @@ export default class CreateManagementDoc extends Component {
this
.
getDataDocument
()
this
.
getPeriode
()
this
.
getMonth
()
this
.
getFileSize
()
}
getFileSize
(){
let
body
=
{
group
:
'MAX_FILE_SIZE'
,
company_id
:
0
,
type
:
'MAX_FILE_SIZE'
}
api
.
create
().
getAllSettingByType
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
sizeUpload
:
response
.
data
.
data
[
0
].
value
})
}
}
})
}
getDataCompany
()
{
...
...
@@ -352,6 +372,7 @@ export default class CreateManagementDoc extends Component {
this
.
deleteFile
(
e
)
}}
onUpload
=
{()
=>
alert
(
'sukses'
)}
sizeUpload
=
{
Number
(
this
.
state
.
sizeUpload
)}
/
>
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
paddingLeft
:
30
,
paddingRight
:
30
,
borderRadius
:
5
,
paddingBottom
:
20
}}
>
...
...
src/container/DocumentManagement/EditManagementDoc.js
View file @
636ef873
...
...
@@ -43,16 +43,36 @@ export default class EditManagementDoc extends Component {
docId
:
''
,
document_name
:
""
,
document_size
:
0
,
loadUpload
:
false
loadUpload
:
false
,
sizeUpload
:
"1"
}
}
componentDidMount
()
{
this
.
getFileSize
()
if
(
this
.
props
.
type
===
'edit'
)
{
this
.
getDetailDoc
()
}
}
getFileSize
(){
let
body
=
{
group
:
'MAX_FILE_SIZE'
,
company_id
:
0
,
type
:
'MAX_FILE_SIZE'
}
api
.
create
().
getAllSettingByType
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
sizeUpload
:
response
.
data
.
data
[
0
].
value
})
}
}
})
}
getDetailDoc
()
{
api
.
create
().
getDetailDocument
(
this
.
props
.
idoc
).
then
(
response
=>
{
console
.
log
(
response
)
...
...
@@ -68,10 +88,12 @@ export default class EditManagementDoc extends Component {
period
:
data
.
document_periode
,
getMonthName
:
data
.
document_month
,
description
:
data
.
description
,
file
:
data
.
document_filepath
,
document_name
:
data
.
document_name
,
document_size
:
data
.
document_size
,
// id: data.approval_matrix_id,
// status: data.status,
fileType
:
data
.
document_type
,
created
:
data
.
created
,
updated
:
data
.
updated
===
null
?
""
:
data
.
updated
,
loadUpload
:
true
...
...
@@ -247,6 +269,7 @@ export default class EditManagementDoc extends Component {
}
validasi
()
{
console
.
log
(
this
.
state
.
file
);
if
(
R
.
isNil
(
this
.
state
.
getPerusahaan
))
{
this
.
setState
({
errorPerusahaan
:
true
,
msgErrorPerusahaan
:
'Company Cannot be Empty'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
getDocument
))
{
...
...
@@ -397,6 +420,7 @@ export default class EditManagementDoc extends Component {
value
=
{
this
.
state
.
file
}
docSize
=
{
this
.
state
.
document_size
}
docName
=
{
this
.
state
.
document_name
}
sizeUpload
=
{
Number
(
this
.
state
.
sizeUpload
)}
/
>
)}
<
/div
>
...
...
@@ -431,37 +455,6 @@ export default class EditManagementDoc extends Component {
>
<
/TextField
>
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
paddingLeft
:
30
,
paddingRight
:
30
,
borderRadius
:
5
,
paddingBottom
:
20
}}
>
<
TextField
style
=
{{
width
:
'100%'
}}
id
=
"description"
label
=
"Description"
value
=
{
this
.
state
.
description
}
inputProps
=
{{
min
:
0
,
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
name
=
"Description"
onChange
=
{(
e
)
=>
{
this
.
setState
({
description
:
e
.
target
.
value
})
this
.
clearMessage
()
}}
error
=
{
this
.
state
.
errorDesc
}
helperText
=
{
this
.
state
.
msgErrorDesc
}
>
<
/TextField
>
<
/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
>
...
...
src/library/Upload.js
View file @
636ef873
...
...
@@ -57,11 +57,11 @@ class Upload extends Component {
let
length
=
acceptedFiles
[
0
].
name
.
split
(
"."
).
length
let
fileType
=
acceptedFiles
[
0
].
name
.
split
(
"."
)[
length
-
1
]
formData
.
append
(
'file'
,
acceptedFiles
[
0
])
console
.
log
(
fileTyp
e
);
// console.log(sizeFil
e);
if
(
this
.
props
.
intent
===
'management'
)
{
if
(
acceptedFiles
)
{
if
(
this
.
props
.
acceptedFiles
.
includes
(
fileType
))
{
if
(
this
.
state
.
sizeFile
<
10000
)
{
if
(
(
acceptedFiles
[
0
].
size
/
1000
).
toFixed
(
0
)
<
(
this
.
state
.
sizeUpload
*
1000
)
)
{
this
.
setState
({
file
:
acceptedFiles
[
0
],
typeFile
:
fileType
,
...
...
@@ -74,7 +74,7 @@ class Upload extends Component {
})
this
.
props
.
onHandle
(
acceptedFiles
[
0
])
}
else
{
this
.
setState
({
alertMessage
:
'The file is too large. Allowed maximum size is 10MB'
,
alert
:
true
})
this
.
setState
({
alertMessage
:
`The file is too large. Allowed maximum size is
${
this
.
state
.
sizeUpload
}
MB`
,
alert
:
true
})
// alert('File Tidak Boleh Lebih Dari 1MB')
}
}
else
{
...
...
@@ -149,10 +149,10 @@ class Upload extends Component {
if
(
strProps
.
includes
(
strState
))
{
if
(
this
.
props
.
intent
===
'management'
)
{
if
(
this
.
state
.
sizeFile
<
10
000
)
{
if
(
this
.
state
.
sizeFile
<
this
.
state
.
sizeUpload
*
1
000
)
{
this
.
props
.
onUpload
()
}
else
{
this
.
setState
({
alertMessage
:
'The file is too large. Allowed maximum size is 1
0
MB'
,
alert
:
true
})
this
.
setState
({
alertMessage
:
'The file is too large. Allowed maximum size is 1MB'
,
alert
:
true
})
// alert('File Tidak Boleh Lebih Dari 1MB')
}
}
else
{
...
...
@@ -213,7 +213,7 @@ class Upload extends Component {
{
this
.
state
.
docName
}
<
/div
>
<
div
className
=
"txt-site txt-11 txt-white txt-thin"
>
{
this
.
state
.
docSize
}
KB
{
this
.
state
.
docSize
/
1000
}
KB
<
/div
>
<
/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