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
ad6f251c
Commit
ad6f251c
authored
Mar 09, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
list approval
parent
2ebd8fb3
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
472 additions
and
320 deletions
+472
-320
appraisal.js
app/container/home/appraisal/appraisal.js
+59
-46
sampleMenuAppraisal.js
app/container/home/appraisal/sampleMenuAppraisal.js
+125
-105
sampleMenuAppraisal3.js
app/container/home/appraisal/sampleMenuAppraisal3.js
+178
-167
approval.js
app/container/home/approval/approval.js
+102
-0
appNavigation.js
app/navigation/appNavigation.js
+2
-0
api.js
app/service/api.js
+6
-2
No files found.
app/container/home/appraisal/appraisal.js
View file @
ad6f251c
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
import
{
Text
,
View
,
ScrollView
,
TouchableOpacity
}
from
'react-native'
import
{
Text
,
View
,
ScrollView
,
TouchableOpacity
}
from
'react-native'
import
{
Container
}
from
'native-base'
import
{
Container
}
from
'native-base'
import
api
from
'../../../service/api'
import
SvgAnimatedLinearGradient
from
'react-native-svg-animated-linear-gradient'
import
Svg
,
{
Circle
,
Rect
}
from
'react-native-svg'
import
Reactron
from
'reactotron-react-native'
import
Next
from
'react-native-vector-icons/MaterialIcons'
import
Next
from
'react-native-vector-icons/MaterialIcons'
export
default
class
Appraisal
extends
Component
{
export
default
class
Appraisal
extends
Component
{
...
@@ -11,73 +15,82 @@ export default class Appraisal extends Component {
...
@@ -11,73 +15,82 @@ export default class Appraisal extends Component {
arrayDummy
:
[
arrayDummy
:
[
{
noKontrak
:
'K-2001920'
,
namaWerehouse
:
'Branch-2'
,
petugas
:
'Dadang Tukimin'
,
tglTerima
:
'03-03-2020'
,
status
:
'Draft'
,
brand
:
'Honda'
,
type
:
'Revo'
,
noPol
:
'B 4203 PWK'
},
{
noKontrak
:
'K-2001920'
,
namaWerehouse
:
'Branch-2'
,
petugas
:
'Dadang Tukimin'
,
tglTerima
:
'03-03-2020'
,
status
:
'Draft'
,
brand
:
'Honda'
,
type
:
'Revo'
,
noPol
:
'B 4203 PWK'
},
{
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
:
[],
loading
:
false
}
}
}
}
componentDidMount
()
{
this
.
getListAppraisal
()
}
getListAppraisal
()
{
this
.
setState
({
loading
:
true
})
api
.
create
().
getListAppraisal
({
warehouse_id
:
2
}).
then
((
response
)
=>
{
console
.
log
(
JSON
.
stringify
(
response
.
data
))
if
(
response
.
data
.
status
==
"success"
)
{
let
listData
=
[]
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
if
(
item
.
appraisal_status
!=
'Rejected'
)
{
listData
.
push
(
item
)
}
})
this
.
setState
({
listData
},
()
=>
{
setTimeout
(()
=>
{
this
.
setState
({
loading
:
false
})
},
500
);
})
}
})
}
render
()
{
render
()
{
return
(
return
(
<
Container
style
=
{{
flex
:
1
}}
>
<
Container
style
=
{{
flex
:
1
}}
>
<
ScrollView
style
=
{{
paddingHorizontal
:
20
,
backgroundColor
:
'#F5F5F5'
,
paddingTop
:
10
}}
showsVerticalScrollIndicator
=
{
false
}
>
<
ScrollView
style
=
{{
paddingHorizontal
:
20
,
backgroundColor
:
'#F5F5F5'
,
paddingTop
:
10
}}
showsVerticalScrollIndicator
=
{
false
}
>
{
this
.
state
.
arrayDummy
.
map
((
item
,
index
)
=>
{
{
this
.
state
.
listData
.
map
((
item
,
index
)
=>
{
return
(
return
(
<
View
key
=
{
index
}
style
=
{{
paddingHorizontal
:
7
}}
>
<
View
key
=
{
index
}
style
=
{{
paddingHorizontal
:
7
}}
>
<
TouchableOpacity
style
=
{{
marginTop
:
10
,
borderRadius
:
20
}}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'MenuAppraisal'
)}
>
{
!
this
.
state
.
loading
&&
(
<
TouchableOpacity
style
=
{{
marginTop
:
10
,
borderRadius
:
20
}}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'MenuAppraisal'
,
{
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
.
noKontrak
}
<
/Text
>
<
Text
style
=
{{
color
:
'white'
,
fontSize
:
16
,
fontWeight
:
'700'
}}
>
{
item
.
contract_number
}
<
/Text
>
<
Text
style
=
{{
color
:
'white'
,
fontSize
:
14
}}
>
{
item
.
petugas
}
<
/Text
>
<
Text
style
=
{{
color
:
'white'
,
fontSize
:
14
}}
>
{
item
.
nasabah_name
}
<
/Text
>
<
/View
>
<
/View
>
<
View
style
=
{{
justifyContent
:
'center'
}}
>
<
View
style
=
{{
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
color
:
'white'
,
fontSize
:
14
,
textAlign
:
'center'
}}
>
{
item
.
namaWerehous
e
}
<
/Text
>
<
Text
style
=
{{
color
:
'white'
,
fontSize
:
14
,
textAlign
:
'center'
}}
>
{
item
.
warehouse_cod
e
}
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
View
style
=
{{
height
:
60
,
backgroundColor
:
'#E6E6E6'
,
justifyContent
:
'space-between'
,
paddingHorizontal
:
20
,
flexDirection
:
'row'
,
borderBottomRightRadius
:
10
,
borderBottomLeftRadius
:
10
}}
>
<
View
style
=
{{
height
:
60
,
backgroundColor
:
'#E6E6E6'
,
justifyContent
:
'space-between'
,
paddingHorizontal
:
20
,
flexDirection
:
'row'
,
borderBottomRightRadius
:
10
,
borderBottomLeftRadius
:
10
}}
>
<
View
style
=
{{
justifyContent
:
'center'
}}
>
<
View
style
=
{{
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
color
:
'black'
,
fontSize
:
14
}}
>
{
item
.
brand
}
-
{
item
.
type
}
<
/Text
>
<
Text
style
=
{{
color
:
'black'
,
fontSize
:
14
}}
>
{
item
.
brand
}
-
{
item
.
model
}
<
/Text
>
<
Text
style
=
{{
color
:
'black'
,
fontSize
:
14
}}
>
{
item
.
noPol
}
<
/Text
>
<
Text
style
=
{{
color
:
'black'
,
fontSize
:
14
}}
>
{
item
.
police_number
}
<
/Text
>
<
/View
>
<
/View
>
<
View
style
=
{{
justifyContent
:
'center'
}}
>
<
View
style
=
{{
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
color
:
'black'
,
fontSize
:
14
,
textAlign
:
'center'
}}
>
{
item
.
status
}
<
/Text
>
<
Text
style
=
{{
color
:
'black'
,
fontSize
:
14
}}
>
{
item
.
appraisal_status
}
<
/Text
>
<
Text
style
=
{{
color
:
'black'
,
fontSize
:
14
}}
>
{
item
.
pull_officer
}
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
{
/* <View style={{ backgroundColor: '#E6E6E6', borderBottomRightRadius: 10, borderBottomLeftRadius: 10, justifyContent: 'center', paddingHorizontal: 20, paddingVertical: 10, borderTopWidth: .7, borderTopColor: 'black' }}>
</View> */
}
<
/TouchableOpacity
>
<
/TouchableOpacity
>
{
/* <TouchableOpacity style={{ width: '100%', backgroundColor: '#FFFFFF', borderRadius: 15, paddingHorizontal: 10, shadowRadius: 80, paddingVertical: 10, marginTop: 10 }} onPress={() => this.props.navigation.navigate('MenuAppraisal')}>
)}
<View style={{ width: 120, height: 20, backgroundColor: 'black', marginLeft: -20, marginTop: 5, borderTopRightRadius: 5, borderBottomRightRadius: 5 }}>
{
this
.
state
.
loading
&&
(
<Text style={{ color: 'white', textAlign: 'center' }}>{item.status}</Text>
<
SvgAnimatedLinearGradient
</View>
height
=
{
140
}
<View style={{
borderRadius
=
{
200
}
backgroundColor: '#E6E6E6', height: 10, width: 10,
marginTop
=
{
-
15
}
marginLeft: -20,
width
=
{
'100%'
}
backgroundColor: 'transparent',
duration
=
{
800
}
borderStyle: 'solid',
primaryColor
=
"#fff3c9"
borderTopWidth: 8,
secondaryColor
=
"#e4b300"
borderRightWidth: 0,
>
borderBottomWidth: 0,
<
Rect
x
=
"0"
y
=
"30"
rx
=
"5"
ry
=
"1"
width
=
"1000"
height
=
"120"
/>
borderLeftWidth: 10,
<
/SvgAnimatedLinearGradient
>
borderTopColor: 'black',
)}
borderRightColor: 'transparent',
borderBottomColor: 'transparent',
borderLeftColor: 'transparent',
}} />
<View style={{ flexDirection: 'row' }}>
<View style={{ width: '80%' }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
<Text style={{ alignSelf: 'center', fontSize: 16, fontWeight: 'bold' }}>{item.noKontrak}</Text>
<Text style={{ alignSelf: 'center', fontSize: 14 }}>{item.namaWerehouse}</Text>
</View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
<Text style={{ alignSelf: 'center', fontSize: 14 }}>{item.tglTerima}</Text>
<Text style={{ alignSelf: 'center', fontSize: 14 }}>{item.petugas}</Text>
</View>
</View>
<View style={{ justifyContent: 'center', width: '20%', alignItems: 'flex-end' }}>
<Next name="navigate-next" size={26} />
</View>
</View>
</TouchableOpacity> */
}
<
/View
>
<
/View
>
)
)
})}
})}
...
...
app/container/home/appraisal/sampleMenuAppraisal.js
View file @
ad6f251c
This diff is collapsed.
Click to expand it.
app/container/home/appraisal/sampleMenuAppraisal3.js
View file @
ad6f251c
This diff is collapsed.
Click to expand it.
app/container/home/approval/approval.js
View file @
ad6f251c
import
React
,
{
Component
}
from
'react'
import
{
Text
,
View
,
ScrollView
,
TouchableOpacity
}
from
'react-native'
import
{
Container
}
from
'native-base'
import
api
from
'../../../service/api'
import
SvgAnimatedLinearGradient
from
'react-native-svg-animated-linear-gradient'
import
Svg
,
{
Circle
,
Rect
}
from
'react-native-svg'
import
Reactron
from
'reactotron-react-native'
import
Next
from
'react-native-vector-icons/MaterialIcons'
export
default
class
Approval
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
arrayDummy
:
[
{
noKontrak
:
'K-2001920'
,
namaWerehouse
:
'Branch-2'
,
petugas
:
'Dadang Tukimin'
,
tglTerima
:
'03-03-2020'
,
status
:
'Draft'
,
brand
:
'Honda'
,
type
:
'Revo'
,
noPol
:
'B 4203 PWK'
},
{
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
:
[],
loading
:
false
}
}
componentDidMount
()
{
this
.
getListApproval
()
}
getListApproval
()
{
this
.
setState
({
loading
:
true
})
api
.
create
().
getListApproval
({
warehouse_id
:
2
}).
then
((
response
)
=>
{
console
.
log
(
JSON
.
stringify
(
response
.
data
))
if
(
response
.
data
.
status
==
"success"
)
{
let
listData
=
[]
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
if
(
item
.
appraisal_status
!=
'Rejected'
)
{
listData
.
push
(
item
)
}
})
this
.
setState
({
listData
},
()
=>
{
setTimeout
(()
=>
{
this
.
setState
({
loading
:
false
})
},
500
);
})
}
})
}
render
()
{
return
(
<
Container
style
=
{{
flex
:
1
}}
>
<
ScrollView
style
=
{{
paddingHorizontal
:
20
,
backgroundColor
:
'#F5F5F5'
,
paddingTop
:
10
}}
showsVerticalScrollIndicator
=
{
false
}
>
{
this
.
state
.
listData
.
map
((
item
,
index
)
=>
{
return
(
<
View
key
=
{
index
}
style
=
{{
paddingHorizontal
:
7
}}
>
{
!
this
.
state
.
loading
&&
(
<
TouchableOpacity
style
=
{{
marginTop
:
10
,
borderRadius
:
20
}}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'MenuAppraisal'
,
{
data
:
item
})}
>
<
View
style
=
{{
height
:
60
,
backgroundColor
:
'#e4b300'
,
justifyContent
:
'space-between'
,
paddingHorizontal
:
20
,
flexDirection
:
'row'
,
borderTopRightRadius
:
10
,
borderTopLeftRadius
:
10
}}
>
<
View
style
=
{{
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
color
:
'white'
,
fontSize
:
16
,
fontWeight
:
'700'
}}
>
{
item
.
contract_number
}
<
/Text
>
<
Text
style
=
{{
color
:
'white'
,
fontSize
:
14
}}
>
{
item
.
nasabah_name
}
<
/Text
>
<
/View
>
<
View
style
=
{{
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
color
:
'white'
,
fontSize
:
14
,
textAlign
:
'center'
}}
>
{
item
.
warehouse_code
}
<
/Text
>
<
/View
>
<
/View
>
<
View
style
=
{{
height
:
60
,
backgroundColor
:
'#E6E6E6'
,
justifyContent
:
'space-between'
,
paddingHorizontal
:
20
,
flexDirection
:
'row'
,
borderBottomRightRadius
:
10
,
borderBottomLeftRadius
:
10
}}
>
<
View
style
=
{{
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
color
:
'black'
,
fontSize
:
14
}}
>
{
item
.
brand
}
-
{
item
.
model
}
<
/Text
>
<
Text
style
=
{{
color
:
'black'
,
fontSize
:
14
}}
>
{
item
.
police_number
}
<
/Text
>
<
/View
>
<
View
style
=
{{
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
color
:
'black'
,
fontSize
:
14
}}
>
{
item
.
appraisal_status
}
<
/Text
>
<
Text
style
=
{{
color
:
'black'
,
fontSize
:
14
}}
>
{
item
.
pull_officer
}
<
/Text
>
<
/View
>
<
/View
>
<
/TouchableOpacity
>
)}
{
this
.
state
.
loading
&&
(
<
SvgAnimatedLinearGradient
height
=
{
140
}
borderRadius
=
{
200
}
marginTop
=
{
-
15
}
width
=
{
'100%'
}
duration
=
{
800
}
primaryColor
=
"#fff3c9"
secondaryColor
=
"#e4b300"
>
<
Rect
x
=
"0"
y
=
"30"
rx
=
"5"
ry
=
"1"
width
=
"1000"
height
=
"120"
/>
<
/SvgAnimatedLinearGradient
>
)}
<
/View
>
)
})}
<
/ScrollView
>
<
/Container
>
)
}
}
app/navigation/appNavigation.js
View file @
ad6f251c
...
@@ -19,6 +19,7 @@ import Penerimaan from '../container/home/penerimaan/penerimaan'
...
@@ -19,6 +19,7 @@ import Penerimaan from '../container/home/penerimaan/penerimaan'
import
MenuPenerimaan
from
'../container/home/penerimaan/sampleMenuPenerimaan'
import
MenuPenerimaan
from
'../container/home/penerimaan/sampleMenuPenerimaan'
import
MenuPenerimaan2
from
'../container/home/penerimaan/sampleMenuPenerimaan2'
import
MenuPenerimaan2
from
'../container/home/penerimaan/sampleMenuPenerimaan2'
import
MenuPenerimaan3
from
'../container/home/penerimaan/sampleMenuPenerimaan3'
import
MenuPenerimaan3
from
'../container/home/penerimaan/sampleMenuPenerimaan3'
import
Approval
from
'../container/home/approval/approval'
//IconBack
//IconBack
import
IconBack
from
'react-native-vector-icons/MaterialIcons'
import
IconBack
from
'react-native-vector-icons/MaterialIcons'
...
@@ -46,6 +47,7 @@ const MainNavigator = createStackNavigator({
...
@@ -46,6 +47,7 @@ const MainNavigator = createStackNavigator({
MenuPenerimaan
:
{
screen
:
MenuPenerimaan
,
navigationOptions
:
{
title
:
'Menu Penerimaan'
}
},
MenuPenerimaan
:
{
screen
:
MenuPenerimaan
,
navigationOptions
:
{
title
:
'Menu Penerimaan'
}
},
MenuPenerimaan2
:
{
screen
:
MenuPenerimaan2
,
navigationOptions
:
{
title
:
'Menu Penerimaan'
}
},
MenuPenerimaan2
:
{
screen
:
MenuPenerimaan2
,
navigationOptions
:
{
title
:
'Menu Penerimaan'
}
},
MenuPenerimaan3
:
{
screen
:
MenuPenerimaan3
,
navigationOptions
:
{
title
:
'Menu Penerimaan'
}
},
MenuPenerimaan3
:
{
screen
:
MenuPenerimaan3
,
navigationOptions
:
{
title
:
'Menu Penerimaan'
}
},
Approval
:
{
screen
:
Approval
,
navigationOptions
:
{
title
:
'Approval'
}
},
// LatihanDragDrop: { screen: LatihanDragDrop, navigationOptions: { title: 'Latihan'}}
// LatihanDragDrop: { screen: LatihanDragDrop, navigationOptions: { title: 'Latihan'}}
},
{
},
{
headerMode
:
'screen'
,
headerMode
:
'screen'
,
...
...
app/service/api.js
View file @
ad6f251c
...
@@ -46,7 +46,9 @@ const create = () => {
...
@@ -46,7 +46,9 @@ const create = () => {
const
getListClar
=
(
value
)
=>
api
.
post
(
'demo/get_list_clar'
,
value
)
const
getListClar
=
(
value
)
=>
api
.
post
(
'demo/get_list_clar'
,
value
)
const
getWarehouse
=
()
=>
GET
(
'demo/get_user_warehouse'
)
const
getWarehouse
=
()
=>
GET
(
'demo/get_user_warehouse'
)
const
getPermission
=
()
=>
GET
(
'demo/get_permission'
)
const
getPermission
=
()
=>
GET
(
'demo/get_permission'
)
const
getUserWarehouse
=
()
=>
GET
(
'demo/get_user_warehouse'
)
const
getUserWarehouse
=
()
=>
GET
(
'demo/get_user_warehouse'
)
const
getListAppraisal
=
(
value
)
=>
POST
(
'demo/get_list_appraisal'
,
value
)
const
getListApproval
=
(
value
)
=>
POST
(
'demo/get_list_approval'
,
value
)
return
{
return
{
...
@@ -54,7 +56,9 @@ const create = () => {
...
@@ -54,7 +56,9 @@ const create = () => {
getListClar
,
getListClar
,
getWarehouse
,
getWarehouse
,
getPermission
,
getPermission
,
getUserWarehouse
getUserWarehouse
,
getListAppraisal
,
getListApproval
}
}
}
}
...
...
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