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/') =>
...
@@ -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
checkUploadUser
=
(
body
)
=>
api
.
post
(
'/user/check_import'
,
body
)
const
uploadUser
=
(
body
)
=>
api
.
post
(
'/user/import_user'
,
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
//Template
const
downloadTemplate
=
(
fileName
,
fileType
)
=>
api
.
get
(
`attachment/download_file?fileName=
${
fileName
}
&&fileType=
${
fileType
}
`
)
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/') =>
...
@@ -167,7 +171,9 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
changePassword
,
changePassword
,
getPerusahaanHierarki
,
getPerusahaanHierarki
,
checkUploadUser
,
checkUploadUser
,
uploadUser
uploadUser
,
getReportItems
,
searchReportItems
}
}
}
}
...
...
src/container/MasterData/ReportItems.js
View file @
a89c3ee9
import
React
,
{
Component
}
from
"react"
;
import
React
,
{
Component
}
from
"react"
;
import
{
Container
,
Row
,
Col
}
from
"react-bootstrap"
;
import
{
createMuiTheme
,
MuiThemeProvider
}
from
'@material-ui/core/styles'
;
import
{
makeStyles
,
createMuiTheme
,
MuiThemeProvider
}
from
'@material-ui/core/styles'
;
import
SearchIcon
from
'@material-ui/icons/Search'
;
import
Images
from
"../../assets/Images"
;
import
Images
from
"../../assets/Images"
;
import
MUIDataTable
from
"mui-datatables"
;
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
{
ExcelRenderer
}
from
'react-excel-renderer'
;
import
UploadFile
from
"../../library/Upload"
;
import
UploadFile
from
"../../library/Upload"
;
import
CreateReportItems
from
"./formReportItems/CreateReportItems"
;
import
CreateReportItems
from
"./formReportItems/CreateReportItems"
;
import
EditReportItems
from
"./formReportItems/EditReportItems"
;
import
EditReportItems
from
"./formReportItems/EditReportItems"
;
import
VisualReportItems
from
"./formReportItems/VisualReportItems"
;
import
VisualReportItems
from
"./formReportItems/VisualReportItems"
;
import
api
from
"../../api"
;
var
ct
=
require
(
"../../library/CustomTable"
);
var
ct
=
require
(
"../../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
...
@@ -40,17 +39,10 @@ export default class ReportItems extends Component {
...
@@ -40,17 +39,10 @@ export default class ReportItems extends Component {
let
fileObj
=
event
let
fileObj
=
event
ExcelRenderer
(
fileObj
,
(
err
,
resp
)
=>
{
ExcelRenderer
(
fileObj
,
(
err
,
resp
)
=>
{
if
(
err
)
{
if
(
err
)
{
// console.log(err);
}
}
else
{
else
{
let
judul
=
resp
.
rows
[
0
]
let
judul
=
resp
.
rows
[
0
]
let
isi
=
resp
.
rows
.
slice
(
1
)
let
isi
=
resp
.
rows
.
slice
(
1
)
// let body = isi.map((item) => {
// return {
// item
// ]
// })
// console.log(JSON.stringify(isi));
this
.
setState
({
this
.
setState
({
dataLoaded
:
true
,
dataLoaded
:
true
,
cols
:
judul
,
cols
:
judul
,
...
@@ -60,12 +52,24 @@ export default class ReportItems extends Component {
...
@@ -60,12 +52,24 @@ export default class ReportItems extends Component {
});
});
}
}
closeEdit
()
{
componentDidMount
()
{
this
.
setState
({
edit
:
false
})
this
.
getData
()
console
.
log
(
this
.
props
.
height
)
}
}
closeAdd
()
{
getData
()
{
this
.
setState
({
add
:
false
})
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
()
{
render
()
{
...
@@ -238,13 +242,13 @@ export default class ReportItems extends Component {
...
@@ -238,13 +242,13 @@ export default class ReportItems extends Component {
}
}
{
this
.
state
.
add
&&
(
{
this
.
state
.
add
&&
(
<
CreateReportItems
<
CreateReportItems
onClickClose
=
{
this
.
closeAdd
.
bind
(
this
)}
onClickClose
=
{
()
=>
this
.
setState
({
add
:
false
}
)}
data
=
{
this
.
state
.
indexData
}
data
=
{
this
.
state
.
indexData
}
/
>
/
>
)}
)}
{
this
.
state
.
edit
&&
(
{
this
.
state
.
edit
&&
(
<
EditReportItems
<
EditReportItems
onClickClose
=
{
this
.
closeEdit
.
bind
(
this
)}
onClickClose
=
{
()
=>
this
.
setState
({
edit
:
false
}
)}
data
=
{
this
.
state
.
indexData
}
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