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
4226d84b
Commit
4226d84b
authored
Aug 27, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update api budgetTahunan
parent
98f0a777
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
97 additions
and
44 deletions
+97
-44
index.js
src/api/index.js
+3
-1
BudgetTahunan.js
src/container/BudgetTahunan.js
+78
-27
AddUser.js
src/container/Otorisasi/User/AddUser.js
+5
-5
EditUser.js
src/container/Otorisasi/User/EditUser.js
+5
-5
AddRole.js
src/container/Otorisasi/UserRole/AddRole.js
+3
-3
EditRole.js
src/container/Otorisasi/UserRole/EditRole.js
+3
-3
No files found.
src/api/index.js
View file @
4226d84b
...
...
@@ -133,7 +133,6 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const
getReportItems
=
()
=>
api
.
get
(
'item_report/get_all_item_report'
)
const
getInputType
=
()
=>
api
.
get
(
'type_item_report/get_all_type_item_report'
)
const
getReportType
=
()
=>
api
.
get
(
'report/get_all_report'
)
const
getReportTypeBody
=
(
body
)
=>
api
.
post
(
'report/get_all_report'
,
body
)
const
getDetailReportItems
=
(
userId
)
=>
api
.
get
(
`item_report/get_item_report_by_id/
${
userId
}
`
)
const
searchReportItems
=
(
body
)
=>
api
.
post
(
'/item_report/search_item_report'
,
body
)
const
createReportItems
=
(
body
)
=>
api
.
post
(
'/item_report/create_item_report'
,
body
)
...
...
@@ -155,6 +154,9 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const
uploadParameter
=
(
body
)
=>
api
.
post
(
'/setting/import_setting'
,
body
)
const
searchParameter
=
(
body
)
=>
api
.
post
(
'setting/search_setting'
,
body
)
//Transaction
const
getReportTypeBody
=
(
body
)
=>
api
.
post
(
'transaction/get_all_report'
,
body
)
//Template
const
downloadTemplate
=
(
fileName
,
fileType
)
=>
api
.
get
(
`attachment/download_file?fileName=
${
fileName
}
&&fileType=
${
fileType
}
`
)
...
...
src/container/BudgetTahunan.js
View file @
4226d84b
import
React
,
{
Component
}
from
'react'
;
import
{
Typography
,
Paper
,
TextField
,
MenuItem
}
from
'@material-ui/core'
;
import
{
Typography
,
Paper
,
TextField
,
MenuItem
,
Select
,
FormControlLabel
}
from
'@material-ui/core'
;
import
MUIDataTable
from
'mui-datatables'
;
import
Images
from
'../assets/Images'
;
import
BalanceSheet
from
'./BudgetTahunan/BalanceSheet'
;
...
...
@@ -15,7 +15,7 @@ export default class BudgetTahunan extends Component {
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
periode
:
'202
0
'
,
periode
:
'202
1
'
,
perusahaan
:
'TAP Group'
,
revisi
:
'0'
,
visibleBudgetTahunan
:
true
,
...
...
@@ -40,17 +40,21 @@ export default class BudgetTahunan extends Component {
"report_type"
:
"Master Budget"
,
}
api
.
create
().
getReportTypeBody
(
payload
).
then
(
response
=>
{
// console.log(response);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
let
dataTable
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
return
[
i
ndex
+
1
,
i
tem
.
number
,
item
.
report_name
,
""
,
item
.
report_id
2
,
item
.
current_status
,
item
.
report_id
,
item
.
is_can_upload
,
2
]
})
console
.
log
(
dataTable
);
this
.
setState
({
dataTable
})
}
}
...
...
@@ -71,7 +75,7 @@ export default class BudgetTahunan extends Component {
options
:
companyData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
};
this
.
setState
({
listCompany
:
defaultProps
,
company
:
companyData
[
0
]
},
()
=>
this
.
getReport
())
this
.
setState
({
listCompany
:
defaultProps
,
company
:
companyData
[
0
]
},
()
=>
this
.
getReport
())
}
else
{
alert
(
response
.
data
.
message
)
}
...
...
@@ -128,16 +132,54 @@ export default class BudgetTahunan extends Component {
}
}
handleChange
(
value
,
tableMeta
)
{
let
data
=
this
.
state
.
dataTable
data
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
value
}
render
()
{
const
columns
=
[
"#"
,
"Jenis Laporan"
,
{
name
:
"Revision"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
,
updateValue
)
=>
{
var
list
=
[];
for
(
var
i
=
0
;
i
<=
tableMeta
.
rowData
[
6
];
i
++
)
{
list
.
push
(
i
);
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
val
}
control
=
{
<
Select
value
=
{
val
}
onChange
=
{
event
=>
{
// console.log(event.target)
updateValue
(
event
.
target
.
value
)
this
.
handleChange
(
event
.
target
.
value
,
tableMeta
)
}}
autoWidth
>
{
list
.
map
((
item
,
index
)
=>
<
MenuItem
key
=
{
index
}
value
=
{
item
}
>
{
item
}
<
/MenuItem
>
)}
<
/Select
>
}
/
>
<
/div
>
);
}
}
},
{
name
:
"Status"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
val
===
"
acc
"
?
{
val
===
"
submitted"
||
val
===
"approved
"
?
<
img
src
=
{
Images
.
ceklis
}
style
=
{{
width
:
31
,
height
:
24
}}
/>
:
null
}
...
...
@@ -155,17 +197,25 @@ export default class BudgetTahunan extends Component {
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
cursor
:
tableMeta
.
rowData
[
5
]
?
'pointer'
:
null
,
borderColor
:
'transparent'
}}
onClick
=
{()
=>
this
.
clickDetail
(
tableMeta
.
rowData
[
1
],
tableMeta
.
rowData
[
3
])}
onClick
=
{()
=>
tableMeta
.
rowData
[
5
]
?
this
.
clickDetail
(
tableMeta
.
rowData
[
1
],
tableMeta
.
rowData
[
4
])
:
null
}
>
<
Typography
style
=
{{
color
:
'#5198ea
'
,
fontSize
:
12
,
}}
>
Detail
<
/Typography
>
<
Typography
style
=
{{
color
:
tableMeta
.
rowData
[
5
]
?
'#5198ea'
:
'GrayText
'
,
fontSize
:
12
,
}}
>
Detail
<
/Typography
>
<
/button
>
<
/div
>
);
}
}
},
{
name
:
""
,
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
display
:
false
}
}]
const
dataTable
=
[
[
"1"
,
"Balance Sheet"
,
"done"
],
...
...
@@ -197,6 +247,7 @@ export default class BudgetTahunan extends Component {
search
:
false
}
const
periode
=
[
{
value
:
'2021'
,
label
:
'2021'
},
{
value
:
'2020'
,
label
:
'2020'
},
{
value
:
'2019'
,
label
:
'2019'
},
{
value
:
'2018'
,
label
:
'2018'
},
...
...
@@ -247,7 +298,7 @@ export default class BudgetTahunan extends Component {
<
Autocomplete
{...
this
.
state
.
listCompany
}
id
=
"company"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
})}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
}
,
()
=>
this
.
getReport
()
)}
debug
disableClearable
style
=
{{
width
:
250
}}
...
...
@@ -313,14 +364,14 @@ export default class BudgetTahunan extends Component {
<
BalanceSheet
report_id
=
{
this
.
state
.
report_id
}
company
=
{
this
.
state
.
company
}
onClickClose
=
{()
=>
this
.
setState
({
visibleBS
:
false
,
visibleBudgetTahunan
:
true
})}
onClickClose
=
{()
=>
this
.
setState
({
visibleBS
:
false
,
visibleBudgetTahunan
:
true
})}
/
>
)}
{
this
.
state
.
visiblePL
&&
(
<
ProfitLoss
report_id
=
{
this
.
state
.
report_id
}
company
=
{
this
.
state
.
company
}
onClickClose
=
{()
=>
this
.
setState
({
visiblePL
:
false
,
visibleBudgetTahunan
:
true
})}
onClickClose
=
{()
=>
this
.
setState
({
visiblePL
:
false
,
visibleBudgetTahunan
:
true
})}
/
>
)}
...
...
src/container/Otorisasi/User/AddUser.js
View file @
4226d84b
...
...
@@ -158,17 +158,17 @@ export default class AddUser extends Component {
var
isEmail
=
this
.
isEmail
(
this
.
state
.
email
)
if
(
R
.
isEmpty
(
this
.
state
.
fullname
))
{
this
.
setState
({
errorFullname
:
true
,
msgErrorFN
:
'Fullname
is required
'
})
this
.
setState
({
errorFullname
:
true
,
msgErrorFN
:
'Fullname
Cannot be Empty
'
})
}
else
if
(
R
.
isEmpty
(
this
.
state
.
email
))
{
this
.
setState
({
errorEmail
:
true
,
msgErrorEM
:
'Email
is required
'
})
this
.
setState
({
errorEmail
:
true
,
msgErrorEM
:
'Email
Cannot be Empty
'
})
}
else
if
(
!
isEmail
)
{
this
.
setState
({
errorEmail
:
true
,
msgErrorEM
:
'Email format not recognized!'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
role
))
{
this
.
setState
({
errorRoleName
:
true
,
msgErrorRN
:
'Role name
is required
'
})
this
.
setState
({
errorRoleName
:
true
,
msgErrorRN
:
'Role name
Cannot be Empty
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
startDate
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorSD
:
'Start date
is required
'
})
this
.
setState
({
errorStartDate
:
true
,
msgErrorSD
:
'Start date
Cannot be Empty
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
endDate
))
{
this
.
setState
({
errorEndDate
:
true
,
msgErrorED
:
'End date
is required
'
})
this
.
setState
({
errorEndDate
:
true
,
msgErrorED
:
'End date
Cannot be Empty
'
})
}
// else if (this.state.privileges.length < 1) {
// alert('Hak Akses belum di pilih !!')
...
...
src/container/Otorisasi/User/EditUser.js
View file @
4226d84b
...
...
@@ -166,17 +166,17 @@ export default class EditUser extends Component {
// console.log(this.state.tempData)
if
(
R
.
isEmpty
(
this
.
state
.
tempData
.
fullname
))
{
this
.
setState
({
errorFullname
:
true
,
msgErrorFN
:
'Full Name
is Required
'
})
this
.
setState
({
errorFullname
:
true
,
msgErrorFN
:
'Full Name
Cannot be Empty
'
})
}
else
if
(
R
.
isEmpty
(
this
.
state
.
tempData
.
email
))
{
this
.
setState
({
errorEmail
:
true
,
msgErrorEM
:
'Email
is Required
'
})
this
.
setState
({
errorEmail
:
true
,
msgErrorEM
:
'Email
Cannot be Empty
'
})
}
else
if
(
!
isEmail
)
{
this
.
setState
({
errorEmail
:
true
,
msgErrorEM
:
'Email format not recognized!'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
role
))
{
this
.
setState
({
errorRoleName
:
true
,
msgErrorRN
:
'Role Name
is Required
'
})
this
.
setState
({
errorRoleName
:
true
,
msgErrorRN
:
'Role Name
Cannot be Empty
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
tempData
.
start_date
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorSD
:
'Start Date
is Required
'
})
this
.
setState
({
errorStartDate
:
true
,
msgErrorSD
:
'Start Date
Cannot be Empty
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
tempData
.
end_date
))
{
this
.
setState
({
errorEndDate
:
true
,
msgErrorED
:
'End Date
is Required
'
})
this
.
setState
({
errorEndDate
:
true
,
msgErrorED
:
'End Date
Cannot be Empty
'
})
}
// else if (this.state.privileges.length < 1) {
// alert('Hak Akses belum di pilih !!')
...
...
src/container/Otorisasi/UserRole/AddRole.js
View file @
4226d84b
...
...
@@ -110,11 +110,11 @@ export default class AddRole extends Component {
validasi
()
{
if
(
R
.
isEmpty
(
this
.
state
.
roleName
))
{
this
.
setState
({
errorRoleName
:
true
,
msgErrorRN
:
'Role name
is required
'
})
this
.
setState
({
errorRoleName
:
true
,
msgErrorRN
:
'Role name
Cannot be Empty
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
startDate
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorSD
:
'Start date
is required
'
})
this
.
setState
({
errorStartDate
:
true
,
msgErrorSD
:
'Start date
Cannot be Empty
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
endDate
))
{
this
.
setState
({
errorEndDate
:
true
,
msgErrorED
:
'End date
is required
'
})
this
.
setState
({
errorEndDate
:
true
,
msgErrorED
:
'End date
Cannot be Empty
'
})
}
else
if
(
this
.
state
.
privileges
.
length
<
1
)
{
this
.
setState
({
alert
:
true
,
messageAlert
:
'You must choose the Access Rights!!'
,
tipeAlert
:
'warning'
})
}
else
{
...
...
src/container/Otorisasi/UserRole/EditRole.js
View file @
4226d84b
...
...
@@ -116,11 +116,11 @@ export default class EditRole extends Component {
validasi
()
{
if
(
R
.
isEmpty
(
this
.
state
.
tempData
.
role_name
))
{
this
.
setState
({
errorRoleName
:
true
,
msgErrorRN
:
'Role name
is required
'
})
this
.
setState
({
errorRoleName
:
true
,
msgErrorRN
:
'Role name
Cannot be Empty
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
tempData
.
start_date
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorSD
:
'Start date
is required
'
})
this
.
setState
({
errorStartDate
:
true
,
msgErrorSD
:
'Start date
Cannot be Empty
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
tempData
.
end_date
))
{
this
.
setState
({
errorEndDate
:
true
,
msgErrorED
:
'End date
is required
'
})
this
.
setState
({
errorEndDate
:
true
,
msgErrorED
:
'End date
Cannot be Empty
'
})
}
else
if
(
this
.
state
.
privileges
.
length
<
1
)
{
this
.
setState
({
alert
:
true
,
messageAlert
:
'You must choose the Access Rights'
,
tipeAlert
:
'warning'
})
}
else
{
...
...
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