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
851b6cfb
Commit
851b6cfb
authored
Feb 24, 2021
by
rifkaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create & list master data cat
parent
6d12fce3
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
135 additions
and
578 deletions
+135
-578
index.js
src/api/index.js
+5
-1
CreateMasterDataCAT.js
...container/MasterData/MasterDataCAT/CreateMasterDataCAT.js
+116
-558
MasterDataCAT.js
src/container/MasterData/MasterDataCAT/MasterDataCAT.js
+14
-19
No files found.
src/api/index.js
View file @
851b6cfb
...
@@ -186,7 +186,9 @@ const create = (type = "") => {
...
@@ -186,7 +186,9 @@ const create = (type = "") => {
const
deleteParameter
=
(
id
)
=>
api
.
post
(
`setting/delete_setting/
${
id
}
`
)
const
deleteParameter
=
(
id
)
=>
api
.
post
(
`setting/delete_setting/
${
id
}
`
)
// MASTER DATA - CAT
// MASTER DATA - CAT
const
getAllMasterDataCat
=
()
=>
api
.
get
(
'item_report_company/get_all_item_report_company'
)
const
getParentItemReport
=
(
body
)
=>
api
.
post
(
'item_report/get_parent_item_report_default'
,
body
)
const
getParentItemReport
=
(
body
)
=>
api
.
post
(
'item_report/get_parent_item_report_default'
,
body
)
const
saveMasterDataCat
=
(
body
)
=>
api
.
post
(
'item_report_company/create_item_report_company'
,
body
)
//Transaction
//Transaction
const
getReportTypeBody
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/get_all_report'
,
body
)
const
getReportTypeBody
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/get_all_report'
,
body
)
...
@@ -687,7 +689,9 @@ const create = (type = "") => {
...
@@ -687,7 +689,9 @@ const create = (type = "") => {
getHierarkiCronJobMRRatio
,
getHierarkiCronJobMRRatio
,
getRollingOutlookID
,
getRollingOutlookID
,
getRollingOutlookBS
,
getRollingOutlookBS
,
getParentItemReport
getAllMasterDataCat
,
getParentItemReport
,
saveMasterDataCat
}
}
}
}
...
...
src/container/MasterData/MasterDataCAT/CreateMasterDataCAT.js
View file @
851b6cfb
This diff is collapsed.
Click to expand it.
src/container/MasterData/MasterDataCAT/MasterDataCAT.js
View file @
851b6cfb
...
@@ -594,8 +594,8 @@ export default class MasterDataCAT extends Component {
...
@@ -594,8 +594,8 @@ export default class MasterDataCAT extends Component {
getData
()
{
getData
()
{
this
.
setState
({
loading
:
true
})
this
.
setState
({
loading
:
true
})
api
.
create
().
get
ReportItems
().
then
((
response
)
=>
{
api
.
create
().
get
AllMasterDataCat
().
then
((
response
)
=>
{
//
console.log(response)
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
==
'success'
)
{
if
(
response
.
data
.
status
==
'success'
)
{
...
@@ -604,17 +604,11 @@ export default class MasterDataCAT extends Component {
...
@@ -604,17 +604,11 @@ export default class MasterDataCAT extends Component {
return
[
return
[
index
,
index
,
item
.
item_report_id
,
item
.
item_report_id
,
item
.
report_name
,
item
.
report_name
,
item
.
company_name
,
item
.
company_name
,
item
.
order
,
item
.
report_name
,
item
.
description
,
item
.
parent
!==
null
?
`
${
item
.
parent
}
-
${
item
.
parent_name
}
`
:
""
,
item
.
uom
,
item
.
weight
,
item
.
weight
,
item
.
type_item_report_name
,
item
.
years
,
item
.
kpi_type
,
item
.
max_ach
,
item
.
formula_ytd
,
item
.
status
]
item
.
status
]
})
})
this
.
setState
({
dataTable
:
listData
,
listData
:
response
.
data
.
data
},
()
=>
{
this
.
setState
({
dataTable
:
listData
,
listData
:
response
.
data
.
data
},
()
=>
{
...
@@ -622,6 +616,7 @@ export default class MasterDataCAT extends Component {
...
@@ -622,6 +616,7 @@ export default class MasterDataCAT extends Component {
this
.
setState
({
loading
:
false
})
this
.
setState
({
loading
:
false
})
},
2000
);
},
2000
);
})
})
console
.
log
(
this
.
state
.
dataTable
)
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
...
@@ -724,7 +719,7 @@ export default class MasterDataCAT extends Component {
...
@@ -724,7 +719,7 @@ export default class MasterDataCAT extends Component {
createReportItems
=
(
payload
)
=>
{
createReportItems
=
(
payload
)
=>
{
this
.
setState
({
add
:
false
})
this
.
setState
({
add
:
false
})
api
.
create
().
createReportItems
(
payload
).
then
(
response
=>
{
api
.
create
().
saveMasterDataCat
(
payload
).
then
(
response
=>
{
// console.log(response);
// console.log(response);
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
ok
)
{
...
@@ -896,7 +891,7 @@ export default class MasterDataCAT extends Component {
...
@@ -896,7 +891,7 @@ export default class MasterDataCAT extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
13
]
===
"Active"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
7
]
===
"Active"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
/div
>
<
/div
>
);
);
}
}
...
@@ -908,7 +903,7 @@ export default class MasterDataCAT extends Component {
...
@@ -908,7 +903,7 @@ export default class MasterDataCAT extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
13
]
===
"Active"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
7
]
===
"Active"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
/div
>
<
/div
>
);
);
}
}
...
@@ -920,7 +915,7 @@ export default class MasterDataCAT extends Component {
...
@@ -920,7 +915,7 @@ export default class MasterDataCAT extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
13
]
===
"Active"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
7
]
===
"Active"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
/div
>
<
/div
>
);
);
}
}
...
@@ -932,7 +927,7 @@ export default class MasterDataCAT extends Component {
...
@@ -932,7 +927,7 @@ export default class MasterDataCAT extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
13
]
===
"Active"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
7
]
===
"Active"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
/div
>
<
/div
>
);
);
}
}
...
@@ -944,7 +939,7 @@ export default class MasterDataCAT extends Component {
...
@@ -944,7 +939,7 @@ export default class MasterDataCAT extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
13
]
===
"Active"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
7
]
===
"Active"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
/div
>
<
/div
>
);
);
}
}
...
@@ -956,7 +951,7 @@ export default class MasterDataCAT extends Component {
...
@@ -956,7 +951,7 @@ export default class MasterDataCAT extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
13
]
===
"Active"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
7
]
===
"Active"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
/div
>
<
/div
>
);
);
}
}
...
@@ -968,7 +963,7 @@ export default class MasterDataCAT extends Component {
...
@@ -968,7 +963,7 @@ export default class MasterDataCAT extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
13
]
===
"Active"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
7
]
===
"Active"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
/div
>
<
/div
>
);
);
}
}
...
...
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