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
fbeb6c9f
Commit
fbeb6c9f
authored
Sep 02, 2020
by
EKSAD
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
belum fix
parent
37416bc8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
ReportItems.js
src/container/MasterData/ReportItems.js
+18
-8
No files found.
src/container/MasterData/ReportItems.js
View file @
fbeb6c9f
...
@@ -43,7 +43,8 @@ export default class ReportItems extends Component {
...
@@ -43,7 +43,8 @@ export default class ReportItems extends Component {
messageAlert
:
''
,
messageAlert
:
''
,
buttonCreate
:
false
,
buttonCreate
:
false
,
buttonEdit
:
false
,
buttonEdit
:
false
,
load
:
false
load
:
false
,
judul
:
''
}
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
...
@@ -56,7 +57,6 @@ export default class ReportItems extends Component {
...
@@ -56,7 +57,6 @@ export default class ReportItems extends Component {
console
.
log
(
err
);
console
.
log
(
err
);
}
}
else
{
else
{
let
judul
=
resp
.
rows
[
0
]
let
isi
=
resp
.
rows
.
slice
(
3
)
let
isi
=
resp
.
rows
.
slice
(
3
)
let
payload
=
[]
let
payload
=
[]
isi
.
map
((
item
,
index
)
=>
{
isi
.
map
((
item
,
index
)
=>
{
...
@@ -82,14 +82,16 @@ export default class ReportItems extends Component {
...
@@ -82,14 +82,16 @@ export default class ReportItems extends Component {
let
body
=
{
let
body
=
{
item_report
:
payload
item_report
:
payload
}
}
console
.
log
(
JSON
.
stringify
(
body
))
// console.log(JSON.stringify(body))
this
.
setState
({
payload
:
body
,
buttonError
:
false
})
console
.
log
(
resp
.
rows
[
1
])
this
.
setState
({
payload
:
body
,
buttonError
:
false
,
judul
:
resp
.
rows
[
1
][
0
]
})
api
.
create
().
checkUploadReportItems
(
body
).
then
(
response
=>
{
api
.
create
().
checkUploadReportItems
(
body
).
then
(
response
=>
{
console
.
log
(
response
)
console
.
log
(
response
)
let
dataRow
=
[]
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
"success"
)
{
if
(
response
.
data
.
status
===
"success"
)
{
let
dataRow
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
dataRow
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
return
[
return
[
index
+
1
,
index
+
1
,
item
.
report
,
item
.
report
,
...
@@ -463,7 +465,9 @@ export default class ReportItems extends Component {
...
@@ -463,7 +465,9 @@ export default class ReportItems extends Component {
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
this
.
setState
({
dataLoaded
:
false
,
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
}
console
.
log
(
response
);
console
.
log
(
response
);
})
})
...
@@ -993,7 +997,8 @@ export default class ReportItems extends Component {
...
@@ -993,7 +997,8 @@ export default class ReportItems extends Component {
<
/button
>
<
/button
>
<
button
<
button
type
=
"button"
type
=
"button"
onClick
=
{()
=>
this
.
state
.
buttonError
?
this
.
setState
({
popupError
:
true
})
:
this
.
uploadReportItems
()}
disabled
=
{
this
.
state
.
buttonError
==
true
?
true
:
false
}
onClick
=
{()
=>
this
.
uploadReportItems
()}
style
=
{{}}
style
=
{{}}
>
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
...
@@ -1050,7 +1055,12 @@ export default class ReportItems extends Component {
...
@@ -1050,7 +1055,12 @@ export default class ReportItems extends Component {
this
.
fileHandler
(
dt
)
this
.
fileHandler
(
dt
)
this
.
setState
({
uploadStatus
:
'idle'
,
percentage
:
'0'
})
this
.
setState
({
uploadStatus
:
'idle'
,
percentage
:
'0'
})
}}
}}
onUpload
=
{()
=>
this
.
setState
({
visibleUpload
:
false
,
itemReport
:
false
})}
onUpload
=
{()
=>
{
this
.
state
.
judul
===
"MASTER DATA - REPORT ITEMS"
?
this
.
setState
({
visibleUpload
:
false
,
itemReport
:
false
})
:
this
.
setState
({
alert
:
true
,
messageAlert
:
"Invalid Template"
,
tipeAlert
:
'warning'
})
}}
/
>
/
>
<
/div
>
<
/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