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
dc4a2ae5
Commit
dc4a2ae5
authored
Dec 14, 2020
by
faisalhamdi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upload cat mr
parent
86a1a8d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
CorporateAnnualTargetMR.js
src/container/MonthlyReport/CorporateAnnualTargetMR.js
+12
-11
No files found.
src/container/MonthlyReport/CorporateAnnualTargetMR.js
View file @
dc4a2ae5
...
...
@@ -243,6 +243,7 @@ export default class CorporateAnnualTargetMR extends Component {
}
else
{
let
isi
=
resp
.
rows
.
slice
(
3
)
console
.
log
(
isi
);
let
payload
=
[]
let
reg
=
/^
[
-+
]?(?:[
0-9
]
+,
)
*
[
0-9
]
+
(?:\.[
0-9
]
+
)?
$/
;
isi
.
map
((
i
,
index
)
=>
{
...
...
@@ -251,9 +252,9 @@ export default class CorporateAnnualTargetMR extends Component {
orders
:
i
[
0
]
===
undefined
?
""
:
String
(
i
[
0
]).
trim
(),
item_report_id
:
i
[
1
]
===
undefined
?
""
:
String
(
i
[
1
]).
trim
(),
item_report
:
i
[
2
]
===
undefined
?
""
:
String
(
i
[
2
]).
trim
(),
wight
:
i
[
3
]
===
undefined
?
""
:
(
String
(
i
[
3
]))
===
false
?
"0"
:
String
(
i
[
3
]).
trim
(),
w
e
ight
:
i
[
3
]
===
undefined
?
""
:
(
String
(
i
[
3
]))
===
false
?
"0"
:
String
(
i
[
3
]).
trim
(),
oum
:
i
[
4
]
===
undefined
?
""
:
(
String
(
i
[
4
]))
===
false
?
"0"
:
String
(
i
[
4
]).
trim
(),
kpi_type
:
i
[
5
]
===
undefined
?
""
:
(
String
(
i
[
5
]))
===
false
?
"0"
:
String
(
i
[
5
]).
trim
(),
jenis_kpi
:
i
[
5
]
===
undefined
?
""
:
(
String
(
i
[
5
]))
===
false
?
"0"
:
String
(
i
[
5
]).
trim
(),
max_ach
:
i
[
6
]
===
undefined
?
""
:
(
String
(
i
[
6
]))
===
false
?
"0"
:
String
(
i
[
6
]).
trim
(),
actual_monthly
:
i
[
7
]
===
undefined
?
"0.0"
:
(
String
(
i
[
7
]))
===
false
?
"0"
:
String
(
i
[
7
]).
trim
(),
notes
:
i
[
8
]
===
undefined
?
""
:
(
String
(
i
[
8
]))
===
false
?
"0"
:
String
(
i
[
8
]).
trim
(),
...
...
@@ -276,8 +277,8 @@ export default class CorporateAnnualTargetMR extends Component {
checkUpload
()
{
api
.
create
().
checkUploadMonthlyReportCAT
(
this
.
state
.
payload
).
then
(
response
=>
{
console
.
log
(
JSON
.
stringify
(
this
.
state
.
payload
));
//
console.log(this.state.payload)
//
console.log(response)
console
.
log
(
this
.
state
.
payload
)
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
this
.
setState
({
visibleUpload
:
false
,
loading
:
true
,
visibleCATMR
:
false
})
...
...
@@ -293,19 +294,21 @@ export default class CorporateAnnualTargetMR extends Component {
item
.
uom
,
item
.
kpi_type
,
item
.
max_ach
,
item
.
formula
,
item
.
formula
_ytd
,
item
.
actual_monthly
,
item
.
target_monthly
,
item
.
achivement_monthly
,
item
.
score
,
item
.
score_x_weight
,
item
.
notes
item
.
notes
,
item
.
order
,
item
.
error
]
})
console
.
log
(
dataTable
)
this
.
setState
({
dataTable
,
dataLoaded
:
true
,
loading
:
false
,
buttonError
:
false
,
editable
:
true
},
()
=>
{
this
.
state
.
dataTable
.
map
(
item
=>
{
if
(
item
[
1
8
].
length
>
0
)
{
if
(
item
[
1
6
].
length
>
0
)
{
console
.
log
(
'masuk'
)
this
.
setState
({
buttonError
:
true
,
errorPreview
:
true
,
editable
:
true
})
}
...
...
@@ -323,7 +326,7 @@ export default class CorporateAnnualTargetMR extends Component {
data
.
push
({
item_report_id
:
i
[
1
],
item_report
:
String
(
i
[
5
]).
trim
(),
wight
:
String
(
i
[
6
]),
w
e
ight
:
String
(
i
[
6
]),
uom
:
String
(
i
[
7
]),
jenis_kpi
:
i
[
8
]
==
null
?
""
:
i
[
8
].
value
,
max_ach
:
i
[
9
]
==
null
?
""
:
i
[
9
].
value
,
...
...
@@ -344,7 +347,6 @@ export default class CorporateAnnualTargetMR extends Component {
"status"
:
type
,
"months"
:
this
.
props
.
month
.
month_id
,
"corporate_annual_target"
:
data
// "fixed_asset_movement": data
}
console
.
log
(
data
);
api
.
create
(
'UPLOAD'
).
uploadMonthlyReportCAT
(
body
).
then
(
response
=>
{
...
...
@@ -561,7 +563,7 @@ export default class CorporateAnnualTargetMR extends Component {
// console.log(data);
let
index
=
0
if
(
value
==
null
)
{
console
.
log
(
"masuk"
);
//
console.log("masuk");
index
=
-
1
}
else
{
index
=
data
.
findIndex
((
val
)
=>
val
.
value
==
value
.
value
)
...
...
@@ -1483,7 +1485,6 @@ export default class CorporateAnnualTargetMR extends Component {
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
}}
>
in
IDR
mn
<
/Typography
>
<
/div
>
<
div
style
=
{{
marginTop
:
20
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
400
:
150
)
}}
>
{
console
.
log
(
this
.
state
.
loading
)
}
{
!
this
.
state
.
loading
&&
(
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
...
...
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