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
d5e4ba43
Commit
d5e4ba43
authored
Oct 13, 2020
by
EKSAD
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
matiin console log
parent
cd5fe3ce
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
86 deletions
+86
-86
ProfitLoss.js
src/container/BudgetTahunan/ProfitLoss.js
+31
-31
OperatingIndicator.js
src/container/OprIndicator/OperatingIndicator.js
+18
-18
OutlookPA.js
src/container/OutlookPA.js
+37
-37
No files found.
src/container/BudgetTahunan/ProfitLoss.js
View file @
d5e4ba43
...
...
@@ -57,7 +57,7 @@ export default class ProfitLoss extends Component {
componentDidMount
()
{
this
.
getItemHierarki
()
this
.
getLatestUpdate
()
console
.
log
(
this
.
props
);
//
console.log(this.props);
}
getLatestUpdate
()
{
...
...
@@ -89,7 +89,7 @@ export default class ProfitLoss extends Component {
"submission_id"
:
this
.
props
.
submissionID
}
api
.
create
().
getDetailReportMB
(
payload
).
then
(
response
=>
{
console
.
log
(
response
);
//
console.log(response);
let
dataTable
=
[]
this
.
setState
({
visibleProfitLoss
:
true
})
if
(
response
.
data
)
{
...
...
@@ -167,7 +167,7 @@ export default class ProfitLoss extends Component {
}
}
})
console
.
log
(
dataTable
)
//
console.log(dataTable)
this
.
setState
({
dataTable
,
loading
:
false
,
buttonError
:
true
,
editable
:
true
})
}
else
{
this
.
setState
({
dataTable
,
loading
:
false
,
buttonError
:
true
,
editable
:
true
})
...
...
@@ -235,7 +235,7 @@ export default class ProfitLoss extends Component {
"status"
:
type
,
"profit_loss"
:
data
}
console
.
log
(
data
);
//
console.log(data);
this
.
setState
({
loading
:
false
})
this
.
props
.
saveToMasterBudget
(
payload
)
this
.
props
.
onClickClose
()
...
...
@@ -246,7 +246,7 @@ export default class ProfitLoss extends Component {
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/download_template?report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
`
)
res
=
await
res
.
blob
()
console
.
log
(
res
)
//
console.log(res)
if
(
res
.
size
>
0
)
{
let
url
=
window
.
URL
.
createObjectURL
(
res
);
let
a
=
document
.
createElement
(
'a'
);
...
...
@@ -261,11 +261,11 @@ export default class ProfitLoss extends Component {
ExcelRenderer
(
fileObj
,
(
err
,
resp
)
=>
{
// console.log(resp)
if
(
err
)
{
console
.
log
(
err
);
//
console.log(err);
}
else
{
let
isi
=
resp
.
rows
.
slice
(
3
)
console
.
log
(
resp
.
rows
[
2
]);
//
console.log(resp.rows[2]);
let
payload
=
[]
let
reg
=
/^
[
-+
]?(?:[
0-9
]
+,
)
*
[
0-9
]
+
(?:\.[
0-9
]
+
)?
$/
;
isi
.
map
((
i
,
index
)
=>
{
...
...
@@ -299,7 +299,7 @@ export default class ProfitLoss extends Component {
report_id
:
this
.
props
.
report_id
,
profit_loss
:
payload
}
console
.
log
(
body
)
//
console.log(body)
this
.
setState
({
payload
:
body
,
judul
:
resp
.
rows
[
1
][
0
],
judulColumn
:
resp
.
rows
[
2
]
})
}
});
...
...
@@ -308,7 +308,7 @@ export default class ProfitLoss extends Component {
checkUpload
()
{
api
.
create
().
checkUploadMB
(
this
.
state
.
payload
).
then
(
response
=>
{
// console.log(JSON.stringify(this.state.payload));
console
.
log
(
response
)
//
console.log(response)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
this
.
setState
({
visibleUpload
:
false
,
visibleProfitLoss
:
false
,
loading
:
true
})
...
...
@@ -344,7 +344,7 @@ export default class ProfitLoss extends Component {
this
.
setState
({
dataTable
,
dataLoaded
:
true
,
loading
:
false
,
buttonError
:
false
,
editable
:
true
},
()
=>
{
this
.
state
.
dataTable
.
map
(
item
=>
{
if
(
item
[
24
].
length
>
0
)
{
console
.
log
(
'masuk'
)
//
console.log('masuk')
this
.
setState
({
buttonError
:
true
,
errorPreview
:
true
,
editable
:
true
})
}
})
...
...
@@ -387,9 +387,9 @@ export default class ProfitLoss extends Component {
profit_loss
:
data
,
status
:
type
}
console
.
log
(
data
);
//
console.log(data);
api
.
create
(
'UPLOAD'
).
uploadMasterBudget
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
//
console.log(response);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
props
.
onClickClose
()
...
...
@@ -409,7 +409,7 @@ export default class ProfitLoss extends Component {
async
downloadAllData
()
{
let
url
=
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=
${
this
.
props
.
submissionID
}
&&report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&revision=
${
this
.
props
.
revision
}
`
let
sub_null
=
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=&&report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&revision=
${
this
.
props
.
revision
}
`
console
.
log
(
url
);
//
console.log(url);
let
res
=
await
fetch
(
this
.
props
.
submissionID
==
null
?
sub_null
:
url
)
...
...
@@ -457,9 +457,9 @@ export default class ProfitLoss extends Component {
"profit_loss"
:
data
,
"status"
:
"submitted"
}
console
.
log
(
payload
)
//
console.log(payload)
api
.
create
().
validateSubmitReport
(
payload
).
then
((
response
)
=>
{
console
.
log
(
response
)
//
console.log(response)
if
(
response
.
data
.
data
.
result
)
{
this
.
setState
({
loading
:
false
,
buttonError
:
false
,
editable
:
false
})
}
else
{
...
...
@@ -481,7 +481,7 @@ export default class ProfitLoss extends Component {
}
else
{
// let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[tableMeta.rowIndex][2])
// if (indexParent > 0) {
// // console.log(indexParent)
// //
//
console.log(indexParent)
// let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
// let jagain = dataTable2[indexParent][tableMeta.columnIndex]
// a = dataTable2[indexParent][tableMeta.columnIndex] = jagain == undefined ? (0 + Number(val)) : (Number(jagain) + Number(val))
...
...
@@ -515,9 +515,9 @@ export default class ProfitLoss extends Component {
// console.log(total);
}
const
handleNotes
=
(
value
,
tableMeta
)
=>
{
console
.
log
(
value
)
//
console.log(value)
let
a
=
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
value
console
.
log
(
dataTable2
[
tableMeta
.
rowIndex
]);
//
console.log(dataTable2[tableMeta.rowIndex]);
}
const
handleValue
=
(
data
)
=>
{
let
total
=
0
...
...
@@ -667,7 +667,7 @@ export default class ProfitLoss extends Component {
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleNotes
(
event
.
target
.
value
,
tableMeta
)
console
.
log
(
dataTable2
)
//
console.log(dataTable2)
}}
/
>
}
...
...
@@ -921,7 +921,7 @@ export default class ProfitLoss extends Component {
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
console
.
log
(
dataTable2
)
//
console.log(dataTable2)
}}
/
>
}
...
...
@@ -1011,7 +1011,7 @@ export default class ProfitLoss extends Component {
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
console
.
log
(
dataTable2
)
//
console.log(dataTable2)
}}
/
>
}
...
...
@@ -1101,7 +1101,7 @@ export default class ProfitLoss extends Component {
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
console
.
log
(
dataTable2
)
//
console.log(dataTable2)
}}
/
>
}
...
...
@@ -1191,7 +1191,7 @@ export default class ProfitLoss extends Component {
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
console
.
log
(
dataTable2
)
//
console.log(dataTable2)
}}
/
>
}
...
...
@@ -1281,7 +1281,7 @@ export default class ProfitLoss extends Component {
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
console
.
log
(
dataTable2
)
//
console.log(dataTable2)
}}
/
>
}
...
...
@@ -1371,7 +1371,7 @@ export default class ProfitLoss extends Component {
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
console
.
log
(
dataTable2
)
//
console.log(dataTable2)
}}
/
>
}
...
...
@@ -1461,7 +1461,7 @@ export default class ProfitLoss extends Component {
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
console
.
log
(
dataTable2
)
//
console.log(dataTable2)
}}
/
>
}
...
...
@@ -1551,7 +1551,7 @@ export default class ProfitLoss extends Component {
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
console
.
log
(
dataTable2
)
//
console.log(dataTable2)
}}
/
>
}
...
...
@@ -1641,7 +1641,7 @@ export default class ProfitLoss extends Component {
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
console
.
log
(
dataTable2
)
//
console.log(dataTable2)
}}
/
>
}
...
...
@@ -1731,7 +1731,7 @@ export default class ProfitLoss extends Component {
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
console
.
log
(
dataTable2
)
//
console.log(dataTable2)
}}
/
>
}
...
...
@@ -1868,7 +1868,7 @@ export default class ProfitLoss extends Component {
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
console
.
log
(
dataTable2
)
//
console.log(dataTable2)
}}
/
>
}
...
...
@@ -1958,7 +1958,7 @@ export default class ProfitLoss extends Component {
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
console
.
log
(
dataTable2
)
//
console.log(dataTable2)
}}
/
>
}
...
...
src/container/OprIndicator/OperatingIndicator.js
View file @
d5e4ba43
...
...
@@ -58,7 +58,7 @@ export default class OperatingIndicator extends Component {
menu
:
"operating indicator"
}
api
.
create
().
getPermission
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
//
console.log(response)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
...
...
@@ -76,7 +76,7 @@ export default class OperatingIndicator extends Component {
getLastPeriod
()
{
api
.
create
().
getLastPeriodOI
(
this
.
state
.
company
.
company_id
).
then
(
response
=>
{
console
.
log
(
response
);
//
console.log(response);
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
lastPeriod
:
response
.
data
.
data
.
last_periode
,
latestPeriode
:
response
.
data
.
data
.
latest_periode
},
()
=>
{
this
.
getPeriode
()
...
...
@@ -97,7 +97,7 @@ export default class OperatingIndicator extends Component {
this
.
setState
({
listAttachment
:
response
.
data
.
data
})
}
}
// console.log(response);
//
//
console.log(response);
})
}
...
...
@@ -108,7 +108,7 @@ export default class OperatingIndicator extends Component {
"report_type"
:
"operating indicator"
,
}
api
.
create
().
getAllOperatingInd
(
payload
).
then
(
response
=>
{
console
.
log
(
response
);
//
console.log(response);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
let
dataTable
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
...
...
@@ -120,7 +120,7 @@ export default class OperatingIndicator extends Component {
item
.
is_can_upload
]
})
// console.log(dataTable);
//
//
console.log(dataTable);
this
.
setState
({
dataTable
,
dataReport
:
response
.
data
.
data
})
}
}
...
...
@@ -220,17 +220,17 @@ export default class OperatingIndicator extends Component {
if
(
item
>=
2000
&&
item
<=
(
Number
(
currentYear
)
+
1
))
{
data
.
push
(
item
)
}
console
.
log
(
'bibim'
)
//
console.log('bibim')
}
else
{
if
((
item
>=
2000
)
&&
(
item
==
this
.
state
.
lastPeriod
||
item
<
this
.
state
.
lastPeriod
))
{
data
.
push
(
item
)
}
console
.
log
(
'bubum'
)
//
console.log('bubum')
}
})
console
.
log
(
this
.
state
.
lastPeriod
)
console
.
log
(
this
.
state
.
lastPeriod
)
console
.
log
(
this
.
state
.
isApprover
)
//
console.log(this.state.lastPeriod)
//
console.log(this.state.lastPeriod)
//
console.log(this.state.isApprover)
let
periodeData
=
data
.
map
((
item
)
=>
{
return
{
periode
:
item
,
...
...
@@ -240,7 +240,7 @@ export default class OperatingIndicator extends Component {
options
:
periodeData
,
getOptionLabel
:
(
option
)
=>
option
.
periode
,
};
console
.
log
(
defaultProps
)
//
console.log(defaultProps)
let
periode
=
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
this
.
state
.
lastPeriod
)
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
===
periode
)
this
.
setState
({
listPeriode
:
defaultProps
,
periode
:
index
==
-
1
?
periodeData
[
0
]
:
periodeData
[
index
]
},
()
=>
{
...
...
@@ -257,7 +257,7 @@ export default class OperatingIndicator extends Component {
"periode"
:
this
.
state
.
periode
.
periode
}
api
.
create
().
getRevision
(
payload
).
then
(
response
=>
{
console
.
log
(
response
);
//
console.log(response);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
let
data
=
response
.
data
.
data
...
...
@@ -286,7 +286,7 @@ export default class OperatingIndicator extends Component {
}
api
.
create
().
getOpetratingIndID
(
payload
).
then
(
response
=>
{
if
(
response
)
{
console
.
log
(
response
.
data
.
data
)
//
console.log(response.data.data)
this
.
getLatestPeriodSubmit
()
if
(
response
.
data
.
data
)
{
this
.
setState
({
operatingIndID
:
response
.
data
.
data
.
operating_indicator_id
})
...
...
@@ -303,7 +303,7 @@ export default class OperatingIndicator extends Component {
"periode"
:
this
.
state
.
periode
.
periode
}
api
.
create
().
getSubmitOI
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
//
console.log(response);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
isSubmit
:
response
.
data
.
data
.
is_can_submit
},
()
=>
{
...
...
@@ -335,9 +335,9 @@ export default class OperatingIndicator extends Component {
fileHandler
=
(
event
)
=>
{
let
fileObj
=
event
ExcelRenderer
(
fileObj
,
(
err
,
resp
)
=>
{
// console.log(resp)
//
//
console.log(resp)
if
(
err
)
{
console
.
log
(
err
);
//
console.log(err);
}
else
{
const
formData
=
new
FormData
();
...
...
@@ -360,7 +360,7 @@ export default class OperatingIndicator extends Component {
})
}
}
// console.log(response)
//
//
console.log(response)
})
}
...
...
@@ -390,7 +390,7 @@ export default class OperatingIndicator extends Component {
// <Select
// value={val}
// onChange={event => {
// // console.log(event.target)
// //
//
console.log(event.target)
// updateValue(event.target.value)
// this.handleChange(event.target.value, tableMeta)
// }}
...
...
src/container/OutlookPA.js
View file @
d5e4ba43
...
...
@@ -72,7 +72,7 @@ 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
);
//
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
()
})
...
...
@@ -83,7 +83,7 @@ export default class OutlookPA extends Component {
checkApprover
()
{
api
.
create
().
checkApproverOLPA
().
then
(
response
=>
{
console
.
log
(
response
);
//
console.log(response);
if
(
response
.
data
.
data
.
is_approver
===
true
)
{
this
.
setState
({
isApprover
:
true
,
checkApprover
:
true
},
()
=>
this
.
getPeriode
())
...
...
@@ -99,7 +99,7 @@ export default class OutlookPA extends Component {
"periode"
:
this
.
state
.
periode
.
periode
}
api
.
create
().
getCompanySubmittedOLPA
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
//
console.log(response);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
...
...
@@ -115,7 +115,7 @@ export default class OutlookPA extends Component {
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
};
this
.
setState
({
listCompany
:
defaultProps
,
company
:
companyData
[
0
]
},
()
=>
{
// console.log(response.data.data);
//
//
console.log(response.data.data);
if
(
response
.
data
.
data
.
length
>
0
)
{
this
.
getRevision
()
}
else
{
...
...
@@ -146,13 +146,13 @@ export default class OutlookPA extends Component {
"revision"
:
this
.
state
.
revision
.
revision
,
}
api
.
create
().
getOLPAAtt
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
//
console.log(response)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
listAttachment
:
response
.
data
.
data
})
}
}
// console.log(response);
//
//
console.log(response);
})
}
...
...
@@ -163,7 +163,7 @@ export default class OutlookPA extends Component {
"report_type"
:
"Outlook PA"
,
}
api
.
create
().
getReportOLPA
(
payload
).
then
(
response
=>
{
console
.
log
(
response
);
//
console.log(response);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
let
dataTable
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
...
...
@@ -184,7 +184,7 @@ export default class OutlookPA extends Component {
""
]
})
// console.log(dataTable);
//
//
console.log(dataTable);
this
.
setState
({
dataTable
,
loading
:
false
,
dataTableRevision
,
dataForRevision
:
response
.
data
.
data
})
}
}
else
{
...
...
@@ -199,7 +199,7 @@ export default class OutlookPA extends Component {
"periode"
:
this
.
state
.
periode
.
periode
}
api
.
create
().
getSubmitOLPA
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
//
console.log(response);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
isSubmit
:
response
.
data
.
data
.
is_can_submit
},
()
=>
{
...
...
@@ -228,7 +228,7 @@ export default class OutlookPA extends Component {
getCompanyActive
()
{
api
.
create
().
getPerusahaanActive
().
then
((
response
)
=>
{
console
.
log
(
response
);
//
console.log(response);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
...
...
@@ -274,7 +274,7 @@ export default class OutlookPA extends Component {
getLastPeriod
()
{
api
.
create
().
getLastPeriodOLPA
(
this
.
state
.
company
.
company_id
).
then
(
response
=>
{
console
.
log
(
response
);
//
console.log(response);
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
lastPeriod
:
response
.
data
.
data
.
last_periode
,
latestPeriode
:
response
.
data
.
data
.
latest_periode
},
()
=>
{
this
.
getPeriode
()
...
...
@@ -288,7 +288,7 @@ export default class OutlookPA extends Component {
// let dateNow = new Date
// let year = this.state.rawData ? this.state.rawData.periode : format(dateNow, 'yyyy')
let
currentYear
=
new
Date
().
getFullYear
()
// console.log(currentYear)
//
//
console.log(currentYear)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
let
data
=
[]
...
...
@@ -314,10 +314,10 @@ export default class OutlookPA extends Component {
};
let
periode
=
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
this
.
state
.
lastPeriod
)
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
===
periode
)
// console.log(data)
console
.
log
(
this
.
state
.
lastPeriod
)
// console.log(periodeData)
// console.log(index)
//
//
console.log(data)
//
console.log(this.state.lastPeriod)
//
//
console.log(periodeData)
//
//
console.log(index)
this
.
setState
({
listPeriode
:
defaultProps
,
periode
:
index
===
-
1
?
periodeData
[
0
]
:
periodeData
[
index
]
},
()
=>
{
if
(
this
.
state
.
isApprover
===
true
)
{
this
.
getCompanySubmitted
()
...
...
@@ -336,7 +336,7 @@ export default class OutlookPA extends Component {
"periode"
:
this
.
state
.
periode
.
periode
}
api
.
create
().
getRevision
(
payload
).
then
(
response
=>
{
console
.
log
(
response
);
//
console.log(response);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
let
data
=
response
.
data
.
data
...
...
@@ -365,7 +365,7 @@ export default class OutlookPA extends Component {
"is_approver"
:
this
.
state
.
isApprover
}
api
.
create
().
getOutlookPAID
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
//
console.log(response)
if
(
response
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
...
...
@@ -376,11 +376,11 @@ export default class OutlookPA extends Component {
lastRevision
:
response
.
data
.
data
.
last_revision
,
btnApprove
:
response
.
data
.
data
.
is_submit
},
()
=>
{
console
.
log
(
this
.
state
.
lastStatus
);
//
console.log(this.state.lastStatus);
this
.
historyApproval
()
this
.
getLatestPeriodSubmit
()
api
.
create
().
checkApprover
().
then
(
response
=>
{
// console.log(response);
//
//
console.log(response);
if
(
response
.
data
.
data
.
is_approver
===
true
)
{
this
.
setState
({
isApprover
:
true
,
checkApprover
:
true
})
}
else
{
...
...
@@ -402,7 +402,7 @@ export default class OutlookPA extends Component {
"periode"
:
this
.
state
.
periode
.
periode
}
api
.
create
().
historyApprovalOLPA
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
//
console.log(response);
if
(
response
.
data
.
data
.
length
>
0
)
{
let
dataTableHistory
=
response
.
data
.
data
.
map
(
item
=>
{
return
[
...
...
@@ -432,9 +432,9 @@ export default class OutlookPA extends Component {
"min_periode"
:
moment
(
this
.
state
.
minDateRevision
).
format
(
'YYYY-MM-DD'
),
"max_periode"
:
moment
(
this
.
state
.
maxDateRevision
).
format
(
'YYYY-MM-DD'
)
}
console
.
log
(
payload
)
//
console.log(payload)
api
.
create
().
approvalSubmission
(
body
).
then
((
res
)
=>
{
console
.
log
(
res
)
//
console.log(res)
this
.
setState
({
loading
:
false
},
()
=>
{
this
.
getSubmission
()
})
...
...
@@ -445,7 +445,7 @@ export default class OutlookPA extends Component {
}
clickDetail
(
item
,
id
,
revision
,
status
)
{
console
.
log
(
this
.
state
.
dataForRevision
);
//
console.log(this.state.dataForRevision);
this
.
state
.
dataForRevision
.
map
(
i
=>
{
if
(
i
.
report_name
===
item
)
{
if
(
i
.
revision
!==
revision
)
{
...
...
@@ -510,9 +510,9 @@ export default class OutlookPA extends Component {
fileHandler
=
(
event
)
=>
{
let
fileObj
=
event
ExcelRenderer
(
fileObj
,
(
err
,
resp
)
=>
{
// console.log(resp)
//
//
console.log(resp)
if
(
err
)
{
console
.
log
(
err
);
//
console.log(err);
}
else
{
const
formData
=
new
FormData
();
...
...
@@ -553,9 +553,9 @@ export default class OutlookPA extends Component {
saveToOLPA
(
data
)
{
this
.
setState
({
loading
:
true
})
// console.log(JSON.stringify(data));
//
//
console.log(JSON.stringify(data));
api
.
create
(
'UPLOAD'
).
createReportOLPA
(
data
).
then
(
response
=>
{
console
.
log
(
response
);
//
console.log(response);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
getOutlookPAID
()
...
...
@@ -577,9 +577,9 @@ export default class OutlookPA extends Component {
async
downloadAttachment
(
fileurl
,
name
)
{
let
length
=
name
.
split
(
"."
).
length
let
fileType
=
name
.
split
(
"."
)[
length
-
1
]
console
.
log
(
fileType
);
//
console.log(fileType);
let
url
=
`https://tia.eksad.com/tia-reporting-dev/public/transaction/outlook_pa/download_attachment?fileName=
${
fileurl
}
&&fileType=
${
fileType
}
`
// console.log(url);
//
//
console.log(url);
let
res
=
await
fetch
(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/outlook_pa/download_attachment?fileName=
${
fileurl
}
&&fileType=
${
fileType
}
`
)
...
...
@@ -616,7 +616,7 @@ export default class OutlookPA extends Component {
outlook_pa_id
:
this
.
state
.
outlook_pa_id
}
api
.
create
().
submitOLPA
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
//
console.log(response);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
getOutlookPAID
()
...
...
@@ -627,9 +627,9 @@ export default class OutlookPA extends Component {
this
.
setState
({
alert
:
true
,
messageAlert
:
'Data Is Not Complete'
,
tipeAlert
:
'warning'
,
loading
:
false
})
}
// if (array.includes("not-yet" || "draft")) {
// console.log('gagal');
//
//
console.log('gagal');
// } else {
// console.log('masuk');
//
//
console.log('masuk');
// }
}
...
...
@@ -657,7 +657,7 @@ export default class OutlookPA extends Component {
<
Select
value
=
{
val
}
onChange
=
{
event
=>
{
// console.log(event.target)
//
//
console.log(event.target)
updateValue
(
event
.
target
.
value
)
this
.
handleChange
(
event
.
target
.
value
,
tableMeta
)
}}
...
...
@@ -784,10 +784,10 @@ export default class OutlookPA extends Component {
defaultValue
=
{
value
}
color
=
{
"#5198ea"
}
onBlur
=
{(
event
)
=>
{
// console.log(event.target.value)
//
//
console.log(event.target.value)
// updateValue(event.target.value)
handleChangeText
(
event
.
target
.
value
,
tableMeta
)
// console.log(dataTable2)
//
//
console.log(dataTable2)
}}
/>
}
/>
...
...
@@ -825,7 +825,7 @@ export default class OutlookPA extends Component {
detailRevisiCheck
.
splice
(
indexId
,
1
)
}
this
.
setState
({
detailRevisiCheck
})
console
.
log
(
detailRevisiCheck
)
//
console.log(detailRevisiCheck)
}
const
options
=
{
...
...
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