Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Ad1Appraisal-Mobile
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
Ad1Appraisal-Mobile
Commits
b4b49f81
Commit
b4b49f81
authored
Mar 09, 2020
by
didam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
didim
parent
a314c2c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
3 deletions
+24
-3
approval.js
app/container/home/approval/approval.js
+24
-3
No files found.
app/container/home/approval/approval.js
View file @
b4b49f81
...
@@ -6,6 +6,7 @@ import SvgAnimatedLinearGradient from 'react-native-svg-animated-linear-gradient
...
@@ -6,6 +6,7 @@ import SvgAnimatedLinearGradient from 'react-native-svg-animated-linear-gradient
import
Svg
,
{
Circle
,
Rect
}
from
'react-native-svg'
import
Svg
,
{
Circle
,
Rect
}
from
'react-native-svg'
import
Reactron
from
'reactotron-react-native'
import
Reactron
from
'reactotron-react-native'
import
Next
from
'react-native-vector-icons/MaterialIcons'
import
Next
from
'react-native-vector-icons/MaterialIcons'
import
reactotron
from
'reactotron-react-native'
export
default
class
Approval
extends
Component
{
export
default
class
Approval
extends
Component
{
...
@@ -17,7 +18,8 @@ export default class Approval extends Component {
...
@@ -17,7 +18,8 @@ export default class Approval extends Component {
{
noKontrak
:
'K-2001921'
,
namaWerehouse
:
'Branch-1'
,
petugas
:
'Dudung Tukimin'
,
tglTerima
:
'03-03-2020'
,
status
:
'Need Approval'
,
brand
:
'Honda'
,
type
:
'Beat'
,
noPol
:
'B 4203 STW'
},
{
noKontrak
:
'K-2001921'
,
namaWerehouse
:
'Branch-1'
,
petugas
:
'Dudung Tukimin'
,
tglTerima
:
'03-03-2020'
,
status
:
'Need Approval'
,
brand
:
'Honda'
,
type
:
'Beat'
,
noPol
:
'B 4203 STW'
},
],
],
listData
:
[],
listData
:
[],
loading
:
false
loading
:
false
,
longPress
:
false
}
}
}
}
...
@@ -30,7 +32,7 @@ export default class Approval extends Component {
...
@@ -30,7 +32,7 @@ export default class Approval extends Component {
api
.
create
().
getListApproval
({
api
.
create
().
getListApproval
({
warehouse_id
:
2
warehouse_id
:
2
}).
then
((
response
)
=>
{
}).
then
((
response
)
=>
{
console
.
log
(
JSON
.
stringify
(
response
.
data
)
)
reactotron
.
log
(
response
.
data
)
if
(
response
.
data
.
status
==
"success"
)
{
if
(
response
.
data
.
status
==
"success"
)
{
let
listData
=
[]
let
listData
=
[]
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
...
@@ -45,6 +47,18 @@ export default class Approval extends Component {
...
@@ -45,6 +47,18 @@ export default class Approval extends Component {
})
})
}
}
postApproval
()
{
api
.
create
().
postApproval
({
contract_id
:
this
.
state
.
arrayContractId
}).
then
((
response
)
=>
{
reactotron
.
log
(
response
)
})
}
handleArrayContract
(
item
)
{
}
render
()
{
render
()
{
return
(
return
(
<
Container
style
=
{{
flex
:
1
}}
>
<
Container
style
=
{{
flex
:
1
}}
>
...
@@ -52,9 +66,14 @@ export default class Approval extends Component {
...
@@ -52,9 +66,14 @@ export default class Approval extends Component {
{
this
.
state
.
listData
.
map
((
item
,
index
)
=>
{
{
this
.
state
.
listData
.
map
((
item
,
index
)
=>
{
return
(
return
(
<
View
key
=
{
index
}
style
=
{{
paddingHorizontal
:
7
}}
>
<
View
key
=
{
index
}
style
=
{{
paddingHorizontal
:
7
}}
>
<
View
style
=
{{
flexDirection
:
'row'
}}
>
{
this
.
state
.
longPress
&&
(
<
View
>
<
/View
>
)}
{
!
this
.
state
.
loading
&&
(
{
!
this
.
state
.
loading
&&
(
<
TouchableOpacity
style
=
{{
marginTop
:
10
,
borderRadius
:
20
}}
onLongPress
=
{()
=>
alert
(
'takeit'
)}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'MenuApproval'
,
{
data
:
item
})}
>
<
TouchableOpacity
style
=
{{
marginTop
:
10
,
borderRadius
:
20
}}
onLongPress
=
{()
=>
this
.
handleArrayContract
(
item
.
contract_id
)}
delayLongPress
=
{
100
}
onPress
=
{()
=>
this
.
state
.
longPress
?
this
.
handleArrayContract
(
item
.
contract_id
)
:
this
.
props
.
navigation
.
navigate
(
'MenuApproval'
,
{
data
:
item
})}
>
<
View
style
=
{{
height
:
60
,
backgroundColor
:
'#e4b300'
,
justifyContent
:
'space-between'
,
paddingHorizontal
:
20
,
flexDirection
:
'row'
,
borderTopRightRadius
:
10
,
borderTopLeftRadius
:
10
}}
>
<
View
style
=
{{
height
:
60
,
backgroundColor
:
'#e4b300'
,
justifyContent
:
'space-between'
,
paddingHorizontal
:
20
,
flexDirection
:
'row'
,
borderTopRightRadius
:
10
,
borderTopLeftRadius
:
10
}}
>
<
View
style
=
{{
justifyContent
:
'center'
}}
>
<
View
style
=
{{
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
color
:
'white'
,
fontSize
:
16
,
fontWeight
:
'700'
}}
>
{
item
.
contract_number
}
<
/Text
>
<
Text
style
=
{{
color
:
'white'
,
fontSize
:
16
,
fontWeight
:
'700'
}}
>
{
item
.
contract_number
}
<
/Text
>
...
@@ -76,6 +95,8 @@ export default class Approval extends Component {
...
@@ -76,6 +95,8 @@ export default class Approval extends Component {
<
/View
>
<
/View
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
)}
)}
<
/View
>
{
this
.
state
.
loading
&&
(
{
this
.
state
.
loading
&&
(
<
SvgAnimatedLinearGradient
<
SvgAnimatedLinearGradient
height
=
{
140
}
height
=
{
140
}
...
...
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