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
4cb685d5
Commit
4cb685d5
authored
Oct 02, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rifka' into 'master'
upload all extension See merge request
!420
parents
9f7680c2
e0eb4e0d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
72 additions
and
58 deletions
+72
-58
TaxPlanning.js
src/container/BudgetTahunan/TaxPlanning.js
+48
-26
CreateManagementDoc.js
src/container/DocumentManagement/CreateManagementDoc.js
+4
-6
DocumentManagement.js
src/container/DocumentManagement/DocumentManagement.js
+2
-11
EditManagementDoc.js
src/container/DocumentManagement/EditManagementDoc.js
+13
-10
Upload.js
src/library/Upload.js
+5
-5
No files found.
src/container/BudgetTahunan/TaxPlanning.js
View file @
4cb685d5
...
@@ -5008,8 +5008,10 @@ export default class TaxPlanning extends Component {
...
@@ -5008,8 +5008,10 @@ export default class TaxPlanning extends Component {
// }
// }
onClick
=
{()
=>
onClick
=
{()
=>
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
this
.
setState
({
handleTekTekTek
:
1
,
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
backToMasterBudget
(
'draft'
)
this
.
backToMasterBudget
(
'draft'
)
},
100
);
})
})
}
}
style
=
{{
style
=
{{
...
@@ -5043,8 +5045,10 @@ export default class TaxPlanning extends Component {
...
@@ -5043,8 +5045,10 @@ export default class TaxPlanning extends Component {
this
.
setState
({
alert
:
true
,
messageAlert
:
'Data is not complete !'
,
tipeAlert
:
'warning'
})
this
.
setState
({
alert
:
true
,
messageAlert
:
'Data is not complete !'
,
tipeAlert
:
'warning'
})
:
:
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
this
.
setState
({
handleTekTekTek
:
1
,
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
backToMasterBudget
(
'submitted'
)
this
.
backToMasterBudget
(
'submitted'
)
},
100
);
})}
})}
style
=
{{
style
=
{{
backgroundColor
:
'transparent'
,
backgroundColor
:
'transparent'
,
...
@@ -5133,17 +5137,26 @@ export default class TaxPlanning extends Component {
...
@@ -5133,17 +5137,26 @@ export default class TaxPlanning extends Component {
outline
:
'none'
,
outline
:
'none'
,
marginRight
:
20
marginRight
:
20
}}
}}
onClick
=
{()
=>
// onClick={() =>
this
.
state
.
editable
===
true
?
// this.state.editable === true ?
null
:
this
.
setState
({
loading
:
true
},
()
=>
// null : this.setState({ loading: true}, () =>
// this.state.handleTekTekTek == 1 ? null :
// this.setState({ handleTekTekTek: 1 }, () => {
// setTimeout(() => {
// this.uploadTP('draft')
// }, 100);
// })
// )
// }
onClick
=
{()
=>
this
.
state
.
editable
===
true
?
null
:
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
this
.
setState
({
handleTekTekTek
:
1
,
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
uploadTP
(
'draft'
)
this
.
uploadTP
(
'draft'
)
},
100
);
},
100
);
})
})}
)
}
>
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Save
as
Draft
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Save
as
Draft
<
/Typography
>
...
@@ -5158,17 +5171,26 @@ export default class TaxPlanning extends Component {
...
@@ -5158,17 +5171,26 @@ export default class TaxPlanning extends Component {
borderColor
:
'transparent'
,
borderColor
:
'transparent'
,
outline
:
'none'
,
outline
:
'none'
,
}}
}}
onClick
=
{()
=>
// onClick={() =>
this
.
state
.
editable
===
true
?
// this.state.editable === true ?
null
:
this
.
setState
({
loading
:
true
},
()
=>
// null : this.setState({ loading: true}, () =>
// this.state.handleTekTekTek == 1 ? null :
// this.setState({ handleTekTekTek: 1 }, () => {
// setTimeout(() => {
// this.uploadTP('submitted')
// }, 100);
// })
// )
// }
onClick
=
{()
=>
this
.
state
.
editable
===
true
?
null
:
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
this
.
setState
({
handleTekTekTek
:
1
,
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
uploadTP
(
'submitted'
)
this
.
uploadTP
(
'submitted'
)
},
100
);
},
100
);
})
})}
)
}
>
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Save
&
Complete
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Save
&
Complete
<
/Typography
>
...
...
src/container/DocumentManagement/CreateManagementDoc.js
View file @
4cb685d5
...
@@ -56,7 +56,6 @@ export default class CreateManagementDoc extends Component {
...
@@ -56,7 +56,6 @@ export default class CreateManagementDoc extends Component {
this
.
getPeriode
()
this
.
getPeriode
()
this
.
getMonth
()
this
.
getMonth
()
this
.
getFileSize
()
this
.
getFileSize
()
console
.
log
(
this
.
props
.
name
)
}
}
getFileSize
()
{
getFileSize
()
{
...
@@ -79,7 +78,6 @@ export default class CreateManagementDoc extends Component {
...
@@ -79,7 +78,6 @@ export default class CreateManagementDoc extends Component {
})
})
}
}
// sizeUpload: response.data.data[0] ? response.data.data[0].value === undefined ? "1" : response.data.data[0].value : "1"
// sizeUpload: response.data.data[0] ? response.data.data[0].value === undefined ? "1" : response.data.data[0].value : "1"
console
.
log
(
this
.
state
.
sizeUpload
)
}
}
}
}
})
})
...
@@ -226,8 +224,8 @@ export default class CreateManagementDoc extends Component {
...
@@ -226,8 +224,8 @@ export default class CreateManagementDoc extends Component {
let
fileObj
=
event
let
fileObj
=
event
let
length
=
event
.
name
.
split
(
"."
).
length
let
length
=
event
.
name
.
split
(
"."
).
length
let
fileType
=
event
.
name
.
split
(
"."
)[
length
-
1
]
let
fileType
=
event
.
name
.
split
(
"."
)[
length
-
1
]
console
.
log
(
fileType
)
//
console.log(fileType)
if
(
fileType
===
'zip'
)
{
if
(
fileType
===
'zip'
||
'rar'
)
{
this
.
setState
({
file
:
event
,
fileType
:
String
(
fileType
)
})
this
.
setState
({
file
:
event
,
fileType
:
String
(
fileType
)
})
}
else
{
}
else
{
ExcelRenderer
(
fileObj
,
(
err
,
resp
)
=>
{
ExcelRenderer
(
fileObj
,
(
err
,
resp
)
=>
{
...
@@ -267,7 +265,7 @@ export default class CreateManagementDoc extends Component {
...
@@ -267,7 +265,7 @@ export default class CreateManagementDoc extends Component {
object
[
key
]
=
value
;
object
[
key
]
=
value
;
});
});
var
json
=
JSON
.
stringify
(
object
);
var
json
=
JSON
.
stringify
(
object
);
console
.
log
(
object
)
//
console.log(object)
}
}
}
else
{
}
else
{
...
@@ -426,7 +424,7 @@ export default class CreateManagementDoc extends Component {
...
@@ -426,7 +424,7 @@ export default class CreateManagementDoc extends Component {
type
=
{
this
.
state
.
uploadStatus
}
type
=
{
this
.
state
.
uploadStatus
}
percentage
=
{
this
.
state
.
percentage
}
percentage
=
{
this
.
state
.
percentage
}
result
=
{
this
.
state
.
result
}
result
=
{
this
.
state
.
result
}
acceptedFiles
=
{[
"xls"
,
"xlsx"
,
"pdf"
,
"PDF"
,
"docx"
,
"doc"
,
"pptx"
,
"ppt"
,
"ods"
,
"odf"
,
"
zip
"
]}
acceptedFiles
=
{[
"xls"
,
"xlsx"
,
"pdf"
,
"PDF"
,
"docx"
,
"doc"
,
"pptx"
,
"ppt"
,
"ods"
,
"odf"
,
"
txt"
,
"csv"
,
"zip"
,
"rar
"
]}
intent
=
{
"management"
}
intent
=
{
"management"
}
onHandle
=
{(
dt
)
=>
{
onHandle
=
{(
dt
)
=>
{
this
.
fileHandler
(
dt
)
this
.
fileHandler
(
dt
)
...
...
src/container/DocumentManagement/DocumentManagement.js
View file @
4cb685d5
...
@@ -101,7 +101,7 @@ export default class DocumentManagement extends Component {
...
@@ -101,7 +101,7 @@ export default class DocumentManagement extends Component {
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
message
===
"The Document Already Exists in The System, Do You Want to Overwrite It?"
)
{
if
(
response
.
data
.
message
===
"The Document Already Exists in The System, Do You Want to Overwrite It?"
)
{
this
.
setState
({
formData
:
payload
,
docId
:
response
.
data
.
data
.
document_id
},
()
=>
{
this
.
setState
({
formData
:
payload
,
docId
:
response
.
data
.
data
.
document_id
,
settingID
,
menuName
},
()
=>
{
this
.
setState
({
konfirmasi
:
true
})
this
.
setState
({
konfirmasi
:
true
})
})
})
}
}
...
@@ -131,16 +131,7 @@ export default class DocumentManagement extends Component {
...
@@ -131,16 +131,7 @@ export default class DocumentManagement extends Component {
createUploadDocument
()
{
createUploadDocument
()
{
const
formData
=
this
.
state
.
formData
const
formData
=
this
.
state
.
formData
formData
.
append
(
"documentId"
,
this
.
state
.
docId
)
formData
.
append
(
"documentId"
,
this
.
state
.
docId
)
// const docuID = Object.values(payload)
formData
.
append
(
"updated"
,
1
)
// const formDatas = new FormData();
// formDatas.append("file", this.state.file);
// formDatas.append("companyId", this.state.getPerusahaan.company_id);
// formDatas.append("settingId", this.state.getDocument.document_category_id);
// formDatas.append("documentPeriode", this.state.periode.periode);
// formDatas.append("description", this.state.description);
// formDatas.append("extension", this.state.fileType);
// // formDatas.append("documentId", docuID[0]);
// console.log(payload);
api
.
create
().
updateDocument
(
formData
).
then
(
response
=>
{
api
.
create
().
updateDocument
(
formData
).
then
(
response
=>
{
console
.
log
(
response
)
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
)
{
...
...
src/container/DocumentManagement/EditManagementDoc.js
View file @
4cb685d5
...
@@ -58,7 +58,6 @@ export default class EditManagementDoc extends Component {
...
@@ -58,7 +58,6 @@ export default class EditManagementDoc extends Component {
this
.
getFileSize
()
this
.
getFileSize
()
if
(
this
.
props
.
type
===
'edit'
)
{
if
(
this
.
props
.
type
===
'edit'
)
{
this
.
getDetailDoc
()
this
.
getDetailDoc
()
console
.
log
(
this
.
props
)
}
}
}
}
...
@@ -270,6 +269,9 @@ export default class EditManagementDoc extends Component {
...
@@ -270,6 +269,9 @@ export default class EditManagementDoc extends Component {
let
fileObj
=
event
let
fileObj
=
event
let
length
=
event
.
name
.
split
(
"."
).
length
let
length
=
event
.
name
.
split
(
"."
).
length
let
fileType
=
event
.
name
.
split
(
"."
)[
length
-
1
]
let
fileType
=
event
.
name
.
split
(
"."
)[
length
-
1
]
if
(
fileType
===
'zip'
||
'rar'
)
{
this
.
setState
({
file
:
event
,
fileType
:
String
(
fileType
)
})
}
else
{
ExcelRenderer
(
fileObj
,
(
err
,
resp
)
=>
{
ExcelRenderer
(
fileObj
,
(
err
,
resp
)
=>
{
// console.log(fileType)
// console.log(fileType)
if
(
err
)
{
if
(
err
)
{
...
@@ -280,6 +282,7 @@ export default class EditManagementDoc extends Component {
...
@@ -280,6 +282,7 @@ export default class EditManagementDoc extends Component {
}
}
})
})
}
}
}
validasi
()
{
validasi
()
{
if
(
String
(
this
.
props
.
name
).
includes
(
'Manual Book TIA'
)){
if
(
String
(
this
.
props
.
name
).
includes
(
'Manual Book TIA'
)){
...
...
src/library/Upload.js
View file @
4cb685d5
...
@@ -60,7 +60,7 @@ class Upload extends Component {
...
@@ -60,7 +60,7 @@ class Upload extends Component {
// console.log(sizeFile);
// console.log(sizeFile);
if
(
this
.
props
.
intent
===
'management'
)
{
if
(
this
.
props
.
intent
===
'management'
)
{
if
(
acceptedFiles
)
{
if
(
acceptedFiles
)
{
if
(
this
.
props
.
acceptedFiles
.
includes
(
fileType
))
{
//
if (this.props.acceptedFiles.includes(fileType)) {
if
((
acceptedFiles
[
0
].
size
/
1000
).
toFixed
(
0
)
<
(
this
.
props
.
sizeUpload
*
1000
))
{
if
((
acceptedFiles
[
0
].
size
/
1000
).
toFixed
(
0
)
<
(
this
.
props
.
sizeUpload
*
1000
))
{
this
.
setState
({
this
.
setState
({
file
:
acceptedFiles
[
0
],
file
:
acceptedFiles
[
0
],
...
@@ -77,10 +77,10 @@ class Upload extends Component {
...
@@ -77,10 +77,10 @@ class Upload extends Component {
this
.
setState
({
alertMessage
:
`The file is too large. Allowed maximum size is
${
this
.
props
.
sizeUpload
}
MB`
,
alert
:
true
})
this
.
setState
({
alertMessage
:
`The file is too large. Allowed maximum size is
${
this
.
props
.
sizeUpload
}
MB`
,
alert
:
true
})
// alert('File Tidak Boleh Lebih Dari 1MB')
// alert('File Tidak Boleh Lebih Dari 1MB')
}
}
}
else
{
//
} else {
this
.
setState
({
alertMessage
:
'File extension not allowed'
,
alert
:
true
})
//
this.setState({ alertMessage: 'File extension not allowed', alert: true })
// alert('File Tidak Mendukung')
//
// alert('File Tidak Mendukung')
}
//
}
}
}
else
{
else
{
this
.
setState
({
this
.
setState
({
...
...
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