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
a89c3ee9
Commit
a89c3ee9
authored
Aug 16, 2020
by
EKSAD
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Item Laporan
parent
3ea10554
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
20 deletions
+30
-20
index.js
src/api/index.js
+8
-2
ReportItems.js
src/container/MasterData/ReportItems.js
+22
-18
No files found.
src/api/index.js
View file @
a89c3ee9
...
...
@@ -112,6 +112,10 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const
checkUploadUser
=
(
body
)
=>
api
.
post
(
'/user/check_import'
,
body
)
const
uploadUser
=
(
body
)
=>
api
.
post
(
'/user/import_user'
,
body
)
//Report Items
const
getReportItems
=
()
=>
api
.
get
(
'item_report/get_all_item_report'
)
const
searchReportItems
=
(
body
)
=>
api
.
post
(
'/item_report/search_item_report'
,
body
)
//Template
const
downloadTemplate
=
(
fileName
,
fileType
)
=>
api
.
get
(
`attachment/download_file?fileName=
${
fileName
}
&&fileType=
${
fileType
}
`
)
...
...
@@ -167,7 +171,9 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
changePassword
,
getPerusahaanHierarki
,
checkUploadUser
,
uploadUser
uploadUser
,
getReportItems
,
searchReportItems
}
}
...
...
src/container/MasterData/ReportItems.js
View file @
a89c3ee9
import
React
,
{
Component
}
from
"react"
;
import
{
Container
,
Row
,
Col
}
from
"react-bootstrap"
;
import
{
makeStyles
,
createMuiTheme
,
MuiThemeProvider
}
from
'@material-ui/core/styles'
;
import
SearchIcon
from
'@material-ui/icons/Search'
;
import
{
createMuiTheme
,
MuiThemeProvider
}
from
'@material-ui/core/styles'
;
import
Images
from
"../../assets/Images"
;
import
MUIDataTable
from
"mui-datatables"
;
import
{
TextField
,
InputBase
}
from
"@material-ui/core"
;
import
{
InputBase
}
from
"@material-ui/core"
;
import
{
ExcelRenderer
}
from
'react-excel-renderer'
;
import
UploadFile
from
"../../library/Upload"
;
import
CreateReportItems
from
"./formReportItems/CreateReportItems"
;
import
EditReportItems
from
"./formReportItems/EditReportItems"
;
import
VisualReportItems
from
"./formReportItems/VisualReportItems"
;
import
api
from
"../../api"
;
var
ct
=
require
(
"../../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
...
...
@@ -40,17 +39,10 @@ export default class ReportItems extends Component {
let
fileObj
=
event
ExcelRenderer
(
fileObj
,
(
err
,
resp
)
=>
{
if
(
err
)
{
// console.log(err);
}
else
{
let
judul
=
resp
.
rows
[
0
]
let
isi
=
resp
.
rows
.
slice
(
1
)
// let body = isi.map((item) => {
// return {
// item
// ]
// })
// console.log(JSON.stringify(isi));
this
.
setState
({
dataLoaded
:
true
,
cols
:
judul
,
...
...
@@ -60,12 +52,24 @@ export default class ReportItems extends Component {
});
}
closeEdit
()
{
this
.
setState
({
edit
:
false
})
componentDidMount
()
{
this
.
getData
()
console
.
log
(
this
.
props
.
height
)
}
closeAdd
()
{
this
.
setState
({
add
:
false
})
getData
()
{
api
.
create
().
getReportItems
().
then
((
response
)
=>
{
console
.
log
(
response
)
// if (response.data.status == 'success') {
// let data = response.data.data
// let listData = data.map((item, index) => {
// return [index, item.item_report_id, item.report_name, item.company_name, item.order, item.description, item.parent, item.uom, item.weight, item.type_report_name, item.status ]
// })
// this.setState({ dataTable: listData, listData: response.data.data })
// } else {
// alert(response.data.message)
// }
})
}
render
()
{
...
...
@@ -238,13 +242,13 @@ export default class ReportItems extends Component {
}
{
this
.
state
.
add
&&
(
<
CreateReportItems
onClickClose
=
{
this
.
closeAdd
.
bind
(
this
)}
onClickClose
=
{
()
=>
this
.
setState
({
add
:
false
}
)}
data
=
{
this
.
state
.
indexData
}
/
>
)}
{
this
.
state
.
edit
&&
(
<
EditReportItems
onClickClose
=
{
this
.
closeEdit
.
bind
(
this
)}
onClickClose
=
{
()
=>
this
.
setState
({
edit
:
false
}
)}
data
=
{
this
.
state
.
indexData
}
/
>
)}
...
...
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