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
c8b2082b
Commit
c8b2082b
authored
Nov 17, 2021
by
syadziy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update issue Outlook PA can submit and list company per user
parent
27a08cfb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
7 deletions
+31
-7
OutlookPA.js
src/container/OutlookPA.js
+31
-7
No files found.
src/container/OutlookPA.js
View file @
c8b2082b
...
@@ -139,19 +139,39 @@ export default class OutlookPA extends Component {
...
@@ -139,19 +139,39 @@ export default class OutlookPA extends Component {
}
}
})
})
if
(
companyData
.
length
>
0
)
{
let
arrayBaru
=
[]
companyData
=
companyData
.
sort
((
a
,
b
)
=>
a
.
company_name
.
localeCompare
(
b
.
company_name
))
this
.
state
.
userCompany
.
map
((
item
,
index
)
=>
{
let
indexID
=
companyData
.
findIndex
((
val
)
=>
val
.
company_id
==
item
)
if
(
indexID
!==
-
1
)
{
arrayBaru
.
push
(
companyData
[
indexID
])
}
}
})
if
(
arrayBaru
.
length
>
0
)
{
arrayBaru
=
arrayBaru
.
sort
((
a
,
b
)
=>
a
.
company_name
.
localeCompare
(
b
.
company_name
))
}
let
defaultProps
=
{
let
defaultProps
=
{
options
:
companyData
,
options
:
arrayBaru
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
}
;
}
let
indexID
=
null
let
indexID
=
null
if
(
this
.
state
.
rawData
!==
undefined
)
{
if
(
this
.
state
.
rawData
!==
undefined
)
{
indexID
=
companyData
.
findIndex
((
val
)
=>
val
.
company_id
==
this
.
state
.
rawData
.
company_id
)
indexID
=
arrayBaru
.
findIndex
((
val
)
=>
val
.
company_id
==
this
.
state
.
rawData
.
company_id
)
}
}
this
.
setState
({
listCompany
:
defaultProps
,
company
:
indexID
==
null
?
companyData
[
0
]
:
companyData
[
indexID
]
},
()
=>
{
// if (companyData.length > 0) {
// companyData = companyData.sort((a, b) => a.company_name.localeCompare(b.company_name))
// }
// let defaultProps = {
// options: companyData,
// getOptionLabel: (option) => titleCase(option.company_name),
// };
// 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
?
arrayBaru
[
0
]
:
arrayBaru
[
indexID
]
},
()
=>
{
console
.
log
(
response
.
data
.
data
);
console
.
log
(
response
.
data
.
data
);
if
(
response
.
data
.
data
.
length
>
0
)
{
if
(
response
.
data
.
data
.
length
>
0
)
{
this
.
getRevision
()
this
.
getRevision
()
...
@@ -840,6 +860,10 @@ export default class OutlookPA extends Component {
...
@@ -840,6 +860,10 @@ export default class OutlookPA extends Component {
let
array
=
[]
let
array
=
[]
let
canSubmit
=
true
let
canSubmit
=
true
this
.
state
.
dataTable
.
map
(
item
=>
{
this
.
state
.
dataTable
.
map
(
item
=>
{
if
(
item
[
3
]
!==
"submitted"
&&
item
[
3
]
!==
'approved'
)
{
canSubmit
=
false
array
.
push
(
item
[
3
])
}
// if (item[1] !== 'Cash Flow') {
// if (item[1] !== 'Cash Flow') {
// if (item[3] !== "submitted" && item[3] !== 'approved') {
// if (item[3] !== "submitted" && item[3] !== 'approved') {
// canSubmit = false
// canSubmit = false
...
...
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