Commit b5d200fd authored by didam's avatar didam
parents 53da7a24 332ae142
...@@ -30,13 +30,11 @@ export default class Appraisal extends Component { ...@@ -30,13 +30,11 @@ export default class Appraisal extends Component {
api.create().getListAppraisal({ api.create().getListAppraisal({
warehouse_id: 2 warehouse_id: 2
}).then((response) => { }).then((response) => {
console.log(JSON.stringify(response.data)) // alert(JSON.stringify(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) => {
if (item.appraisal_status != 'Rejected') { listData.push(item)
listData.push(item)
}
}) })
this.setState({ listData }, () => { this.setState({ listData }, () => {
setTimeout(() => { setTimeout(() => {
...@@ -54,29 +52,29 @@ export default class Appraisal extends Component { ...@@ -54,29 +52,29 @@ export default class Appraisal 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 }}>
{!this.state.loading && ( {!this.state.loading && (
<TouchableOpacity style={{ marginTop: 10, borderRadius: 20 }} onPress={() => this.props.navigation.navigate('MenuAppraisal', { data: item })}> <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.contract_number}</Text> <Text style={{ color: 'white', fontSize: 16, fontWeight: '700' }}>{item.contract_number}</Text>
<Text style={{ color: 'white', fontSize: 14 }}>{item.nasabah_name}</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.warehouse_code}</Text> <Text style={{ color: 'white', fontSize: 14, textAlign: 'center' }}>{item.warehouse_code}</Text>
</View> </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>
<View style={{ justifyContent: 'center' }}> <View style={{ height: 60, backgroundColor: '#E6E6E6', justifyContent: 'space-between', paddingHorizontal: 20, flexDirection: 'row', borderBottomRightRadius: 10, borderBottomLeftRadius: 10 }}>
<Text style={{ color: 'black', fontSize: 14 }}>{item.appraisal_status}</Text> <View style={{ justifyContent: 'center' }}>
<Text style={{ color: 'black', fontSize: 14 }}>{item.pull_officer}</Text> <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> </View>
</View> </TouchableOpacity>
</TouchableOpacity>
)} )}
{this.state.loading && ( {this.state.loading && (
<SvgAnimatedLinearGradient <SvgAnimatedLinearGradient
......
...@@ -9,14 +9,15 @@ import DateTimePicker from 'react-native-modal-datetime-picker'; ...@@ -9,14 +9,15 @@ import DateTimePicker from 'react-native-modal-datetime-picker';
import { Array } from '../../../library/Array'; import { Array } from '../../../library/Array';
import AwesomeButton from "react-native-really-awesome-button"; import AwesomeButton from "react-native-really-awesome-button";
import Colors from '../../../library/colors'; import Colors from '../../../library/colors';
import api from '../../../service/api';
export default class sampleMenuAppraisal extends Component { export default class sampleMenuAppraisal extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
data: this.props.navigation.state.params.data || "", data: this.props.navigation.state.params.data || "",
dateUpdate: M(new Date()).format('DD-MMM-YYYY'), dateUpdate: M(new Date()).format('YYYY-MM-DD'),
datePenerimaan: M(new Date()).format('DD-MMM-YYYY'), datePenerimaan: M(new Date()).format('YYYY-MM-DD'),
checked: 'first', checked: 'first',
progress: false, progress: false,
kodeWerehouse: '', kodeWerehouse: '',
...@@ -36,7 +37,7 @@ export default class sampleMenuAppraisal extends Component { ...@@ -36,7 +37,7 @@ export default class sampleMenuAppraisal extends Component {
} }
componentDidMount() { componentDidMount() {
// alert(this.state.date) // alert(JSON.stringify(this.state.data))
} }
handlePenerimaanDate(date) { handlePenerimaanDate(date) {
...@@ -49,6 +50,14 @@ export default class sampleMenuAppraisal extends Component { ...@@ -49,6 +50,14 @@ export default class sampleMenuAppraisal extends Component {
this.setState({ dateUpdate, isDateTimePickerVisible: false }) this.setState({ dateUpdate, isDateTimePickerVisible: false })
} }
draftData() {
api.create().postDraftAppraisal({
contract_id: this.state.data.contract_id
}).then((response) => {
this.props.navigation.navigate('Appraisal')
})
}
render() { render() {
let { data } = this.state let { data } = this.state
return ( return (
...@@ -283,7 +292,7 @@ export default class sampleMenuAppraisal extends Component { ...@@ -283,7 +292,7 @@ export default class sampleMenuAppraisal extends Component {
<TextInput <TextInput
onChangeText={(e) => this.setState({ namaRemote: e })} onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput} style={styles.textInput}
value={this.state.data == "" ? null : String(data.assessment_type)} value={this.state.data == "" ? null : String(data.assessment_type == null ? "-" : data.assessment_type)}
editable={this.state.data == "" ? true : false} editable={this.state.data == "" ? true : false}
/> />
</View> </View>
...@@ -409,14 +418,23 @@ export default class sampleMenuAppraisal extends Component { ...@@ -409,14 +418,23 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}> <View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Tgl Perubahan Data</Text> <Text style={{ fontSize: 13 }}>Tgl Perubahan Data</Text>
</View> </View>
<View style={styles.viewInputEnable}> <TouchableOpacity
style={styles.viewInputEnable}
onPress={() => this.setState({ isDateTimePickerVisiblePenerimaan: true })}
>
<DateTimePicker
mode={'date'}
isVisible={this.state.isDateTimePickerVisiblePenerimaan}
onConfirm={(date) => this.handlePenerimaanDate(date)}
onCancel={() => this.setState({ isDateTimePickerVisiblePenerimaan: false })}
/>
<TextInput <TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput} style={styles.textInput}
value={this.state.namaRemote} value={this.state.datePenerimaan}
editable editable={false}
/> />
</View> </TouchableOpacity>
</View> </View>
</View> </View>
...@@ -732,7 +750,7 @@ export default class sampleMenuAppraisal extends Component { ...@@ -732,7 +750,7 @@ export default class sampleMenuAppraisal extends Component {
<TextInput <TextInput
onChangeText={(e) => this.setState({ namaRemote: e })} onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput} style={styles.textInput}
value={this.state.data == "" ? null : String(data.key)} value={this.state.data == "" ? null : String(data.unit_key)}
editable={this.state.data == "" ? true : false} editable={this.state.data == "" ? true : false}
/> />
</View> </View>
...@@ -860,7 +878,29 @@ export default class sampleMenuAppraisal extends Component { ...@@ -860,7 +878,29 @@ export default class sampleMenuAppraisal extends Component {
</CollapseBody> </CollapseBody>
</Collapse> </Collapse>
<View style={{ width: '100%', justifyContent: 'flex-end', marginTop: 20, alignSelf: 'center', alignContent: 'flex-end', alignItems: 'center', marginBottom: 20 }}> <View style={{ width: '100%', justifyContent: 'space-evenly', marginTop: 20, alignSelf: 'center', alignContent: 'flex-end', alignItems: 'center', marginBottom: 20, flexDirection: 'row' }}>
<AwesomeButton
backgroundColor={Colors.yellowBasic}
backgroundShadow={'#DBDBDB'}
backgroundPlaceholder={null}
backgroundDarker={'#FFED75'}
backgroundProgress={null}
width={120}
height={45}
raiseLevel={5}
borderRadius={10}
progressLoadingTime={1000}
progress={!this.state.progress}
onPress={next => {
setTimeout(() => {
this.draftData()
next()
}, 300);
}}
>
<Text style={{ color: 'black', fontWeight: '700' }}>Draft</Text>
</AwesomeButton>
<AwesomeButton <AwesomeButton
backgroundColor={Colors.yellowBasic} backgroundColor={Colors.yellowBasic}
backgroundShadow={'#DBDBDB'} backgroundShadow={'#DBDBDB'}
...@@ -875,7 +915,7 @@ export default class sampleMenuAppraisal extends Component { ...@@ -875,7 +915,7 @@ export default class sampleMenuAppraisal extends Component {
progress={!this.state.progress} progress={!this.state.progress}
onPress={next => { onPress={next => {
setTimeout(() => { setTimeout(() => {
this.props.navigation.navigate('MenuAppraisal2') this.props.navigation.navigate('MenuAppraisal2', { contract_id: this.state.data.contract_id })
next() next()
}, 300); }, 300);
}} }}
......
...@@ -25,6 +25,9 @@ export default class sampleMenuAppraisal2 extends Component { ...@@ -25,6 +25,9 @@ export default class sampleMenuAppraisal2 extends Component {
} }
} }
componentDidMount(){
}
async requestCameraPermission(type) { async requestCameraPermission(type) {
try { try {
const granted = await PermissionsAndroid.request( const granted = await PermissionsAndroid.request(
...@@ -251,7 +254,7 @@ export default class sampleMenuAppraisal2 extends Component { ...@@ -251,7 +254,7 @@ export default class sampleMenuAppraisal2 extends Component {
progress={!this.state.progress} progress={!this.state.progress}
onPress={next => { onPress={next => {
setTimeout(() => { setTimeout(() => {
this.props.navigation.navigate('MenuAppraisal3') this.props.navigation.navigate('MenuAppraisal3', { contract_id: this.props.navigation.state.params.contract_id })
next() next()
}, 300); }, 300);
}} }}
......
...@@ -7,6 +7,7 @@ import StepIndicator from 'react-native-step-indicator'; ...@@ -7,6 +7,7 @@ import StepIndicator from 'react-native-step-indicator';
import { Array } from '../../../library/Array'; import { Array } from '../../../library/Array';
import AwesomeButton from "react-native-really-awesome-button"; import AwesomeButton from "react-native-really-awesome-button";
import Colors from '../../../library/colors'; import Colors from '../../../library/colors';
import api from '../../../service/api';
export default class sampleMenuAppraisal3 extends Component { export default class sampleMenuAppraisal3 extends Component {
constructor(props) { constructor(props) {
...@@ -37,6 +38,15 @@ export default class sampleMenuAppraisal3 extends Component { ...@@ -37,6 +38,15 @@ export default class sampleMenuAppraisal3 extends Component {
radiaotor: '' radiaotor: ''
} }
} }
validasi(){
api.create().postAppraisal({
contract_id: this.props.navigation.state.params.contract_id
}).then((response) => {
this.props.navigation.navigate('Appraisal')
})
}
render() { render() {
return ( return (
<Container style={{ flex: 1, paddingHorizontal: 10 }}> <Container style={{ flex: 1, paddingHorizontal: 10 }}>
...@@ -650,12 +660,12 @@ export default class sampleMenuAppraisal3 extends Component { ...@@ -650,12 +660,12 @@ export default class sampleMenuAppraisal3 extends Component {
progress={!this.state.progress} progress={!this.state.progress}
onPress={next => { onPress={next => {
setTimeout(() => { setTimeout(() => {
this.props.navigation.navigate('Appraisal') this.validasi()
next() next()
}, 300); }, 300);
}} }}
> >
<Text style={{ color: 'black', fontWeight: '700' }}>Berikutnya</Text> <Text style={{ color: 'black', fontWeight: '700' }}>Simpan</Text>
</AwesomeButton> </AwesomeButton>
</View> </View>
......
...@@ -34,9 +34,7 @@ export default class Approval extends Component { ...@@ -34,9 +34,7 @@ export default class Approval extends Component {
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) => {
if (item.appraisal_status != 'Rejected') { listData.push(item)
listData.push(item)
}
}) })
this.setState({ listData }, () => { this.setState({ listData }, () => {
setTimeout(() => { setTimeout(() => {
...@@ -54,29 +52,29 @@ export default class Approval extends Component { ...@@ -54,29 +52,29 @@ 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 }}>
{!this.state.loading && ( {!this.state.loading && (
<TouchableOpacity style={{ marginTop: 10, borderRadius: 20 }} onLongPress={() => alert('takeit')} onPress={() => this.props.navigation.navigate('MenuAppraisal', { data: item })}> <TouchableOpacity style={{ marginTop: 10, borderRadius: 20 }} onLongPress={() => alert('takeit')} onPress={() => 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>
<Text style={{ color: 'white', fontSize: 14 }}>{item.nasabah_name}</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.warehouse_code}</Text> <Text style={{ color: 'white', fontSize: 14, textAlign: 'center' }}>{item.warehouse_code}</Text>
</View> </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>
<View style={{ justifyContent: 'center' }}> <View style={{ height: 60, backgroundColor: '#E6E6E6', justifyContent: 'space-between', paddingHorizontal: 20, flexDirection: 'row', borderBottomRightRadius: 10, borderBottomLeftRadius: 10 }}>
<Text style={{ color: 'black', fontSize: 14 }}>{item.appraisal_status}</Text> <View style={{ justifyContent: 'center' }}>
<Text style={{ color: 'black', fontSize: 14 }}>{item.pull_officer}</Text> <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> </View>
</View> </TouchableOpacity>
</TouchableOpacity>
)} )}
{this.state.loading && ( {this.state.loading && (
<SvgAnimatedLinearGradient <SvgAnimatedLinearGradient
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -26,8 +26,9 @@ export default class Penerimaan extends Component { ...@@ -26,8 +26,9 @@ export default class Penerimaan extends Component {
getListData() { getListData() {
api.create().getListClar({ api.create().getListClar({
warehouse_id: Number(this.props.navigation.state.params.data) warehouse_id: Number(this.props.navigation.state.params.data.value)
}).then((response) => { }).then((response) => {
// alert(JSON.stringify(response))
let listClar = [] let listClar = []
response.data.data.map((item, index) => { response.data.data.map((item, index) => {
listClar.push(item) listClar.push(item)
......
...@@ -20,6 +20,9 @@ import MenuPenerimaan from '../container/home/penerimaan/sampleMenuPenerimaan' ...@@ -20,6 +20,9 @@ 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' import Approval from '../container/home/approval/approval'
import MenuApproval from '../container/home/approval/sampleMenuApproval'
import MenuApproval2 from '../container/home/approval/sampleMenuApproval2'
import MenuApproval3 from '../container/home/approval/sampleMenuApproval3'
//IconBack //IconBack
import IconBack from 'react-native-vector-icons/MaterialIcons' import IconBack from 'react-native-vector-icons/MaterialIcons'
...@@ -48,6 +51,9 @@ const MainNavigator = createStackNavigator({ ...@@ -48,6 +51,9 @@ const MainNavigator = createStackNavigator({
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' } }, Approval: { screen: Approval, navigationOptions: { title: 'Approval' } },
MenuApproval: { screen: MenuApproval, navigationOptions: { title: 'Menu Approval' } },
MenuApproval2: { screen: MenuApproval2, navigationOptions: { title: 'Menu Approval' } },
MenuApproval3: { screen: MenuApproval3, navigationOptions: { title: 'Menu Approval' } },
// LatihanDragDrop: { screen: LatihanDragDrop, navigationOptions: { title: 'Latihan'}} // LatihanDragDrop: { screen: LatihanDragDrop, navigationOptions: { title: 'Latihan'}}
}, { }, {
headerMode: 'screen', headerMode: 'screen',
......
...@@ -44,11 +44,18 @@ const create = () => { ...@@ -44,11 +44,18 @@ const create = () => {
const login = (value) => POST('auth/login', value) const login = (value) => POST('auth/login', value)
const getListClar = (value) => api.post('demo/get_list_clar', value) const getListClar = (value) => api.post('demo/get_list_clar', value)
const postPenerimaan = (value) => POST('demo/accepted', value)
const postPenolakan = (value) => POST('demo/rejecting_accept', 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 getListAppraisal = (value) => POST('demo/get_list_appraisal', value)
const postDraftAppraisal = (value) => POST('demo/drafting_appraisal', value)
const postAppraisal = (value) => POST('demo/appraisal', value)
const getListApproval = (value) => POST('demo/get_list_approval', value) const getListApproval = (value) => POST('demo/get_list_approval', value)
const postApproval = (value) => POST('demo/approval', value)
const postRejectApproval = (value) => POST('demo/rejecting_approval', value)
const postApprovalDetail = (value) => POST('demo/approval_detail', value)
const getHistory = () => GET('demo/get_history') const getHistory = () => GET('demo/get_history')
...@@ -60,7 +67,14 @@ const create = () => { ...@@ -60,7 +67,14 @@ const create = () => {
getUserWarehouse, getUserWarehouse,
getListAppraisal, getListAppraisal,
getListApproval, getListApproval,
getHistory getHistory,
postPenerimaan,
postAppraisal,
postApproval,
postPenolakan,
postDraftAppraisal,
postRejectApproval,
postApprovalDetail
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment