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
db36515e
Commit
db36515e
authored
Mar 26, 2021
by
faisalhamdi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit cat!
parent
a296332d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
7 deletions
+39
-7
index.js
src/api/index.js
+4
-2
EditMasterDataCAT.js
src/container/MasterData/MasterDataCAT/EditMasterDataCAT.js
+5
-4
MasterDataCAT.js
src/container/MasterData/MasterDataCAT/MasterDataCAT.js
+30
-1
No files found.
src/api/index.js
View file @
db36515e
...
...
@@ -189,8 +189,9 @@ const create = (type = "") => {
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
saveMasterDataCat
=
(
body
)
=>
api
.
post
(
'item_report_company/create_item_report_company'
,
body
)
const
getDetailMasterDataCat
=
(
idCompany
,
years
)
=>
api
.
get
(
`item_report_company/get_item_report_company_by_companyid_years/
${
idCompany
}
/
${
years
}
`
)
const
deleteMasterDataCat
=
(
idCompany
,
years
)
=>
api
.
get
(
`item_report_company/delete_item_report_company/
${
idCompany
}
/
${
years
}
`
)
const
getDetailMasterDataCat
=
(
idCompany
,
years
)
=>
api
.
get
(
`item_report_company/get_item_report_company_by_company_id_years/
${
idCompany
}
/
${
years
}
`
)
const
deleteMasterDataCat
=
(
idCompany
,
years
)
=>
api
.
post
(
`item_report_company/delete_item_report_company/
${
idCompany
}
/
${
years
}
`
)
const
updateMasterDataCat
=
(
body
)
=>
api
.
post
(
'item_report_company/update_item_report_company'
,
body
)
//Transaction
const
getReportTypeBody
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/get_all_report'
,
body
)
...
...
@@ -746,6 +747,7 @@ const create = (type = "") => {
getAllMasterDataCat
,
getParentItemReport
,
saveMasterDataCat
,
updateMasterDataCat
,
getDetailMasterDataCat
,
deleteMasterDataCat
,
getListChildDashboardCAT
,
...
...
src/container/MasterData/MasterDataCAT/EditMasterDataCAT.js
View file @
db36515e
...
...
@@ -144,7 +144,7 @@ export default class EditMasterDataCAT extends Component {
// console.log(this.props.data)
// console.log(this.state.latestPeriode)
// console.log(periodeData)
console
.
log
(
index
)
//
console.log(index)
this
.
setState
({
listPeriode
:
defaultProps
,
periode
:
index
===
-
1
?
periodeData
[
0
]
:
periodeData
[
index
],
loading
:
false
})
}
}
...
...
@@ -218,6 +218,7 @@ export default class EditMasterDataCAT extends Component {
console
.
log
(
simpan
)
let
payload
=
{
"company_id"
:
this
.
state
.
company
.
company_id
,
"company_old"
:
this
.
props
.
data
[
8
],
"years"
:
this
.
state
.
periode
.
periode
,
"detail"
:
simpan
}
...
...
@@ -381,8 +382,8 @@ export default class EditMasterDataCAT extends Component {
<
Autocomplete
{...
this
.
state
.
listCompany
}
id
=
"company"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
_name
:
newInputValue
},
()
=>
this
.
getParent
(),
this
.
clearMessage
())}
d
ebug
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
},
()
=>
this
.
getParentIR
(),
this
.
clearMessage
())}
d
isableClearable
style
=
{{
width
:
250
}}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
...
...
@@ -410,7 +411,7 @@ export default class EditMasterDataCAT extends Component {
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
periode
:
newInputValue
,
loading
:
true
,
previewTable
:
false
},
()
=>
{
this
.
getParentIR
()
})}
d
ebug
d
isableClearable
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Year"
...
...
src/container/MasterData/MasterDataCAT/MasterDataCAT.js
View file @
db36515e
...
...
@@ -749,6 +749,35 @@ export default class MasterDataCAT extends Component {
})
}
updateReportItems
=
(
payload
)
=>
{
this
.
setState
({
add
:
false
,
edit
:
false
})
api
.
create
().
updateMasterDataCat
(
payload
).
then
(
response
=>
{
console
.
log
(
payload
);
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
==
'success'
)
{
this
.
getData
()
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
})
}
downloadFile
=
async
()
=>
{
let
res
=
await
fetch
(
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/attachment/download_file?fileName=ItemReportTemplate&&fileType=xlsx`
...
...
@@ -1141,7 +1170,7 @@ export default class MasterDataCAT extends Component {
onClickClose
=
{()
=>
this
.
setState
({
edit
:
false
})}
data
=
{
this
.
state
.
rowData
}
refresh
=
{
this
.
getData
.
bind
(
this
)}
updateReportItems
=
{
this
.
cre
ateReportItems
.
bind
(
this
)}
updateReportItems
=
{
this
.
upd
ateReportItems
.
bind
(
this
)}
/
>
)}
{
this
.
state
.
popupError
&&
(
...
...
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