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
e95be860
Commit
e95be860
authored
Jul 14, 2022
by
muhammad ridwan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixing v4
parent
26a2efe5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
35 deletions
+4
-35
CarfmDocument.js
src/container/CRFM/CarfmDocument.js
+1
-2
CreateCarfmDoc.js
src/container/CRFM/CreateCarfmDoc.js
+3
-33
No files found.
src/container/CRFM/CarfmDocument.js
View file @
e95be860
...
@@ -204,8 +204,8 @@ export default class CarfmDocument extends Component {
...
@@ -204,8 +204,8 @@ export default class CarfmDocument extends Component {
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
message
===
"Data was Saved Successfully"
)
{
if
(
response
.
data
.
message
===
"Data was Saved Successfully"
)
{
this
.
getDataCarfm
(
'create'
)
this
.
setState
({
visibleCreate
:
false
,
loading
:
false
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
this
.
setState
({
visibleCreate
:
false
,
loading
:
false
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
this
.
getDataCarfm
(
'create'
)
}
}
else
{
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
...
@@ -329,7 +329,6 @@ export default class CarfmDocument extends Component {
...
@@ -329,7 +329,6 @@ export default class CarfmDocument extends Component {
// getDataDocument={this.getDataDocument.bind(this)}
// getDataDocument={this.getDataDocument.bind(this)}
createDocument={this.createDocument.bind(this)}
createDocument={this.createDocument.bind(this)}
handleLoading={this.handleLoading.bind(this)}
handleLoading={this.handleLoading.bind(this)}
allsubcoCreate={this.state.btnadd}
submenu_id={this.state.submenu_id}
submenu_id={this.state.submenu_id}
/>
/>
)}
)}
...
...
src/container/CRFM/CreateCarfmDoc.js
View file @
e95be860
...
@@ -46,7 +46,6 @@ export default class CreateCarfmDoc extends Component {
...
@@ -46,7 +46,6 @@ export default class CreateCarfmDoc extends Component {
fileType
:
''
,
fileType
:
''
,
docId
:
''
,
docId
:
''
,
sizeUpload
:
"1"
,
sizeUpload
:
"1"
,
disabledPeriode
:
false
,
menuName
:
null
,
menuName
:
null
,
saveDisable
:
false
saveDisable
:
false
}
}
...
@@ -251,30 +250,6 @@ export default class CreateCarfmDoc extends Component {
...
@@ -251,30 +250,6 @@ export default class CreateCarfmDoc extends Component {
}
}
validasi
()
{
validasi
()
{
if
(
this
.
state
.
disabledPeriode
===
true
)
{
if
(
R
.
isNil
(
this
.
state
.
file
))
{
this
.
setState
({
alert
:
true
,
messageAlert
:
'File Cannot be Empty'
,
tipeAlert
:
'warning'
,
saveDisable
:
false
})
}
else
{
const
formData
=
new
FormData
();
formData
.
append
(
"file"
,
this
.
state
.
file
);
formData
.
append
(
"companyId"
,
1
);
formData
.
append
(
"submenuId"
,
this
.
props
.
submenu_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
)
})
var
object
=
{};
formData
.
forEach
(
function
(
value
,
key
)
{
object
[
key
]
=
value
;
});
var
json
=
JSON
.
stringify
(
object
);
// console.log(object)
}
}
else
{
if
(
R
.
isNil
(
this
.
state
.
getPerusahaan
))
{
if
(
R
.
isNil
(
this
.
state
.
getPerusahaan
))
{
this
.
setState
({
errorPerusahaan
:
true
,
msgErrorPerusahaan
:
'Company Cannot be Empty'
,
saveDisable
:
false
})
this
.
setState
({
errorPerusahaan
:
true
,
msgErrorPerusahaan
:
'Company Cannot be Empty'
,
saveDisable
:
false
})
}
else
if
(
R
.
isNil
(
this
.
state
.
periode
))
{
}
else
if
(
R
.
isNil
(
this
.
state
.
periode
))
{
...
@@ -297,7 +272,6 @@ export default class CreateCarfmDoc extends Component {
...
@@ -297,7 +272,6 @@ export default class CreateCarfmDoc extends Component {
this
.
props
.
createDocument
(
this
.
state
.
formData
,
)
this
.
props
.
createDocument
(
this
.
state
.
formData
,
)
})
})
}
}
}
this
.
props
.
handleLoading
(
0
)
this
.
props
.
handleLoading
(
0
)
}
}
...
@@ -342,7 +316,6 @@ export default class CreateCarfmDoc extends Component {
...
@@ -342,7 +316,6 @@ export default class CreateCarfmDoc extends Component {
<
/div
>
<
/div
>
<
div
className
=
"grid grid-2x grid-mobile-none gap-15px"
style
=
{{
paddingLeft
:
20
,
paddingRight
:
20
,
paddingTop
:
20
}}
>
<
div
className
=
"grid grid-2x grid-mobile-none gap-15px"
style
=
{{
paddingLeft
:
20
,
paddingRight
:
20
,
paddingTop
:
20
}}
>
{
this
.
state
.
disabledPeriode
===
false
?
<
div
className
=
"column-1"
>
<
div
className
=
"column-1"
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Autocomplete
<
Autocomplete
...
@@ -362,7 +335,6 @@ export default class CreateCarfmDoc extends Component {
...
@@ -362,7 +335,6 @@ export default class CreateCarfmDoc extends Component {
/
>
/
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
:
true
}
<
div
className
=
"column-2"
>
<
div
className
=
"column-2"
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
,
marginTop
:
"1.2em"
}}
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
,
marginTop
:
"1.2em"
}}
>
...
@@ -378,7 +350,6 @@ export default class CreateCarfmDoc extends Component {
...
@@ -378,7 +350,6 @@ export default class CreateCarfmDoc extends Component {
<
/div
>
<
/div
>
<
/div
>
<
/div
>
{
this
.
state
.
disabledPeriode
===
false
?
<
div
className
=
"column-1"
>
<
div
className
=
"column-1"
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Autocomplete
<
Autocomplete
...
@@ -399,8 +370,7 @@ export default class CreateCarfmDoc extends Component {
...
@@ -399,8 +370,7 @@ export default class CreateCarfmDoc extends Component {
/
>
/
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
:
true
}
{
this
.
state
.
disabledPeriode
===
false
?
<
div
className
=
"column-2"
>
<
div
className
=
"column-2"
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
Autocomplete
<
Autocomplete
...
@@ -421,7 +391,6 @@ export default class CreateCarfmDoc extends Component {
...
@@ -421,7 +391,6 @@ export default class CreateCarfmDoc extends Component {
/
>
/
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
:
true
}
<
/div
>
<
/div
>
<
div
style
=
{{
paddingLeft
:
30
,
paddingRight
:
30
,
paddingTop
:
10
}}
>
<
div
style
=
{{
paddingLeft
:
30
,
paddingRight
:
30
,
paddingTop
:
10
}}
>
<
UploadFile
<
UploadFile
...
@@ -490,10 +459,11 @@ export default class CreateCarfmDoc extends Component {
...
@@ -490,10 +459,11 @@ export default class CreateCarfmDoc extends Component {
type
=
"button"
type
=
"button"
onClick
=
{()
=>
onClick
=
{()
=>
{
{
this
.
props
.
handleLoading
(
1
);
this
.
setState
({
this
.
setState
({
saveDisable
:
true
saveDisable
:
true
});
});
this
.
props
.
handleLoading
(
1
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
validasi
()
this
.
validasi
()
console
.
log
(
"vlidasi "
+
this
.
validasi
());
console
.
log
(
"vlidasi "
+
this
.
validasi
());
...
...
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