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
66f78845
Commit
66f78845
authored
Aug 17, 2020
by
d.arizona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apdet ngantuk
parent
8115bdd0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
50 deletions
+65
-50
index.js
src/api/index.js
+3
-1
ReportItems.js
src/container/MasterData/ReportItems.js
+1
-1
CreateReportItems.js
...container/MasterData/formReportItems/CreateReportItems.js
+28
-21
EditReportItems.js
src/container/MasterData/formReportItems/EditReportItems.js
+33
-27
No files found.
src/api/index.js
View file @
66f78845
...
...
@@ -128,6 +128,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const
uploadReportItems
=
(
body
)
=>
api
.
post
(
'/item_report/import_item_report'
,
body
)
const
getItemReportHierarki
=
(
body
)
=>
api
.
post
(
'item_report/get_item_report_hierarki'
,
body
)
const
saveVisualisasiReport
=
(
body
)
=>
api
.
post
(
'item_report/save_visualization'
,
body
)
const
getReportParent
=
(
body
)
=>
api
.
post
(
'item_report/get_parent_item_report'
,
body
)
//PARAMETER
const
getAllParameter
=
()
=>
api
.
get
(
'/setting/get_all_setting'
)
...
...
@@ -216,7 +217,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
getItemReportHierarki
,
getMenuByRole
,
saveVisualisasiReport
,
saveVisualisasiPerusahaan
saveVisualisasiPerusahaan
,
getReportParent
}
}
...
...
src/container/MasterData/ReportItems.js
View file @
66f78845
...
...
@@ -452,7 +452,7 @@ export default class ReportItems extends Component {
console
.
log
(
response
)
if
(
response
.
data
.
status
==
'success'
)
{
let
data
=
response
.
data
.
data
let
listData
=
data
.
map
((
item
,
index
)
=>
{
let
listData
=
data
.
sort
((
a
,
b
)
=>
a
.
item_report_id
-
b
.
item_report_id
).
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
})
...
...
src/container/MasterData/formReportItems/CreateReportItems.js
View file @
66f78845
...
...
@@ -53,7 +53,7 @@ export default class CreateReportItems extends Component {
this
.
getInputType
()
this
.
getPerusahaan
()
this
.
getReportType
()
this
.
getParent
()
//
this.getParent()
}
...
...
@@ -169,7 +169,7 @@ export default class CreateReportItems extends Component {
getInputType
()
{
api
.
create
().
getInputType
().
then
((
response
)
=>
{
// console.log(response
)
console
.
log
(
response
.
data
)
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
inputData
=
data
.
map
((
item
)
=>
{
...
...
@@ -234,25 +234,31 @@ export default class CreateReportItems extends Component {
}
getParent
()
{
api
.
create
().
getReportItems
().
then
((
response
)
=>
{
// console.log(response)
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
parentData
=
data
.
map
((
item
)
=>
{
return
{
item_report_id
:
item
.
item_report_id
,
report_name
:
item
.
report_name
}
})
let
defaultProps
=
{
options
:
parentData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
report_name
),
};
this
.
setState
({
listParent
:
defaultProps
,
parentData
:
response
.
data
.
data
})
}
else
{
alert
(
response
.
data
.
message
)
if
(
this
.
state
.
reportType
!==
null
&&
this
.
state
.
company
!==
null
)
{
let
payload
=
{
"report_id"
:
this
.
state
.
reportType
.
report_id
,
"company_id"
:
this
.
state
.
company
.
company_id
}
})
api
.
create
().
getReportParent
(
payload
).
then
((
response
)
=>
{
console
.
log
(
response
)
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
parentData
=
data
.
map
((
item
)
=>
{
return
{
item_report_id
:
item
.
item_report_id
,
description
:
item
.
description
}
})
let
defaultProps
=
{
options
:
parentData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
description
),
};
this
.
setState
({
listParent
:
defaultProps
,
parentData
:
response
.
data
.
data
})
}
else
{
alert
(
response
.
data
.
message
)
}
})
}
}
handleDate
(
item
)
{
...
...
@@ -314,7 +320,7 @@ export default class CreateReportItems extends Component {
<
Autocomplete
{...
this
.
state
.
listCompany
}
id
=
"company"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
})}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
}
,
()
=>
this
.
getParent
()
)}
debug
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
...
...
@@ -570,6 +576,7 @@ export default class CreateReportItems extends Component {
id
=
"parentId"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
parent
:
newInputValue
})}
debug
disabled
=
{
this
.
state
.
reportType
==
null
||
this
.
state
.
company
==
null
}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Parent ID"
...
...
src/container/MasterData/formReportItems/EditReportItems.js
View file @
66f78845
...
...
@@ -145,13 +145,13 @@ export default class EditReportItems extends Component {
updateReportItems
()
{
// alert('test')
let
payload
=
{
"item_report_id"
:
this
.
state
.
parent
.
item_report_id
,
"report_id"
:
this
.
state
.
reportType
.
report_id
,
"company_id"
:
this
.
state
.
company
.
company_id
,
"item_report_id"
:
this
.
state
.
tempData
.
item_report_id
,
"report_id"
:
this
.
state
.
reportType
==
null
?
this
.
state
.
tempData
.
report_id
:
this
.
state
.
reportType
.
report_id
,
"company_id"
:
this
.
state
.
company
==
null
?
this
.
state
.
tempData
.
company_id
:
this
.
state
.
company
.
company_id
,
"description"
:
this
.
state
.
tempData
.
description
,
"orders"
:
this
.
state
.
tempData
.
order
,
"parent"
:
this
.
state
.
tempData
.
parent
,
"type_report_id"
:
this
.
state
.
InputType
.
type_report_id
,
"parent"
:
this
.
state
.
parent
==
null
?
this
.
state
.
tempData
.
parent
:
this
.
state
.
parent
.
item_report_id
,
"type_report_id"
:
this
.
state
.
InputType
==
null
?
this
.
state
.
tempData
.
type_report_id
:
this
.
state
.
InputType
.
type_report_id
,
"formula"
:
this
.
state
.
tempData
.
formula
,
"uom"
:
this
.
state
.
tempData
.
uom
,
"weight"
:
this
.
state
.
tempData
.
weight
,
...
...
@@ -259,27 +259,32 @@ export default class EditReportItems extends Component {
}
getParent
()
{
api
.
create
().
getReportItems
().
then
((
response
)
=>
{
// console.log(response)
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
parentData
=
data
.
map
((
item
)
=>
{
return
{
item_report_id
:
item
.
item_report_id
,
report_name
:
item
.
report_name
}
})
let
defaultProps
=
{
options
:
parentData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
report_name
),
};
let
index
=
parentData
.
findIndex
((
val
)
=>
val
.
item_report_id
===
this
.
state
.
tempData
.
item_report_id
)
this
.
setState
({
listParent
:
defaultProps
,
parent
:
index
===
-
1
?
null
:
parentData
[
index
]})
}
else
{
alert
(
response
.
data
.
message
)
if
(
this
.
state
.
reportType
!==
null
&&
this
.
state
.
company
!==
null
)
{
let
payload
=
{
"report_id"
:
this
.
state
.
reportType
.
report_id
,
"company_id"
:
this
.
state
.
company
.
company_id
}
})
api
.
create
().
getReportParent
(
payload
).
then
((
response
)
=>
{
console
.
log
(
response
)
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
parentData
=
data
.
map
((
item
)
=>
{
return
{
item_report_id
:
item
.
item_report_id
,
description
:
item
.
description
}
})
let
defaultProps
=
{
options
:
parentData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
description
),
};
let
index
=
parentData
.
findIndex
((
val
)
=>
val
.
item_report_id
===
this
.
state
.
tempData
.
parent
)
this
.
setState
({
listParent
:
defaultProps
,
parent
:
index
==
-
1
?
null
:
parentData
[
index
]})
}
else
{
alert
(
response
.
data
.
message
)
}
})
}
}
render
()
{
...
...
@@ -338,7 +343,7 @@ export default class EditReportItems extends Component {
<
Autocomplete
{...
this
.
state
.
listCompany
}
id
=
"company"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
})}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
}
,
()
=>
this
.
getParent
()
)}
debug
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
...
...
@@ -515,7 +520,7 @@ export default class EditReportItems extends Component {
<
Autocomplete
{...
this
.
state
.
listReportType
}
id
=
"reportType"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
reportType
:
newInputValue
})}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
reportType
:
newInputValue
}
,
()
=>
this
.
getParent
()
)}
debug
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
...
...
@@ -566,6 +571,7 @@ export default class EditReportItems extends Component {
{...
this
.
state
.
listParent
}
id
=
"parentId"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
parent
:
newInputValue
})}
disabled
=
{
this
.
state
.
reportType
==
null
||
this
.
state
.
company
==
null
}
debug
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
...
...
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