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
790477db
Commit
790477db
authored
Sep 08, 2020
by
EKSAD
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upload lagi
parent
1af5e764
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
13 deletions
+21
-13
ReportItems.js
src/container/MasterData/ReportItems.js
+21
-13
No files found.
src/container/MasterData/ReportItems.js
View file @
790477db
...
@@ -47,7 +47,8 @@ export default class ReportItems extends Component {
...
@@ -47,7 +47,8 @@ export default class ReportItems extends Component {
load
:
false
,
load
:
false
,
judul
:
''
,
judul
:
''
,
reportNameDelete
:
''
,
reportNameDelete
:
''
,
visibleDelete
:
false
visibleDelete
:
false
,
invalidTemplate
:
false
}
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
...
@@ -67,11 +68,11 @@ export default class ReportItems extends Component {
...
@@ -67,11 +68,11 @@ export default class ReportItems extends Component {
if
(
item
.
length
>
0
)
{
if
(
item
.
length
>
0
)
{
payload
.
push
({
payload
.
push
({
id
:
index
+
1
,
id
:
index
+
1
,
report
_type
:
item
[
0
]
===
undefined
?
""
:
item
[
0
],
report
:
item
[
0
]
===
undefined
?
""
:
item
[
0
],
company
:
item
[
1
]
===
undefined
?
""
:
item
[
1
],
company
:
item
[
1
]
===
undefined
?
""
:
item
[
1
],
orders
:
item
[
2
]
===
undefined
?
null
:
item
[
2
],
orders
:
item
[
2
]
===
undefined
?
""
:
item
[
2
],
description
:
item
[
3
]
===
undefined
?
""
:
item
[
3
],
description
:
item
[
3
]
===
undefined
?
""
:
item
[
3
],
parent
:
item
[
4
]
===
undefined
?
null
:
item
[
4
],
parent
:
item
[
4
]
===
undefined
?
0
:
item
[
4
],
uom
:
item
[
5
]
===
undefined
?
""
:
item
[
5
],
uom
:
item
[
5
]
===
undefined
?
""
:
item
[
5
],
weight
:
item
[
6
]
===
undefined
?
""
:
item
[
6
],
weight
:
item
[
6
]
===
undefined
?
""
:
item
[
6
],
type_report
:
item
[
7
]
===
undefined
?
""
:
item
[
7
],
type_report
:
item
[
7
]
===
undefined
?
""
:
item
[
7
],
...
@@ -89,6 +90,13 @@ export default class ReportItems extends Component {
...
@@ -89,6 +90,13 @@ export default class ReportItems extends Component {
let
body
=
{
let
body
=
{
item_report
:
payload
item_report
:
payload
}
}
if
(
resp
.
rows
[
2
].
length
!==
16
)
{
this
.
setState
({
invalidTemplate
:
true
})
}
else
{
this
.
setState
({
invalidTemplate
:
false
})
}
console
.
log
(
resp
.
rows
[
1
])
console
.
log
(
resp
.
rows
[
1
])
this
.
setState
({
payload
:
body
,
buttonError
:
false
,
judul
:
resp
.
rows
[
1
][
0
]
})
this
.
setState
({
payload
:
body
,
buttonError
:
false
,
judul
:
resp
.
rows
[
1
][
0
]
})
}
}
...
@@ -104,7 +112,7 @@ export default class ReportItems extends Component {
...
@@ -104,7 +112,7 @@ export default class ReportItems extends Component {
if
(
response
.
data
.
status
===
"success"
)
{
if
(
response
.
data
.
status
===
"success"
)
{
dataRow
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
dataRow
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
return
[
return
[
item
.
report
_type
,
item
.
report
,
item
.
company
,
item
.
company
,
item
.
orders
,
item
.
orders
,
item
.
description
,
item
.
description
,
...
@@ -541,7 +549,7 @@ export default class ReportItems extends Component {
...
@@ -541,7 +549,7 @@ export default class ReportItems extends Component {
});
});
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"
Toke
n"
))
{
if
(
response
.
data
.
message
.
includes
(
"
Someone Logged I
n"
))
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
window
.
location
.
reload
();
...
@@ -601,7 +609,7 @@ export default class ReportItems extends Component {
...
@@ -601,7 +609,7 @@ export default class ReportItems extends Component {
})
})
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"
Toke
n"
))
{
if
(
response
.
data
.
message
.
includes
(
"
Someone Logged I
n"
))
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
window
.
location
.
reload
();
...
@@ -629,7 +637,7 @@ export default class ReportItems extends Component {
...
@@ -629,7 +637,7 @@ export default class ReportItems extends Component {
this
.
setState
({
visibleDelete
:
false
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
this
.
setState
({
visibleDelete
:
false
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"
Toke
n"
))
{
if
(
response
.
data
.
message
.
includes
(
"
Someone Logged I
n"
))
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
window
.
location
.
reload
();
...
@@ -682,7 +690,7 @@ export default class ReportItems extends Component {
...
@@ -682,7 +690,7 @@ export default class ReportItems extends Component {
this
.
setState
({
dataTable
:
listData
,
listData
:
response
.
data
.
data
})
this
.
setState
({
dataTable
:
listData
,
listData
:
response
.
data
.
data
})
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"
Toke
n"
))
{
if
(
response
.
data
.
message
.
includes
(
"
Someone Logged I
n"
))
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
window
.
location
.
reload
();
...
@@ -709,7 +717,7 @@ export default class ReportItems extends Component {
...
@@ -709,7 +717,7 @@ export default class ReportItems extends Component {
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"
Toke
n"
))
{
if
(
response
.
data
.
message
.
includes
(
"
Someone Logged I
n"
))
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
window
.
location
.
reload
();
...
@@ -766,7 +774,7 @@ export default class ReportItems extends Component {
...
@@ -766,7 +774,7 @@ export default class ReportItems extends Component {
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"
Toke
n"
))
{
if
(
response
.
data
.
message
.
includes
(
"
Someone Logged I
n"
))
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
window
.
location
.
reload
();
...
@@ -793,7 +801,7 @@ export default class ReportItems extends Component {
...
@@ -793,7 +801,7 @@ export default class ReportItems extends Component {
this
.
setState
({
itemReport
:
true
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
this
.
setState
({
itemReport
:
true
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"
Toke
n"
))
{
if
(
response
.
data
.
message
.
includes
(
"
Someone Logged I
n"
))
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
window
.
location
.
reload
();
...
@@ -1195,7 +1203,7 @@ export default class ReportItems extends Component {
...
@@ -1195,7 +1203,7 @@ export default class ReportItems extends Component {
this
.
setState
({
uploadStatus
:
'idle'
,
percentage
:
'0'
})
this
.
setState
({
uploadStatus
:
'idle'
,
percentage
:
'0'
})
}}
}}
onUpload
=
{()
=>
{
onUpload
=
{()
=>
{
this
.
state
.
judul
===
"MASTER DATA - REPORT ITEMS"
?
this
.
state
.
judul
===
"MASTER DATA - REPORT ITEMS"
&&
!
this
.
state
.
invalidTemplate
?
this
.
checkUpload
()
:
this
.
checkUpload
()
:
this
.
setState
({
alert
:
true
,
messageAlert
:
"Invalid Template"
,
tipeAlert
:
'warning'
})
this
.
setState
({
alert
:
true
,
messageAlert
:
"Invalid Template"
,
tipeAlert
:
'warning'
})
}}
}}
...
...
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