Commit 692c6cd3 authored by Deni Rinaldi's avatar Deni Rinaldi

tambahan buat demo katanya

parent 3a4d696a
......@@ -62,14 +62,6 @@ export default class sampleMenuAppraisal extends Component {
this.setState({ dateUpdate, isDateTimePickerVisible: false })
}
draftData() {
api.create().postDraftAppraisal({
contract_id: this.state.data.contract_id
}).then((response) => {
this.props.navigation.navigate('Appraisal')
})
}
draftDataBack(){
api.create().postDraftAppraisal({
contract_id: this.state.data.contract_id
......@@ -231,7 +223,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Kode Warehouse</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ kodeWerehouse: e })}
style={styles.textInput}
......@@ -245,7 +237,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Nama Warehouse</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaWerehouse: e })}
style={styles.textInput}
......@@ -259,7 +251,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Kode Remote</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ kodeRemote: e })}
style={styles.textInput}
......@@ -273,7 +265,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Nama Remote</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -288,7 +280,7 @@ export default class sampleMenuAppraisal extends Component {
<Text style={{ fontSize: 13 }}>Tanggal Appraisal</Text>
</View>
<TouchableOpacity
style={styles.viewInputEnable}
style={styles.viewInputDisable}
onPress={() => this.setState({ isDateTimePickerVisiblePenerimaan: true })}
>
......@@ -311,7 +303,7 @@ export default class sampleMenuAppraisal extends Component {
<Text style={{ fontSize: 13 }}>Tanggal Masuk</Text>
</View>
<TouchableOpacity
style={styles.viewInputEnable}
style={styles.viewInputDisable}
onPress={() => this.setState({ isDateTimePickerVisiblePenerimaan: true })}
>
......@@ -333,7 +325,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Tipe Penilaian</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -347,7 +339,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Tipe Jaminan</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -361,7 +353,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Lokasi Unit</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -373,9 +365,9 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 2.5 }}>
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Keterangan Lokasi Unit</Text>
<Text style={{ fontSize: 13 }}>Ket Lokasi Unit</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -389,7 +381,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Nama Petugas Tarik</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -403,7 +395,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Int/Ext Kolektor</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -414,11 +406,11 @@ export default class sampleMenuAppraisal extends Component {
</View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 2.5 }}>
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Tgl Masuk Werehouse</Text>
<View style={{ height: 30, justifyContent: 'center', width: '45%' }}>
<Text style={{ fontSize: 13 }}>Tgl Masuk Warehouse</Text>
</View>
<TouchableOpacity
style={styles.viewInputEnable}
style={styles.viewInputDisable}
onPress={() => this.setState({ isDateTimePickerVisiblePenerimaan: true })}
>
......@@ -441,7 +433,7 @@ export default class sampleMenuAppraisal extends Component {
<Text style={{ fontSize: 13 }}>Tgl Pick up</Text>
</View>
<TouchableOpacity
style={styles.viewInputEnable}
style={styles.viewInputDisable}
onPress={() => this.setState({ isDateTimePickerVisiblePenerimaan: true })}
>
......@@ -464,7 +456,7 @@ export default class sampleMenuAppraisal extends Component {
<Text style={{ fontSize: 13 }}>Tgl Perubahan Data</Text>
</View>
<TouchableOpacity
style={styles.viewInputEnable}
style={styles.viewInputDisable}
onPress={() => this.setState({ isDateTimePickerVisiblePenerimaan: true })}
>
......@@ -515,7 +507,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Rekondisi STNK</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -526,11 +518,11 @@ export default class sampleMenuAppraisal extends Component {
</View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 2.5 }}>
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Tgl Jatuh Tempo STNK</Text>
<View style={{ height: 30, justifyContent: 'center', width: '40%' }}>
<Text style={{ fontSize: 13 }}>Jatuh Tempo STNK</Text>
</View>
<TouchableOpacity
style={styles.viewInputEnable}
style={styles.viewInputDisable}
onPress={() => this.setState({ isDateTimePickerVisiblePenerimaan: true })}
>
......@@ -552,7 +544,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>PKB</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -566,7 +558,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>SWDKLJJ</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -610,7 +602,7 @@ export default class sampleMenuAppraisal extends Component {
<Text style={{ fontSize: 13 }}>Tanggal Faktur</Text>
</View>
<TouchableOpacity
style={styles.viewInputEnable}
style={styles.viewInputDisable}
onPress={() => this.setState({ isDateTimePickerVisiblePenerimaan: true })}
>
......@@ -632,7 +624,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Nomor Faktur</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -674,7 +666,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Nomor Sertifikat</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -688,7 +680,7 @@ export default class sampleMenuAppraisal extends Component {
<Text style={{ fontSize: 13 }}>Tanggal Sertifikat</Text>
</View>
<TouchableOpacity
style={styles.viewInputEnable}
style={styles.viewInputDisable}
onPress={() => this.setState({ isDateTimePickerVisiblePenerimaan: true })}
>
......@@ -739,7 +731,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Nomor Polisi</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -752,7 +744,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Nomor Rangka</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -765,7 +757,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Nomor Mesin</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -778,7 +770,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>KM Terakhir</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -791,7 +783,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Kunci</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -804,7 +796,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Merk</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -817,7 +809,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Tipe</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -830,7 +822,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Model</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -843,7 +835,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Tahun</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -856,7 +848,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Warna</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -869,7 +861,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Harga Pasar</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -882,7 +874,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ justifyContent: 'center', width: '45%' }}>
<Text style={{ fontSize: 13 }}>Nilai Pembanding Rekondisi</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -895,7 +887,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ justifyContent: 'center', width: '45%' }}>
<Text style={{ fontSize: 13 }}>Pokok Pembiayaan</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -908,7 +900,7 @@ export default class sampleMenuAppraisal extends Component {
<View style={{ justifyContent: 'center', width: '45%' }}>
<Text style={{ fontSize: 13 }}>Harga Karoseri</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
......@@ -923,28 +915,7 @@ export default class sampleMenuAppraisal extends Component {
</CollapseBody>
</Collapse>
<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>
<View style={{ width: '100%', justifyContent: 'center', marginTop: 20, alignSelf: 'center', alignContent: 'flex-end', alignItems: 'center', marginBottom: 20 }}>
<AwesomeButton
backgroundColor={Colors.yellowBasic}
......@@ -960,7 +931,7 @@ export default class sampleMenuAppraisal extends Component {
progress={!this.state.progress}
onPress={next => {
setTimeout(() => {
this.props.navigation.navigate('MenuAppraisal2', { contract_id: this.state.data.contract_id })
this.props.navigation.navigate('MenuAppraisal2', { contract_id: this.state.data.contract_id, data: this.state.data })
next()
}, 300);
}}
......@@ -975,8 +946,8 @@ export default class sampleMenuAppraisal extends Component {
}
const styles = StyleSheet.create({
viewInputEnable: { width: '55%', borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, justifyContent: 'center', height: 30, borderRadius: 5 },
viewInputDisable: { width: '55%', backgroundColor: '#E6E6E6', justifyContent: 'center', height: 30, borderRadius: 5 },
viewInputEnable: { width: '50%', borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, justifyContent: 'center', height: 30, borderRadius: 5 },
viewInputDisable: { width: '50%', backgroundColor: '#E6E6E6', justifyContent: 'center', height: 30, borderRadius: 5 },
viewRangka: { width: '63%', borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, borderRadius: 5, padding: 5, height: 100, justifyContent: 'space-between' },
viewFotoUnit: { width: '63%', borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, borderRadius: 5, padding: 5, height: 150, justifyContent: 'space-between' },
textInput: { paddingHorizontal: 10, paddingVertical: 0, color: '#999999' },
......
import React, { Component } from 'react'
import { Text, View, TextInput, ScrollView, StyleSheet, TouchableOpacity, PermissionsAndroid, Image, Modal } from 'react-native'
import { Text, View, TextInput, ScrollView, StyleSheet, TouchableOpacity, PermissionsAndroid, Image, Modal, BackHandler } from 'react-native'
import ImagePicker from 'react-native-image-picker';
import { Container } from 'native-base'
import { RadioButton } from 'react-native-paper';
......@@ -15,17 +15,44 @@ export default class sampleMenuAppraisal2 extends Component {
constructor(props) {
super(props)
this.state = {
data: this.props.navigation.state.params.data || "",
date: new Date(),
checked: 'first',
progress: false,
viewerMesin: false,
imageRangka: '',
imageMesin: '',
mesinArray: []
mesinArray: [],
photo1: '',
photo2: '',
photo3: '',
photo4: '',
photo5: '',
photo6: '',
}
}
componentDidMount(){
componentDidMount() {
if (this.state.data != "") {
this.setState({
photo1: this.props.navigation.state.params.data.photo_unit[0],
photo2: this.props.navigation.state.params.data.photo_unit[1],
photo3: this.props.navigation.state.params.data.photo_unit[2],
photo4: this.props.navigation.state.params.data.photo_unit[3],
photo5: this.props.navigation.state.params.data.photo_unit[4],
photo6: this.props.navigation.state.params.data.photo_unit[5]
})
}
BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonClick);
}
componentWillUnmount() {
BackHandler.removeEventListener('hardwareBackPress', this.handleBackButtonClick);
}
handleBackButtonClick = () => {
this.props.navigation.goBack()
return true;
}
async requestCameraPermission(type) {
......@@ -61,8 +88,37 @@ export default class sampleMenuAppraisal2 extends Component {
try {
RNFetchBlob.fs.readFile(res.uri, 'base64')
.then((data) => {
if (type == 'rangka') {
this.setState({ imageRangka: res.uri }, () => alert(this.state.imageRangka))
if (type == '1') {
this.setState({
photo1: res.uri
})
} else if (type == '2') {
this.setState({
photo2: res.uri
})
} else if (type == '3') {
this.setState({
photo3: res.uri
})
} else if (type == '4') {
this.setState({
photo4: res.uri
})
} else if (type == '5') {
this.setState({
photo5: res.uri
})
} else if (type == '6') {
this.setState({
photo6: res.uri
})
} else if (type == 'rangka') {
this.setState({
data: {
...this.state.data,
chassis_number_photo: res.uri
}
})
} else {
let mesinArray = []
mesinArray.push({
......@@ -86,6 +142,7 @@ export default class sampleMenuAppraisal2 extends Component {
render() {
let { data } = this.state
return (
<Container style={{ flex: 1, paddingHorizontal: 20, paddingBottom: 20 }}>
......@@ -107,136 +164,199 @@ export default class sampleMenuAppraisal2 extends Component {
</View>
</Modal>
<ScrollView showsVerticalScrollIndicator={false} style={{ flex: 1 }} >
<View>
<View style={{ padding: 20, justifyContent: 'center', width: '100%' }}>
<Text style={{ alignSelf: 'center', fontSize: 18, fontWeight: 'bold' }}> Appraisal </Text>
</View>
<StepIndicator
labels={Array.labelAppraisal}
currentPosition={1}
customStyles={{
stepIndicatorSize: 20,
currentStepIndicatorSize: 20,
currentStepStrokeWidth: 1,
stepStrokeCurrentColor: Colors.yellowBasic,
stepIndicatorCurrentColor: 'white',
stepIndicatorLabelCurrentColor: Colors.yellowBasic,
currentStepLabelColor: Colors.yellowBasic,
stepStrokeUnFinishedColor: Colors.yellowBasic,
separatorUnFinishedColor: '#DEE1E5',
stepIndicatorUnFinishedColor: '#DEE1E5',
stepIndicatorLabelUnFinishedColor: '#ffffff',
labelColor: '#E6E6E6',
stepIndicatorFinishedColor: Colors.yellowBasic,
separatorFinishedColor: Colors.yellowBasic,
}}
stepCount={Array.labelStep.length}
/>
<ScrollView showsVerticalScrollIndicator={false} >
<View style={{ padding: 20, justifyContent: 'center', width: '100%' }}>
<Text style={{ alignSelf: 'center', fontSize: 18, fontWeight: 'bold' }}> Appraisal </Text>
</View>
<StepIndicator
labels={Array.labelAppraisal}
currentPosition={1}
customStyles={{
stepIndicatorSize: 20,
currentStepIndicatorSize: 20,
currentStepStrokeWidth: 1,
stepStrokeCurrentColor: Colors.yellowStatusBar,
stepIndicatorCurrentColor: 'white',
stepIndicatorLabelCurrentColor: Colors.yellowStatusBar,
currentStepLabelColor: Colors.yellowStatusBar,
stepStrokeUnFinishedColor: Colors.yellowStatusBar,
separatorUnFinishedColor: '#DEE1E5',
stepIndicatorUnFinishedColor: '#DEE1E5',
stepIndicatorLabelUnFinishedColor: '#ffffff',
labelColor: '#E6E6E6',
stepIndicatorFinishedColor: Colors.yellowStatusBar,
separatorFinishedColor: Colors.yellowStatusBar,
}}
stepCount={Array.labelAppraisal.length}
/>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 2.5, marginTop: 20 }}>
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Foto No Rangka</Text>
</View>
<TouchableOpacity style={styles.viewRangka} onPress={() => this.requestCameraPermission('rangka')}>
<View
style={{
width: '100%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
}}
>
{this.state.imageRangka == '' ?
<View style={{ width: '100%', height: '100%', justifyContent: 'center', alignContent: 'center' }}>
<Text style={{ color: 'rgba(237, 57, 99, .5)', textAlign: 'center', fontSize: 40 }}>+</Text>
</View> :
<Image
style={{ width: '100%', height: '100%', resizeMode: 'contain' }}
source={{ uri: this.state.imageRangka }}
/>
}
</View>
</TouchableOpacity>
</View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 2.5 }}>
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Foto No Mesin</Text>
</View>
<TouchableOpacity style={styles.viewRangka} onPress={() => { this.state.imageMesin != '' ? this.setState({ viewerMesin: true }) : this.requestCameraPermission('mesin') }}>
<View
style={{
width: '100%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
}}
>
{this.state.imageMesin == '' ?
<View style={{ width: '100%', height: '100%', justifyContent: 'center', alignContent: 'center' }}>
<Text style={{ color: 'rgba(237, 57, 99, .5)', textAlign: 'center', fontSize: 40 }}>+</Text>
</View> :
<Image
style={{ width: '100%', height: '100%', resizeMode: 'stretch' }}
source={{ uri: this.state.imageMesin }}
/>
}
</View>
</TouchableOpacity>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 2.5, marginTop: 20 }}>
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Foto No Rangka</Text>
</View>
<TouchableOpacity style={styles.viewRangka} onPress={() => null} activeOpacity={1}>
<View
style={{
width: '100%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
}}
>
{data.chassis_number_photo == '' ?
<View style={{ width: '100%', height: '100%', justifyContent: 'center', alignContent: 'center' }}>
<Text style={{ color: 'rgba(237, 57, 99, .5)', textAlign: 'center', fontSize: 40 }}>+</Text>
</View> :
<Image
style={{ width: '100%', height: '100%', resizeMode: 'cover' }}
source={{ uri: data.chassis_number_photo }}
/>
}
</View>
</TouchableOpacity>
</View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 2.5 }}>
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Foto Unit (6 Foto)</Text>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 2.5 }}>
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Foto No Mesin</Text>
</View>
<TouchableOpacity activeOpacity={1} style={styles.viewRangka} onPress={() => { this.state.imageMesin != '' ? this.setState({ viewerMesin: true }) : null }}>
<View
style={{
width: '100%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
}}
>
{data.engine_number_photo == '' ?
<View style={{ width: '100%', height: '100%', justifyContent: 'center', alignContent: 'center' }}>
<Text style={{ color: 'rgba(237, 57, 99, .5)', textAlign: 'center', fontSize: 40 }}>+</Text>
</View> :
<Image
style={{ width: '100%', height: '100%', resizeMode: 'stretch' }}
source={{ uri: data.engine_number_photo }}
/>
}
</View>
<View style={styles.viewFotoUnit}>
<View style={{ flexDirection: 'row', height: '45%', justifyContent: 'space-between' }}>
</TouchableOpacity>
</View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 2.5 }}>
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Foto Unit (6 Foto)</Text>
</View>
<View style={styles.viewFotoUnit}>
<View style={{ flexDirection: 'row', height: '40%', justifyContent: 'space-between' }}>
<TouchableOpacity activeOpacity={1} style={{ width: '30%', height: '80%', }} onPress={() => null}>
<View
style={{
width: '30%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
width: '100%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
}}
>
{this.state.photo1 == '' ?
<View style={{ width: '100%', height: '100%', justifyContent: 'center', alignContent: 'center' }}>
<Text style={{ color: 'rgba(237, 57, 99, .5)', textAlign: 'center', fontSize: 40 }}>+</Text>
</View> :
<Image
style={{ width: '100%', height: '100%', resizeMode: 'stretch' }}
source={{ uri: this.state.photo1 }}
/>
}
</View>
<Text style={{ fontSize: 10 }}>Bag. Depan</Text>
</TouchableOpacity>
<TouchableOpacity activeOpacity={1} style={{ width: '30%', height: '80%', }} onPress={() => null}>
<View
style={{
width: '30%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
width: '100%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
}}
>
{this.state.photo2 == '' ?
<View style={{ width: '100%', height: '100%', justifyContent: 'center', alignContent: 'center' }}>
<Text style={{ color: 'rgba(237, 57, 99, .5)', textAlign: 'center', fontSize: 40 }}>+</Text>
</View> :
<Image
style={{ width: '100%', height: '100%', resizeMode: 'stretch' }}
source={{ uri: this.state.photo2 }}
/>
}
</View>
<Text style={{ fontSize: 10, flexWrap: 'nowrap' }}>Bag. Belakang</Text>
</TouchableOpacity>
<TouchableOpacity activeOpacity={1} style={{ width: '30%', height: '80%', }} onPress={() => null}>
<View
style={{
width: '30%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
width: '100%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
}}
>
{this.state.photo3 == '' ?
<View style={{ width: '100%', height: '100%', justifyContent: 'center', alignContent: 'center' }}>
<Text style={{ color: 'rgba(237, 57, 99, .5)', textAlign: 'center', fontSize: 40 }}>+</Text>
</View> :
<Image
style={{ width: '100%', height: '100%', resizeMode: 'stretch' }}
source={{ uri: this.state.photo3 }}
/>
}
</View>
</View>
<Text style={{ fontSize: 10 }}>Depan Kanan</Text>
</TouchableOpacity>
</View>
<View style={{ flexDirection: 'row', height: '45%', justifyContent: 'space-between' }}>
<View style={{ flexDirection: 'row', height: '40%', justifyContent: 'space-between' }}>
<TouchableOpacity activeOpacity={1} style={{ width: '30%', height: '80%', }} onPress={() => null}>
<View
style={{
width: '30%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
width: '100%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
}}
>
{this.state.photo4 == '' ?
<View style={{ width: '100%', height: '100%', justifyContent: 'center', alignContent: 'center' }}>
<Text style={{ color: 'rgba(237, 57, 99, .5)', textAlign: 'center', fontSize: 40 }}>+</Text>
</View> :
<Image
style={{ width: '100%', height: '100%', resizeMode: 'stretch' }}
source={{ uri: this.state.photo4 }}
/>
}
</View>
<Text style={{ fontSize: 10 }}>Sisi Kanan</Text>
</TouchableOpacity>
<TouchableOpacity activeOpacity={1} style={{ width: '30%', height: '80%', }} onPress={() => null}>
<View
style={{
width: '30%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
width: '100%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
}}
>
{this.state.photo5 == '' ?
<View style={{ width: '100%', height: '100%', justifyContent: 'center', alignContent: 'center' }}>
<Text style={{ color: 'rgba(237, 57, 99, .5)', textAlign: 'center', fontSize: 40 }}>+</Text>
</View> :
<Image
style={{ width: '100%', height: '100%', resizeMode: 'stretch' }}
source={{ uri: this.state.photo5 }}
/>
}
</View>
<Text style={{ fontSize: 11 }}>Sisi Kiri</Text>
</TouchableOpacity>
<TouchableOpacity activeOpacity={1} style={{ width: '30%', height: '80%', }} onPress={() => null}>
<View
style={{
width: '30%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
width: '100%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
}}
>
{this.state.photo6 == '' ?
<View style={{ width: '100%', height: '100%', justifyContent: 'center', alignContent: 'center' }}>
<Text style={{ color: 'rgba(237, 57, 99, .5)', textAlign: 'center', fontSize: 40 }}>+</Text>
</View> :
<Image
style={{ width: '100%', height: '100%', resizeMode: 'stretch' }}
source={{ uri: this.state.photo6 }}
/>
}
</View>
</View>
<Text style={{ fontSize: 10 }}>Belakang Kiri</Text>
</TouchableOpacity>
</View>
</View>
</View>
</ScrollView>
<View style={{ width: '100%', marginTop: 20, marginBottom: 20, justifyContent: 'flex-end', alignItems: 'center' }}>
......@@ -271,6 +391,6 @@ const styles = StyleSheet.create({
viewInputEnable: { width: '63%', borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, justifyContent: 'center', height: 30, borderRadius: 5 },
viewInputDisable: { width: '63%', backgroundColor: '#E6E6E6', justifyContent: 'center', height: 30, borderRadius: 5 },
viewRangka: { width: '63%', borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, borderRadius: 5, padding: 10, height: 100, justifyContent: 'space-between' },
viewFotoUnit: { width: '63%', borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, borderRadius: 5, padding: 5, height: 150, justifyContent: 'space-between' },
viewFotoUnit: { width: '63%', borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, borderRadius: 5, paddingHorizontal: 10, paddingVertical:20, height: 150, justifyContent: 'space-between' },
textInput: { paddingHorizontal: 10, paddingVertical: 0, color: '#999999' },
})
import React, { Component } from 'react'
import { Text, View, TextInput, ScrollView, StyleSheet } from 'react-native'
import { Text, View, TextInput, ScrollView, StyleSheet, BackHandler } from 'react-native'
import { Collapse, CollapseHeader, CollapseBody } from "accordion-collapse-react-native";
import { Thumbnail, List, ListItem, Separator, Container } from 'native-base';
import { RadioButton } from 'react-native-paper';
......@@ -39,10 +39,31 @@ export default class sampleMenuAppraisal3 extends Component {
}
}
validasi(){
componentDidMount() {
BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonClick);
}
componentWillUnmount() {
BackHandler.removeEventListener('hardwareBackPress', this.handleBackButtonClick);
}
handleBackButtonClick = () => {
this.props.navigation.goBack()
return true;
}
validasi() {
api.create().postAppraisal({
contract_id: this.props.navigation.state.params.contract_id
}).then((response) => {
}).then((response) => {
this.props.navigation.navigate('Appraisal')
})
}
draftData() {
api.create().postDraftAppraisal({
contract_id: this.state.data.contract_id
}).then((response) => {
this.props.navigation.navigate('Appraisal')
})
}
......@@ -239,7 +260,7 @@ export default class sampleMenuAppraisal3 extends Component {
</View>
</View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 2.5 }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 2.5 }}>
<View style={{ height: 30, justifyContent: 'center', width: '50%' }}>
<Text style={{ fontSize: 13 }}>Shock Depan</Text>
</View>
......@@ -645,7 +666,29 @@ export default class sampleMenuAppraisal3 extends Component {
{/* <View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 2.5 }}>
</View> */}
<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
backgroundColor={Colors.yellowBasic}
backgroundShadow={'#DBDBDB'}
......@@ -660,7 +703,7 @@ export default class sampleMenuAppraisal3 extends Component {
progress={!this.state.progress}
onPress={next => {
setTimeout(() => {
this.validasi()
this.validasi()
next()
}, 300);
}}
......
......@@ -67,7 +67,7 @@ export default class Penerimaan extends Component {
return (
<View key={index} style={{ paddingHorizontal: 7 }}>
{!this.state.loading && (
<TouchableOpacity style={{ marginTop: 10, borderRadius: 20 }} onPress={() => this.props.navigation.navigate('MenuPenerimaan', { data: item })}>
<TouchableOpacity style={{ marginTop: 10, borderRadius: 20 }} onPress={() => this.props.navigation.navigate('MenuPenerimaan', { data: item, type: 'clar' })}>
<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>
......@@ -112,7 +112,7 @@ export default class Penerimaan extends Component {
containerStyle={{}}
style={{ backgroundColor: '#e4b300' }}
position="bottomRight"
onPress={() => this.props.navigation.navigate('MenuPenerimaan', { data: "" })}
onPress={() => this.props.navigation.navigate('MenuPenerimaan', { data: ""})}
>
<Icon name="add" />
</Fab>
......
import React, { Component } from 'react'
import { Text, View, TextInput, ScrollView, StyleSheet, TouchableOpacity } from 'react-native'
import { Text, View, TextInput, ScrollView, StyleSheet, TouchableOpacity, BackHandler } from 'react-native'
import { Container } from 'native-base'
import M from 'moment'
import { RadioButton } from 'react-native-paper';
import FontAwesome5Icon from 'react-native-vector-icons/FontAwesome5';
import StepIndicator from 'react-native-step-indicator';
import DateTimePicker from 'react-native-modal-datetime-picker';
import { Array } from '../../../library/Array';
import AwesomeButton from "react-native-really-awesome-button";
import { Menu, MenuOptions, MenuOption, MenuTrigger, renderers } from 'react-native-popup-menu';
import Colors from '../../../library/colors';
import api from '../../../service/api';
export default class sampleMenuPenerimaan extends Component {
constructor(props) {
......@@ -25,12 +28,75 @@ export default class sampleMenuPenerimaan extends Component {
tanggalPenerimaan: '',
tanggalUpdate: '',
isDateTimePickerVisible: false,
isDateTimePickerVisiblePenerimaan: false
isDateTimePickerVisiblePenerimaan: false,
arrayBranch: [],
branchName: '',
branchCode: '',
warehouseName: '',
warehouseCode: '',
arrayWarehouse: [],
contractId: ''
}
}
componentDidMount() {
// alert(JSON.stringify(this.props))
this.getBranch()
this.getWarehouse()
BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonClick);
}
componentWillUnmount() {
BackHandler.removeEventListener('hardwareBackPress', this.handleBackButtonClick);
}
handleBackButtonClick = () => {
this.props.navigation.goBack()
return true;
}
getBranch() {
api.create().getBranch().then((response) => {
// alert(JSON.stringify(response.data))
if (response.data.status == "success") {
let arrayBranch = []
response.data.data.map((item, index) => {
arrayBranch.push({
value: item.branch_id,
label: item.branch_name
})
})
this.setState({ arrayBranch })
}
})
}
getWarehouse() {
api.create().getWarehouse().then((response) => {
if (response.data.status == "success") {
let arrayWarehouse = []
response.data.data.map((item, index) => {
arrayWarehouse.push({
value: item.warehouse_id,
label: item.warehouse_name
})
})
this.setState({ arrayWarehouse })
}
})
}
getListClar(){
api.create().getListClarByBranch({
contract_id: Number(this.state.contractId),
warehouse_id: Number(this.state.warehouseCode),
branch_id: Number(this.state.branchCode)
}).then((response) => {
if (response.data.data != null) {
this.setState({ data: response.data.data })
} else {
this.setState({ data: [] })
}
})
}
handlePenerimaanDate(date) {
......@@ -75,21 +141,30 @@ export default class sampleMenuPenerimaan extends Component {
}}
stepCount={Array.labelStep.length}
/>
{/* <View style={{ backgroundColor: '#fcc000', height: 30, justifyContent: 'center', paddingHorizontal: 5, borderRadius: 20, width: '40%', marginBottom: 20 }}>
<Text style={{ fontWeight: '700', textAlign: 'center' }}>Data Kontrak</Text>
</View> */}
<View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 2.5, marginTop: 20 }}>
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Kode Cabang</Text>
</View>
<View style={this.state.data == "" ? styles.viewInputEnable : styles.viewInputDisable}>
<TextInput
style={styles.textInput}
value={this.state.data == "" ? null : String(data.branch_id)}
editable={this.state.data == "" ? true : false}
/>
<Menu>
<MenuTrigger
disabled={this.props.navigation.state.params.type != undefined ? true : false}>
<View style={this.state.branchName == "" ? { justifyContent: 'space-between', flexDirection: 'row', paddingHorizontal: 10 } : { alignItems: 'center', justifyContent: 'space-between', flexDirection: 'row', paddingHorizontal: 10 }}>
<Text style={{ color: 'black' }}>{this.state.data == "" ? this.state.branchCode : data.branch_id}</Text>
<FontAwesome5Icon size={20} color={'black'} name={'angle-down'} style={{}} />
</View>
</MenuTrigger>
<MenuOptions optionsContainerStyle={{ borderRadius: 5, paddingVertical: 10, paddingHorizontal: 10, backgroundColor: 'white', width: null, height: null, marginTop: 20 }}>
{this.state.arrayBranch.map((item, index) => {
return (
this.state.branchName != item.label && <MenuOption key={index} style={{ marginTop: index == 0 ? 0 : 5, borderBottomColor: '#dbdbdb', borderBottomWidth: .5 }} onSelect={() => { this.setState({ selectedBranch: item, branchName: item.label, branchCode: item.value }, () => this.getListClar()) }}>
<Text style={{ textAlign: 'center' }}>{item.label}</Text>
</MenuOption>
)
})}
</MenuOptions>
</Menu>
</View>
</View>
......@@ -97,11 +172,11 @@ export default class sampleMenuPenerimaan extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Nama Cabang</Text>
</View>
<View style={this.state.data == "" ? styles.viewInputEnable : styles.viewInputDisable}>
<View style={styles.viewInputDisable}>
<TextInput
style={styles.textInput}
value={this.state.data == "" ? null : String(data.warehouse_code)}
editable={this.state.data == "" ? true : false}
value={this.state.data == "" ? this.state.branchName : String(data.branch_name)}
editable={false}
/>
</View>
</View>
......@@ -113,8 +188,9 @@ export default class sampleMenuPenerimaan extends Component {
<View style={this.state.data == "" ? styles.viewInputEnable : styles.viewInputDisable}>
<TextInput
style={styles.textInput}
value={this.state.data == "" ? null : String(data.contract_number)}
value={this.state.data == "" ? this.state.contractId : String(data.contract_number)}
editable={this.state.data == "" ? true : false}
onChangeText={e => this.setState({ contractId: e}, ()=> this.getListClar())}
/>
</View>
</View>
......@@ -123,7 +199,7 @@ export default class sampleMenuPenerimaan extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>No Subkontrak</Text>
</View>
<View style={styles.viewInputDisable}>
<View style={this.state.data == "" ? styles.viewInputEnable : styles.viewInputDisable}>
<TextInput
style={styles.textInput}
value={this.state.data == "" ? null : String(data.sub_contract_number)}
......@@ -136,7 +212,7 @@ export default class sampleMenuPenerimaan extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Nama Nasabah</Text>
</View>
<View style={styles.viewInputDisable}>
<View style={this.state.data == "" ? styles.viewInputEnable : styles.viewInputDisable}>
<TextInput
style={styles.textInput}
value={this.state.data == "" ? null : String(data.nasabah_name)}
......@@ -149,13 +225,25 @@ export default class sampleMenuPenerimaan extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Kode Warehouse</Text>
</View>
<View style={styles.viewInputEnable}>
<TextInput
onChangeText={(e) => this.setState({ warehouse_name: e })}
style={styles.textInput}
value={this.state.data == "" ? null : String(data.warehouse_name)}
editable={this.state.data == "" ? true : false}
/>
<View style={this.state.data == "" ? styles.viewInputEnable : styles.viewInputDisable}>
<Menu>
<MenuTrigger
disabled={this.props.navigation.state.params.type != undefined ? true : false}>
<View style={this.state.warehouseName == "" ? { justifyContent: 'space-between', flexDirection: 'row', paddingHorizontal: 10 } : { alignItems: 'center', justifyContent: 'space-between', flexDirection: 'row', paddingHorizontal: 10 }}>
<Text style={{ color: 'black' }}>{this.state.data == "" ? this.state.warehouseCode : data.warehouse_id}</Text>
<FontAwesome5Icon size={20} color={'black'} name={'angle-down'} style={{}} />
</View>
</MenuTrigger>
<MenuOptions optionsContainerStyle={{ borderRadius: 5, paddingVertical: 10, paddingHorizontal: 10, backgroundColor: 'white', width: null, height: null, marginTop: 20 }} >
{this.state.arrayWarehouse.map((item, index) => {
return (
this.state.warehouseName != item.label && <MenuOption key={index} style={{ marginTop: index == 0 ? 0 : 5, borderBottomColor: '#dbdbdb', borderBottomWidth: .5 }} onSelect={() => { this.setState({ selectedWarehouse: item, warehouseName: item.label, warehouseCode: item.value }, () => this.getListClar()) }}>
<Text style={{ textAlign: 'center' }}>{item.label}</Text>
</MenuOption>
)
})}
</MenuOptions>
</Menu>
</View>
</View>
......@@ -163,12 +251,12 @@ export default class sampleMenuPenerimaan extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Nama Warehouse</Text>
</View>
<View style={styles.viewInputEnable}>
<View style={styles.viewInputDisable}>
<TextInput
onChangeText={(e) => this.setState({ namaWerehouse: e })}
style={styles.textInput}
value={data.warehouse_code}
editable
value={this.state.data == "" ? this.state.warehouseName : String(data.warehouse_name)}
editable={false}
/>
</View>
</View>
......@@ -279,8 +367,8 @@ export default class sampleMenuPenerimaan extends Component {
}
const styles = StyleSheet.create({
viewInputEnable: { width: '63%', borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, justifyContent: 'center', height: 30, borderRadius: 5 },
viewInputDisable: { width: '63%', backgroundColor: '#E6E6E6', justifyContent: 'center', height: 30, borderRadius: 5 },
viewInputEnable: { width: '55%', borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, justifyContent: 'center', height: 30, borderRadius: 5 },
viewInputDisable: { width: '55%', backgroundColor: '#E6E6E6', justifyContent: 'center', height: 30, borderRadius: 5 },
viewRangka: { width: '63%', borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, borderRadius: 5, padding: 5, height: 100, justifyContent: 'space-between' },
viewFotoUnit: { width: '63%', borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, borderRadius: 5, padding: 5, height: 150, justifyContent: 'space-between' },
textInput: { paddingHorizontal: 10, paddingVertical: 0, color: '#999999' },
......
import React, { Component } from 'react'
import { Text, View, TextInput, ScrollView, StyleSheet } from 'react-native'
import { Text, View, TextInput, ScrollView, StyleSheet, BackHandler } from 'react-native'
import { Container } from 'native-base'
import { RadioButton } from 'react-native-paper';
import StepIndicator from 'react-native-step-indicator';
......@@ -25,7 +25,16 @@ export default class sampleMenuPenerimaan2 extends Component {
}
componentDidMount(){
// alert(JSON.stringify(this.state.data))
BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonClick);
}
componentWillUnmount() {
BackHandler.removeEventListener('hardwareBackPress', this.handleBackButtonClick);
}
handleBackButtonClick = () => {
this.props.navigation.goBack()
return true;
}
render() {
......
import React, { Component } from 'react'
import { Text, View, TextInput, ScrollView, StyleSheet, TouchableOpacity, PermissionsAndroid, Image, Modal } from 'react-native'
import { Text, View, TextInput, ScrollView, StyleSheet, TouchableOpacity, PermissionsAndroid, Image, Modal, BackHandler } from 'react-native'
import ImagePicker from 'react-native-image-picker';
import { Container } from 'native-base'
import { RadioButton } from 'react-native-paper';
......@@ -45,8 +45,17 @@ export default class sampleMenuPenerimaan3 extends Component {
photo6: this.props.navigation.state.params.data.photo_unit[5]
})
}
// alert(JSON.stringify(this.state.data))
// alert(JSON.stringify(this.state.data)) componentDidMount(){
BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonClick);
}
componentWillUnmount() {
BackHandler.removeEventListener('hardwareBackPress', this.handleBackButtonClick);
}
handleBackButtonClick = () => {
this.props.navigation.goBack()
return true;
}
async requestCameraPermission(type) {
......@@ -119,8 +128,11 @@ export default class sampleMenuPenerimaan3 extends Component {
uri: res.uri
})
this.setState({
imageMesin: res.uri, mesinArray
}, () => alert(this.state.mesinArray))
data: {
...this.state.data,
engine_number_photo: res.uri
}
})
}
})
......@@ -169,12 +181,7 @@ export default class sampleMenuPenerimaan3 extends Component {
>
<View style={{ height: '85%' }}>
<ImageViewer
imageUrls={this.state.mesinArray}
// enableSwipeDown={true}
// index={this.state.Index}
// onSwipeDown={() => this.props.navigation.goBack()}
// onChange={(item) => this.next(item)}
// renderIndicator={() => (<View />)}
imageUrls={this.state.mesinArray}
/>
</View>
</Modal>
......@@ -234,7 +241,7 @@ export default class sampleMenuPenerimaan3 extends Component {
<View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Foto No Mesin</Text>
</View>
<TouchableOpacity style={styles.viewRangka} onPress={() => { this.state.imageMesin != '' ? this.setState({ viewerMesin: true }) : this.requestCameraPermission('mesin') }}>
<TouchableOpacity style={styles.viewRangka} onPress={() => { this.requestCameraPermission('mesin') }}>
<View
style={{
width: '100%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
......@@ -370,8 +377,7 @@ export default class sampleMenuPenerimaan3 extends Component {
</View>
<Text style={{ fontSize: 10 }}>Belakang Kiri</Text>
</TouchableOpacity>
</View>
</View>
</View>
</View>
</ScrollView>
......@@ -456,6 +462,6 @@ const styles = StyleSheet.create({
viewInputEnable: { width: '63%', borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, justifyContent: 'center', height: 30, borderRadius: 5 },
viewInputDisable: { width: '63%', backgroundColor: '#E6E6E6', justifyContent: 'center', height: 30, borderRadius: 5 },
viewRangka: { width: '63%', borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, borderRadius: 5, padding: 10, height: 100, justifyContent: 'space-between' },
viewFotoUnit: { width: '63%', borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, borderRadius: 5, padding: 10, height: 150, justifyContent: 'space-between' },
viewFotoUnit: { width: '63%', borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, borderRadius: 5, paddingHorizontal: 10, paddingVertical:20, height: 150, justifyContent: 'space-between' },
textInput: { paddingHorizontal: 10, paddingVertical: 0, color: '#999999' },
})
......@@ -57,6 +57,8 @@ const create = () => {
const postRejectApproval = (value) => POST('demo/rejecting_approval', value)
const postApprovalDetail = (value) => POST('demo/approval_detail', value)
const getHistory = () => GET('demo/get_history')
const getBranch = () => GET('demo/get_branch')
const getListClarByBranch = (value) => POST('demo/get_clar_by_branch_code', value)
return {
......@@ -74,7 +76,9 @@ const create = () => {
postPenolakan,
postDraftAppraisal,
postRejectApproval,
postApprovalDetail
postApprovalDetail,
getBranch,
getListClarByBranch
}
}
......
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