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
afd29f8c
Commit
afd29f8c
authored
Mar 26, 2021
by
Riri Novita
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://103.44.149.204/d.arizona/tia-dev
into riri
parents
0ed3fc88
43c8fd04
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
88 additions
and
32 deletions
+88
-32
index.js
src/api/index.js
+4
-2
HomePage.js
src/container/HomePage.js
+23
-8
CreateMasterDataCAT.js
...container/MasterData/MasterDataCAT/CreateMasterDataCAT.js
+3
-3
EditMasterDataCAT.js
src/container/MasterData/MasterDataCAT/EditMasterDataCAT.js
+5
-4
MasterDataCAT.js
src/container/MasterData/MasterDataCAT/MasterDataCAT.js
+30
-1
OutlookPA.js
src/container/OutlookPA.js
+8
-4
RollingOutlook.js
src/container/RollingOutlook.js
+15
-10
No files found.
src/api/index.js
View file @
afd29f8c
...
...
@@ -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/HomePage.js
View file @
afd29f8c
...
...
@@ -562,13 +562,16 @@ class HomePage extends Component {
let
data
=
response
.
data
.
data
data
.
map
((
item
,
index
)
=>
{
let
statusConvert
=
item
.
status
==
'approval_review'
?
'Waiting For Review'
:
item
.
status
==
'approval_proccess'
?
'Waiting For Approval'
:
titleCase
(
item
.
status
)
if
(
this
.
state
.
isApproverMB
&&
this
.
state
.
isApproverMR
)
{
if
(
this
.
state
.
isApproverMB
&&
this
.
state
.
isApproverMR
&&
this
.
state
.
isApproverRO
&&
this
.
state
.
isApproverOL
)
{
if
(
String
(
item
.
type_report
).
toLocaleLowerCase
().
includes
(
"master"
))
{
listDashboard
.
push
([
index
+
1
,
item
.
approval_id
,
item
.
company_name
,
`
${
item
.
type_report
}
-
${
item
.
periode
}
`
,
item
.
revision
,
item
.
status
,
statusConvert
])
rawData
.
push
(
item
)
}
else
if
(
String
(
item
.
type_report
).
toLocaleLowerCase
().
includes
(
"monthly"
))
{
listDashboard
.
push
([
index
+
1
,
item
.
approval_id
,
item
.
company_name
,
`
${
item
.
type_report
}
${
item
.
periode
}
`
,
item
.
revision
,
item
.
status
,
statusConvert
])
rawData
.
push
(
item
)
}
else
if
(
String
(
item
.
type_report
).
toLocaleLowerCase
().
includes
(
"outlook"
))
{
listDashboard
.
push
([
index
+
1
,
item
.
approval_id
,
item
.
company_name
,
`
${
item
.
type_report
}
${
item
.
periode
}
`
,
item
.
revision
,
item
.
status
,
statusConvert
])
rawData
.
push
(
item
)
}
}
else
if
(
this
.
state
.
isApproverMB
)
{
if
(
String
(
item
.
type_report
).
toLocaleLowerCase
().
includes
(
"master"
))
{
...
...
@@ -580,6 +583,11 @@ class HomePage extends Component {
listDashboard
.
push
([
index
+
1
,
item
.
approval_id
,
item
.
company_name
,
`
${
item
.
type_report
}
${
item
.
periode
}
`
,
item
.
revision
,
item
.
status
,
statusConvert
])
rawData
.
push
(
item
)
}
}
else
if
(
this
.
state
.
isApproverRO
||
this
.
state
.
isApproverOL
)
{
if
(
String
(
item
.
type_report
).
toLocaleLowerCase
().
includes
(
"outlook"
))
{
listDashboard
.
push
([
index
+
1
,
item
.
approval_id
,
item
.
company_name
,
`
${
item
.
type_report
}
${
item
.
periode
}
`
,
item
.
revision
,
item
.
status
,
statusConvert
])
rawData
.
push
(
item
)
}
}
})
this
.
setState
({
listDashboard
,
rawData
})
...
...
@@ -591,8 +599,10 @@ class HomePage extends Component {
this
.
setState
({
loading
:
true
})
let
isApproverMR
=
false
let
isApproverMB
=
false
let
isApproverRO
=
false
let
isApproverOL
=
false
api
.
create
().
getAM
().
then
((
response
)
=>
{
//
console.log(response);
console
.
log
(
response
);
let
actAMActive
=
[]
let
actAM
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
if
(
String
(
item
.
status
).
toLocaleLowerCase
()
==
'active'
)
{
...
...
@@ -608,6 +618,10 @@ class HomePage extends Component {
isApproverMR
=
true
}
else
if
(
item
.
approval_type_name
===
"MASTER_BUDGET"
)
{
isApproverMB
=
true
}
else
if
(
item
.
approval_type_name
===
"ROLLING_OUTLOOK"
)
{
isApproverRO
=
true
}
else
if
(
item
.
approval_type_name
===
"OUTLOOK_PA"
)
{
isApproverOL
=
true
}
})
...
...
@@ -616,7 +630,7 @@ class HomePage extends Component {
this
.
getMonth
()
// this.getListUserSubco()
}
this
.
setState
({
isApproverMB
,
isApproverMR
})
this
.
setState
({
isApproverMB
,
isApproverMR
,
isApproverRO
,
isApproverOL
})
this
.
getDashboardMB
()
// this.getDashboardMB()
this
.
getDashboard
()
...
...
@@ -707,14 +721,16 @@ class HomePage extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
// console.log(tableMeta);
// console.log(this.state.rawData);
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
Link
to
=
{{
pathname
:
String
(
tableMeta
.
rowData
[
3
]).
toLocaleLowerCase
().
includes
(
"master"
)
?
`/home/master-budget/`
:
`/home/monthly-report
/`
,
pathname
:
String
(
tableMeta
.
rowData
[
3
]).
toLocaleLowerCase
().
includes
(
"master"
)
?
`/home/master-budget/`
:
String
(
tableMeta
.
rowData
[
3
]).
toLocaleLowerCase
().
includes
(
"monthly"
)
?
`/home/monthly-report/`
:
String
(
tableMeta
.
rowData
[
3
]).
toLocaleLowerCase
().
includes
(
"rolling"
)
?
`/home/rolling-outlook/`
:
`/home/outlook-performance
/`
,
state
:
{
userType
:
'approver'
,
rawData
:
this
.
state
.
rawData
[
tableMeta
.
rowIndex
],
month
:
String
(
tableMeta
.
rowData
[
3
]).
toLocaleLowerCase
().
includes
(
"master"
)
?
null
:
getDataMonth
(
this
.
state
.
rawData
[
tableMeta
.
rowIndex
])
month
:
String
(
tableMeta
.
rowData
[
3
]).
toLocaleLowerCase
().
includes
(
"master"
)
?
null
:
getDataMonth
(
this
.
state
.
rawData
[
tableMeta
.
rowIndex
]),
quartal
:
String
(
tableMeta
.
rowData
[
3
]).
toLocaleLowerCase
().
includes
(
"rolling"
)
?
this
.
state
.
quarter
.
value
:
null
}
}}
>
<
button
...
...
@@ -1200,7 +1216,7 @@ class HomePage extends Component {
</div>
</div>
}
<div style={{ display: '
inline
-
flex
'
}}>
<div style={{ display: '
flex
', overflowX: '
scroll
', width: this.props.width * 0.95
}}>
{this.state.accessMB &&
<div style={{ flex: 1, padding: 20, width: '
100
%
' }}>
<div style={{ display: '
flex
' }}>
...
...
@@ -1385,8 +1401,7 @@ class HomePage extends Component {
pathname: `/home/rolling-outlook/`,
state: {
userType: '
user
',
rawData: item,
quarter: this.state.quarter
rawData: {...item, quarter: this.state.quarter.value},
}
}}>
<button
...
...
src/container/MasterData/MasterDataCAT/CreateMasterDataCAT.js
View file @
afd29f8c
...
...
@@ -24,7 +24,7 @@ export default class CreateMasterDataCAT extends Component {
tipeAlert
:
''
,
messageAlert
:
''
,
listPeriode
:
null
,
//
periode: null,
periode
:
null
,
errorWeight
:
false
,
msgErrorWeight
:
''
,
getParent
:
[]
...
...
@@ -264,7 +264,7 @@ export default class CreateMasterDataCAT extends Component {
id
=
"company"
disabled
=
{
this
.
state
.
intent
===
'Home'
?
true
:
false
}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
,
loading
:
true
,
previewTable
:
false
},
()
=>
{
this
.
get
ReportType
()
this
.
get
ParentIR
()
})}
disableClearable
style
=
{{
width
:
250
}}
...
...
@@ -294,7 +294,7 @@ export default class CreateMasterDataCAT 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/EditMasterDataCAT.js
View file @
afd29f8c
...
...
@@ -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 @
afd29f8c
...
...
@@ -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
&&
(
...
...
src/container/OutlookPA.js
View file @
afd29f8c
...
...
@@ -72,8 +72,8 @@ export default class OutlookPA extends Component {
this
.
setState
({
loading
:
true
})
this
.
props
.
selectIndex
(
'Outlook Performance Appraisal'
)
if
(
this
.
props
.
location
.
state
!==
undefined
)
{
//
console.log(this.props);
this
.
setState
({
userType
:
this
.
props
.
location
.
state
.
userType
,
intent
:
'Home'
,
lastPeriod
:
this
.
props
.
location
.
state
.
rawData
.
periode
,
rawData
:
this
.
props
.
location
.
state
.
rawData
},
()
=>
{
console
.
log
(
this
.
props
);
this
.
setState
({
userType
:
this
.
props
.
location
.
state
.
userType
,
intent
:
'Home'
,
lastPeriod
Props
:
this
.
props
.
location
.
state
.
rawData
.
periode
,
rawData
:
this
.
props
.
location
.
state
.
rawData
},
()
=>
{
this
.
checkApprover
()
})
}
else
{
...
...
@@ -118,7 +118,11 @@ export default class OutlookPA extends Component {
options
:
companyData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
};
this
.
setState
({
listCompany
:
defaultProps
,
company
:
companyData
[
0
]
},
()
=>
{
let
indexID
=
null
if
(
this
.
state
.
rawData
!==
undefined
)
{
indexID
=
companyData
.
findIndex
((
val
)
=>
val
.
company_id
==
this
.
state
.
rawData
.
company_id
)
}
this
.
setState
({
listCompany
:
defaultProps
,
company
:
indexID
==
null
?
companyData
[
0
]
:
companyData
[
indexID
]
},
()
=>
{
// // console.log(response.data.data);
if
(
response
.
data
.
data
.
length
>
0
)
{
this
.
getRevision
()
...
...
@@ -329,7 +333,7 @@ export default class OutlookPA extends Component {
options
:
periodeData
,
getOptionLabel
:
(
option
)
=>
option
.
periode
,
};
let
periode
=
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
Number
(
this
.
state
.
lastPeriod
)
)
let
periode
=
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
this
.
state
.
lastPeriodProps
==
undefined
?
Number
(
this
.
state
.
lastPeriod
)
:
this
.
state
.
lastPeriodProps
)
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
==
periode
)
// console.log(data)
// console.log(this.state.lastPeriod)
...
...
src/container/RollingOutlook.js
View file @
afd29f8c
...
...
@@ -85,14 +85,14 @@ export default class RollingOutlook extends Component {
componentDidMount
()
{
this
.
setState
({
loading
:
true
})
this
.
props
.
selectIndex
(
'Rolling Outlook & CAT'
)
// if (this.props.location.state !== undefined) {
// console.log(this.props);
// this.setState({ userType: this.props.location.state.userType, intent: 'Home', lastPeriod: this.props.location.state.rawData.periode, rawData: this.props.location.state.rawData }, () => {
// this.checkApprover()
// })
// } else {
if
(
this
.
props
.
location
.
state
!==
undefined
)
{
console
.
log
(
this
.
props
);
this
.
setState
({
userType
:
this
.
props
.
location
.
state
.
userType
,
intent
:
'Home'
,
lastPeriod
:
this
.
props
.
location
.
state
.
rawData
.
periode
,
rawData
:
this
.
props
.
location
.
state
.
rawData
},
()
=>
{
this
.
getPermission
()
// }
})
}
else
{
this
.
getPermission
()
}
}
getPermission
()
{
...
...
@@ -452,7 +452,8 @@ export default class RollingOutlook extends Component {
let
yearNow
=
dateNow
.
getFullYear
()
// let indexMonthMR = MR.findIndex((val) => val.value == yearNow)
// console.log(yearNow)
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
==
yearNow
)
// let index = data.sort((a, b) => a - b).findIndex((val) => val == yearNow)
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
===
periode
)
// console.log(data)
// console.log(this.state.lastPeriod)
// console.log(periodeData)
...
...
@@ -461,7 +462,11 @@ export default class RollingOutlook extends Component {
options
:
this
.
state
.
quarterList
,
getOptionLabel
:
(
option
)
=>
option
.
name
}
this
.
setState
({
listPeriode
:
defaultProps
,
listQuarter
:
defaultPropsQuarter
,
quarter
:
this
.
state
.
quarterList
[
0
],
periode
:
index
===
-
1
?
periodeData
[
0
]
:
periodeData
[
index
]
},
()
=>
{
let
indexID
=
null
if
(
this
.
state
.
rawData
!==
undefined
)
{
indexID
=
this
.
state
.
quarterList
.
findIndex
((
val
)
=>
String
(
val
.
value
).
toLocaleLowerCase
()
==
this
.
state
.
rawData
.
quarter
)
}
this
.
setState
({
listPeriode
:
defaultProps
,
listQuarter
:
defaultPropsQuarter
,
quarter
:
indexID
==
null
?
this
.
state
.
quarterList
[
0
]
:
this
.
state
.
quarterList
[
indexID
],
periode
:
index
===
-
1
?
periodeData
[
0
]
:
periodeData
[
index
]
},
()
=>
{
// if (this.state.isApprover === true && this.state.submittedOnly) {
this
.
getDetailUser
()
// this.getCompanySubmitted()
...
...
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