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
Show 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/') =>
...
@@ -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
uploadReportItems
=
(
body
)
=>
api
.
post
(
'/item_report/import_item_report'
,
body
)
const
getItemReportHierarki
=
(
body
)
=>
api
.
post
(
'item_report/get_item_report_hierarki'
,
body
)
const
getItemReportHierarki
=
(
body
)
=>
api
.
post
(
'item_report/get_item_report_hierarki'
,
body
)
const
saveVisualisasiReport
=
(
body
)
=>
api
.
post
(
'item_report/save_visualization'
,
body
)
const
saveVisualisasiReport
=
(
body
)
=>
api
.
post
(
'item_report/save_visualization'
,
body
)
const
getReportParent
=
(
body
)
=>
api
.
post
(
'item_report/get_parent_item_report'
,
body
)
//PARAMETER
//PARAMETER
const
getAllParameter
=
()
=>
api
.
get
(
'/setting/get_all_setting'
)
const
getAllParameter
=
()
=>
api
.
get
(
'/setting/get_all_setting'
)
...
@@ -216,7 +217,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
...
@@ -216,7 +217,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
getItemReportHierarki
,
getItemReportHierarki
,
getMenuByRole
,
getMenuByRole
,
saveVisualisasiReport
,
saveVisualisasiReport
,
saveVisualisasiPerusahaan
saveVisualisasiPerusahaan
,
getReportParent
}
}
}
}
...
...
src/container/MasterData/ReportItems.js
View file @
66f78845
...
@@ -452,7 +452,7 @@ export default class ReportItems extends Component {
...
@@ -452,7 +452,7 @@ export default class ReportItems extends Component {
console
.
log
(
response
)
console
.
log
(
response
)
if
(
response
.
data
.
status
==
'success'
)
{
if
(
response
.
data
.
status
==
'success'
)
{
let
data
=
response
.
data
.
data
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
]
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
})
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 {
...
@@ -53,7 +53,7 @@ export default class CreateReportItems extends Component {
this
.
getInputType
()
this
.
getInputType
()
this
.
getPerusahaan
()
this
.
getPerusahaan
()
this
.
getReportType
()
this
.
getReportType
()
this
.
getParent
()
//
this.getParent()
}
}
...
@@ -169,7 +169,7 @@ export default class CreateReportItems extends Component {
...
@@ -169,7 +169,7 @@ export default class CreateReportItems extends Component {
getInputType
()
{
getInputType
()
{
api
.
create
().
getInputType
().
then
((
response
)
=>
{
api
.
create
().
getInputType
().
then
((
response
)
=>
{
// console.log(response
)
console
.
log
(
response
.
data
)
if
(
response
.
data
.
status
===
'success'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
data
=
response
.
data
.
data
let
inputData
=
data
.
map
((
item
)
=>
{
let
inputData
=
data
.
map
((
item
)
=>
{
...
@@ -234,19 +234,24 @@ export default class CreateReportItems extends Component {
...
@@ -234,19 +234,24 @@ export default class CreateReportItems extends Component {
}
}
getParent
()
{
getParent
()
{
api
.
create
().
getReportItems
().
then
((
response
)
=>
{
if
(
this
.
state
.
reportType
!==
null
&&
this
.
state
.
company
!==
null
)
{
// console.log(response)
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'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
data
=
response
.
data
.
data
let
parentData
=
data
.
map
((
item
)
=>
{
let
parentData
=
data
.
map
((
item
)
=>
{
return
{
return
{
item_report_id
:
item
.
item_report_id
,
item_report_id
:
item
.
item_report_id
,
report_name
:
item
.
report_name
description
:
item
.
description
}
}
})
})
let
defaultProps
=
{
let
defaultProps
=
{
options
:
parentData
,
options
:
parentData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
report_name
),
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
description
),
};
};
this
.
setState
({
listParent
:
defaultProps
,
parentData
:
response
.
data
.
data
})
this
.
setState
({
listParent
:
defaultProps
,
parentData
:
response
.
data
.
data
})
}
else
{
}
else
{
...
@@ -254,6 +259,7 @@ export default class CreateReportItems extends Component {
...
@@ -254,6 +259,7 @@ export default class CreateReportItems extends Component {
}
}
})
})
}
}
}
handleDate
(
item
)
{
handleDate
(
item
)
{
let
value
=
format
(
item
,
'dd MMMM yyyy'
)
let
value
=
format
(
item
,
'dd MMMM yyyy'
)
...
@@ -314,7 +320,7 @@ export default class CreateReportItems extends Component {
...
@@ -314,7 +320,7 @@ export default class CreateReportItems extends Component {
<
Autocomplete
<
Autocomplete
{...
this
.
state
.
listCompany
}
{...
this
.
state
.
listCompany
}
id
=
"company"
id
=
"company"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
})}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
}
,
()
=>
this
.
getParent
()
)}
debug
debug
renderInput
=
{(
params
)
=>
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
<
TextField
{...
params
}
...
@@ -570,6 +576,7 @@ export default class CreateReportItems extends Component {
...
@@ -570,6 +576,7 @@ export default class CreateReportItems extends Component {
id
=
"parentId"
id
=
"parentId"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
parent
:
newInputValue
})}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
parent
:
newInputValue
})}
debug
debug
disabled
=
{
this
.
state
.
reportType
==
null
||
this
.
state
.
company
==
null
}
renderInput
=
{(
params
)
=>
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
<
TextField
{...
params
}
label
=
"Parent ID"
label
=
"Parent ID"
...
...
src/container/MasterData/formReportItems/EditReportItems.js
View file @
66f78845
...
@@ -145,13 +145,13 @@ export default class EditReportItems extends Component {
...
@@ -145,13 +145,13 @@ export default class EditReportItems extends Component {
updateReportItems
()
{
updateReportItems
()
{
// alert('test')
// alert('test')
let
payload
=
{
let
payload
=
{
"item_report_id"
:
this
.
state
.
parent
.
item_report_id
,
"item_report_id"
:
this
.
state
.
tempData
.
item_report_id
,
"report_id"
:
this
.
state
.
reportType
.
report_id
,
"report_id"
:
this
.
state
.
reportType
==
null
?
this
.
state
.
tempData
.
report_id
:
this
.
state
.
reportType
.
report_id
,
"company_id"
:
this
.
state
.
company
.
company_id
,
"company_id"
:
this
.
state
.
company
==
null
?
this
.
state
.
tempData
.
company_id
:
this
.
state
.
company
.
company_id
,
"description"
:
this
.
state
.
tempData
.
description
,
"description"
:
this
.
state
.
tempData
.
description
,
"orders"
:
this
.
state
.
tempData
.
order
,
"orders"
:
this
.
state
.
tempData
.
order
,
"parent"
:
this
.
state
.
tempData
.
parent
,
"parent"
:
this
.
state
.
parent
==
null
?
this
.
state
.
tempData
.
parent
:
this
.
state
.
parent
.
item_report_id
,
"type_report_id"
:
this
.
state
.
InputType
.
type_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
,
"formula"
:
this
.
state
.
tempData
.
formula
,
"uom"
:
this
.
state
.
tempData
.
uom
,
"uom"
:
this
.
state
.
tempData
.
uom
,
"weight"
:
this
.
state
.
tempData
.
weight
,
"weight"
:
this
.
state
.
tempData
.
weight
,
...
@@ -259,28 +259,33 @@ export default class EditReportItems extends Component {
...
@@ -259,28 +259,33 @@ export default class EditReportItems extends Component {
}
}
getParent
()
{
getParent
()
{
api
.
create
().
getReportItems
().
then
((
response
)
=>
{
if
(
this
.
state
.
reportType
!==
null
&&
this
.
state
.
company
!==
null
)
{
// console.log(response)
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'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
data
=
response
.
data
.
data
let
parentData
=
data
.
map
((
item
)
=>
{
let
parentData
=
data
.
map
((
item
)
=>
{
return
{
return
{
item_report_id
:
item
.
item_report_id
,
item_report_id
:
item
.
item_report_id
,
report_name
:
item
.
report_name
description
:
item
.
description
}
}
})
})
let
defaultProps
=
{
let
defaultProps
=
{
options
:
parentData
,
options
:
parentData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
report_name
),
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
description
),
};
};
let
index
=
parentData
.
findIndex
((
val
)
=>
val
.
item_report_id
===
this
.
state
.
tempData
.
parent
)
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
]})
this
.
setState
({
listParent
:
defaultProps
,
parent
:
index
===
-
1
?
null
:
parentData
[
index
]})
}
else
{
}
else
{
alert
(
response
.
data
.
message
)
alert
(
response
.
data
.
message
)
}
}
})
})
}
}
}
render
()
{
render
()
{
const
{
startDate
,
endDate
}
=
this
.
state
;
const
{
startDate
,
endDate
}
=
this
.
state
;
...
@@ -338,7 +343,7 @@ export default class EditReportItems extends Component {
...
@@ -338,7 +343,7 @@ export default class EditReportItems extends Component {
<
Autocomplete
<
Autocomplete
{...
this
.
state
.
listCompany
}
{...
this
.
state
.
listCompany
}
id
=
"company"
id
=
"company"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
})}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
}
,
()
=>
this
.
getParent
()
)}
debug
debug
renderInput
=
{(
params
)
=>
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
<
TextField
{...
params
}
...
@@ -515,7 +520,7 @@ export default class EditReportItems extends Component {
...
@@ -515,7 +520,7 @@ export default class EditReportItems extends Component {
<
Autocomplete
<
Autocomplete
{...
this
.
state
.
listReportType
}
{...
this
.
state
.
listReportType
}
id
=
"reportType"
id
=
"reportType"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
reportType
:
newInputValue
})}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
reportType
:
newInputValue
}
,
()
=>
this
.
getParent
()
)}
debug
debug
renderInput
=
{(
params
)
=>
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
<
TextField
{...
params
}
...
@@ -566,6 +571,7 @@ export default class EditReportItems extends Component {
...
@@ -566,6 +571,7 @@ export default class EditReportItems extends Component {
{...
this
.
state
.
listParent
}
{...
this
.
state
.
listParent
}
id
=
"parentId"
id
=
"parentId"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
parent
:
newInputValue
})}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
parent
:
newInputValue
})}
disabled
=
{
this
.
state
.
reportType
==
null
||
this
.
state
.
company
==
null
}
debug
debug
renderInput
=
{(
params
)
=>
renderInput
=
{(
params
)
=>
<
TextField
{...
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