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
550e0882
Commit
550e0882
authored
Oct 13, 2020
by
d.arizona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lebih baik kita usai disini
parent
574b28ed
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
399 additions
and
51 deletions
+399
-51
CorporateAnnualTarget.js
src/container/BudgetTahunan/CorporateAnnualTarget.js
+64
-11
OperatingIndicatorDetail.js
src/container/OprIndicator/OperatingIndicatorDetail.js
+335
-40
No files found.
src/container/BudgetTahunan/CorporateAnnualTarget.js
View file @
550e0882
...
@@ -78,7 +78,9 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -78,7 +78,9 @@ export default class CorporateAnnualTarget extends Component {
buttonDraft
:
true
,
buttonDraft
:
true
,
updateBy
:
''
,
updateBy
:
''
,
handleTekTekTek
:
0
,
handleTekTekTek
:
0
,
editable
:
false
editable
:
false
,
dataCustomerPrs
:
[],
dataInternalBsn
:
[]
}
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
...
@@ -104,12 +106,35 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -104,12 +106,35 @@ export default class CorporateAnnualTarget extends Component {
// console.log(JSON.stringify(payload))
// console.log(JSON.stringify(payload))
api
.
create
().
getDetailReportMB
(
payload
).
then
(
response
=>
{
api
.
create
().
getDetailReportMB
(
payload
).
then
(
response
=>
{
let
dataTable
=
[]
let
dataTable
=
[]
let
dataCustomerPrs
=
[]
let
dataInternalBsn
=
[]
// console.log(response)
// console.log(response)
let
res
=
response
.
data
.
data
let
res
=
response
.
data
.
data
const
handlePushChild
=
(
item
)
=>
{
const
handlePushChild
=
(
item
)
=>
{
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
let
indexIDzz
=
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
===
item
.
id
)
if
(
indexIDzz
===
-
1
)
{
if
(
indexIDzz
===
-
1
)
{
let
parentTrue
=
item
.
parent_name
==
'INTERNAL BUSINESS PROCESS PERSPECTIVE'
||
item
.
parent_name
==
'CUSTOMER PERSPECTIVE'
let
parentTrue
=
item
.
parent_name
==
'INTERNAL BUSINESS PROCESS PERSPECTIVE'
||
item
.
parent_name
==
'CUSTOMER PERSPECTIVE'
if
(
item
.
parent_name
==
'INTERNAL BUSINESS PROCESS PERSPECTIVE'
)
{
if
(
item
.
type_report_id
!==
4
)
{
dataInternalBsn
.
push
({
id
:
item
.
id
,
name
:
item
.
description
,
check
:
false
})
}
}
if
(
item
.
parent_name
==
'CUSTOMER PERSPECTIVE'
)
{
if
(
item
.
type_report_id
!==
4
)
{
dataCustomerPrs
.
push
({
id
:
item
.
id
,
name
:
item
.
description
,
check
:
false
})
}
}
dataTable
.
push
([
dataTable
.
push
([
item
.
type_report_id
,
item
.
type_report_id
,
item
.
id
,
item
.
id
,
...
@@ -192,7 +217,9 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -192,7 +217,9 @@ export default class CorporateAnnualTarget extends Component {
}
}
}
}
})
})
this
.
setState
({
dataTable
,
loading
:
false
,
dataReal
:
res
,
editable
:
true
})
this
.
setState
({
dataTable
,
loading
:
false
,
dataReal
:
res
,
editable
:
true
,
dataCustomerPrs
,
dataInternalBsn
},
()
=>
{
console
.
log
(
dataCustomerPrs
)
})
})
})
}
}
...
@@ -325,13 +352,37 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -325,13 +352,37 @@ export default class CorporateAnnualTarget extends Component {
console
.
log
(
JSON
.
stringify
(
this
.
state
.
payload
))
console
.
log
(
JSON
.
stringify
(
this
.
state
.
payload
))
api
.
create
().
checkUploadMB
(
this
.
state
.
payload
).
then
(
response
=>
{
api
.
create
().
checkUploadMB
(
this
.
state
.
payload
).
then
(
response
=>
{
// // console.log(JSON.stringify(this.state.payload));
// // console.log(JSON.stringify(this.state.payload));
//
console.log(response)
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
// this.setState({ visibleUpload: false, visibleCAT: false })
// this.setState({ visibleUpload: false, visibleCAT: false })
this
.
setState
({
visibleUpload
:
false
,
visibleCAT
:
false
})
this
.
setState
({
visibleUpload
:
false
,
visibleCAT
:
false
})
let
dataTable
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
let
dataTable
=
[]
return
[
let
custoId
=
0
let
bisnsId
=
0
let
dataDelete
=
this
.
state
.
dataDelete
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
if
(
item
.
item_report
==
'CUSTOMER PERSPECTIVE'
)
{
custoId
=
item
.
item_report_id
}
if
(
item
.
item_report
==
'INTERNAL BUSINESS PROCESS PERSPECTIVE'
)
{
bisnsId
=
item
.
item_report_id
}
if
(
item
.
type_report_id
!==
4
&&
item
.
parent
!==
null
&&
(
item
.
parent
==
custoId
||
item
.
parent
==
bisnsId
))
{
let
indexCust
=
this
.
state
.
dataCustomerPrs
.
findIndex
((
val
)
=>
val
.
name
==
item
.
item_report
)
let
indexBisn
=
this
.
state
.
dataInternalBsn
.
findIndex
((
val
)
=>
val
.
name
==
item
.
item_report
)
if
(
indexCust
!==
-
1
&&
item
.
item_report_id
==
0
)
{
dataDelete
.
push
(
this
.
state
.
dataCustomerPrs
[
indexCust
].
id
)
}
if
(
indexBisn
!==
-
1
&&
item
.
item_report_id
==
0
)
{
dataDelete
.
push
(
this
.
state
.
dataInternalBsn
[
indexBisn
].
id
)
}
}
dataTable
.
push
([
item
.
type_report_id
,
item
.
type_report_id
,
item
.
item_report_id
,
item
.
item_report_id
,
item
.
parent
,
item
.
parent
,
...
@@ -363,11 +414,11 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -363,11 +414,11 @@ export default class CorporateAnnualTarget extends Component {
item
.
strategic
,
item
.
strategic
,
item
.
pic
,
item
.
pic
,
item
.
error
item
.
error
]
]
)
})
})
//
console.log(dataTable)
console
.
log
(
dataTable
)
// console.log(this.state.buttonError)
// console.log(this.state.buttonError)
this
.
setState
({
dataTable
,
dataLoaded
:
true
,
loading
:
false
,
buttonError
:
false
,
editable
:
true
},
()
=>
{
this
.
setState
({
dataTable
,
dataLoaded
:
true
,
loading
:
false
,
buttonError
:
false
,
editable
:
true
,
dataDelete
},
()
=>
{
this
.
state
.
dataTable
.
map
(
item
=>
{
this
.
state
.
dataTable
.
map
(
item
=>
{
if
(
item
[
30
].
length
>
0
)
{
if
(
item
[
30
].
length
>
0
)
{
// console.log('masuk')
// console.log('masuk')
...
@@ -382,8 +433,9 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -382,8 +433,9 @@ export default class CorporateAnnualTarget extends Component {
}
}
uploadCAT
(
type
)
{
uploadCAT
(
type
)
{
// let dataDelete = this.state.dataDelete
// console.log(dataDelete)
let
payload
=
{
"item_report_id"
:
this
.
state
.
dataDelete
}
let
payload
=
{
"item_report_id"
:
this
.
state
.
dataDelete
}
if
(
this
.
state
.
dataDelete
.
length
>
0
)
{
if
(
this
.
state
.
dataDelete
.
length
>
0
)
{
api
.
create
().
deleteAllItemReport
(
payload
).
then
((
response
)
=>
{
api
.
create
().
deleteAllItemReport
(
payload
).
then
((
response
)
=>
{
this
.
functionUpload
(
type
)
this
.
functionUpload
(
type
)
...
@@ -436,7 +488,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -436,7 +488,7 @@ export default class CorporateAnnualTarget extends Component {
"cat"
:
data
"cat"
:
data
}
}
// console.log(data);
// console.log(data);
//
console.log(JSON.stringify(body))
console
.
log
(
JSON
.
stringify
(
body
))
api
.
create
(
'UPLOAD'
).
uploadMasterBudget
(
body
).
then
(
response
=>
{
api
.
create
(
'UPLOAD'
).
uploadMasterBudget
(
body
).
then
(
response
=>
{
// console.log(response);
// console.log(response);
if
(
response
.
data
)
{
if
(
response
.
data
)
{
...
@@ -888,7 +940,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -888,7 +940,7 @@ export default class CorporateAnnualTarget extends Component {
}
}
const
handleTambah
=
(
data
,
rowIndex
)
=>
{
const
handleTambah
=
(
data
,
rowIndex
)
=>
{
//
console.log(dataTable2)
console
.
log
(
dataTable2
)
let
newData
=
[]
let
newData
=
[]
dataTable2
.
map
((
item
,
index
)
=>
{
dataTable2
.
map
((
item
,
index
)
=>
{
newData
.
push
(
item
)
newData
.
push
(
item
)
...
@@ -932,6 +984,7 @@ export default class CorporateAnnualTarget extends Component {
...
@@ -932,6 +984,7 @@ export default class CorporateAnnualTarget extends Component {
this
.
setState
({
dataTable
:
dataTable2
},
()
=>
{
this
.
setState
({
dataTable
:
dataTable2
},
()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
setState
({
loading
:
false
})
this
.
setState
({
loading
:
false
})
console
.
log
(
dataTable2
)
},
500
)
},
500
)
})
})
}
}
...
...
src/container/OprIndicator/OperatingIndicatorDetail.js
View file @
550e0882
This diff is collapsed.
Click to expand it.
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