Merge branch 'dev' of https://git.zeptic.in/rohit/Procurelinc into dev
This commit is contained in:
@@ -122,11 +122,11 @@ const ProceedToBidDetail = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
useFocusEffect(
|
useFocusEffect(
|
||||||
useCallback(() => {
|
useCallback(() => {
|
||||||
tenderRefetch();
|
tenderRefetch();
|
||||||
}, [tenderData?.tenderId])
|
}, [tenderData?.tenderId])
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={{ flex: 1, backgroundColor: colors.white }}>
|
<View style={{ flex: 1, backgroundColor: colors.white }}>
|
||||||
@@ -256,14 +256,12 @@ useFocusEffect(
|
|||||||
<View style={styles.footerSpace} />
|
<View style={styles.footerSpace} />
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<View style={styles.footer}>
|
<View style={styles.footer}>
|
||||||
{
|
{
|
||||||
tenderData?.proceedtoBid && !tenderData?.viewBid && tenderData?.biddingStatus && tenderData?.bidWithdrawStatus === false ? (
|
tenderData?.proceedtoBid && !tenderData?.viewBid && tenderData?.biddingStatus && tenderData?.bidWithdrawStatus === false ? (
|
||||||
|
|
||||||
<TouchableOpacity style={styles.proceedButton} onPress={handleStartBidding}>
|
<TouchableOpacity style={styles.proceedButton} onPress={handleStartBidding}>
|
||||||
<Text style={styles.proceedButtonText}>{loading ? <ActivityIndicator size={'small'} color={'#ffff'}/> : 'Start Bidding'}</Text>
|
<Text style={styles.proceedButtonText}>{loading ? <ActivityIndicator size={'small'} color={'#ffff'} /> : 'Start Bidding'}</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
) : <Text style={styles.footerText}>One time bidding is completed</Text>
|
) : <Text style={styles.footerText}>One time bidding is completed</Text>
|
||||||
|
|||||||
@@ -333,6 +333,7 @@ const TenderBidding = () => {
|
|||||||
try {
|
try {
|
||||||
const res = await apiCall('post', SUBMIT_ENVELOPE_A, payload) as any
|
const res = await apiCall('post', SUBMIT_ENVELOPE_A, payload) as any
|
||||||
|
|
||||||
|
console.log("res a without file : ", res)
|
||||||
if (res?.statusCode === 200) {
|
if (res?.statusCode === 200) {
|
||||||
navigation.goBack()
|
navigation.goBack()
|
||||||
ToastAndroid.show(res.message, ToastAndroid.SHORT)
|
ToastAndroid.show(res.message, ToastAndroid.SHORT)
|
||||||
@@ -346,6 +347,20 @@ const TenderBidding = () => {
|
|||||||
setLoading(false)
|
setLoading(false)
|
||||||
Alert.alert('Error', 'File upload failed. Please try again.')
|
Alert.alert('Error', 'File upload failed. Please try again.')
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
const res = await apiCall('post', SUBMIT_ENVELOPE_A, payload) as any
|
||||||
|
|
||||||
|
console.log("res a without file : ", res)
|
||||||
|
if (res?.statusCode === 200) {
|
||||||
|
navigation.goBack()
|
||||||
|
ToastAndroid.show(res.message, ToastAndroid.SHORT)
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("error A envelop submit : ", error)
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const handleSubmitEnvelopeB = async () => {
|
const handleSubmitEnvelopeB = async () => {
|
||||||
@@ -375,6 +390,19 @@ const TenderBidding = () => {
|
|||||||
setLoading(false)
|
setLoading(false)
|
||||||
Alert.alert('Error', 'File upload failed. Please try again.')
|
Alert.alert('Error', 'File upload failed. Please try again.')
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
const res = await apiCall('post', SUBMIT_ENVELOPE_B, payload) as any
|
||||||
|
|
||||||
|
if (res?.statusCode === 200) {
|
||||||
|
navigation.goBack()
|
||||||
|
ToastAndroid.show(res.message, ToastAndroid.SHORT)
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("error B envelop submit : ", error)
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const handleSubmitEnvelopeFile = async (url: string) => {
|
const handleSubmitEnvelopeFile = async (url: string) => {
|
||||||
@@ -395,7 +423,8 @@ const TenderBidding = () => {
|
|||||||
return res;
|
return res;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
console.log("bidData : ", bidData)
|
||||||
|
console.log("tender data : ", tenderData)
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<InsideHeader title="Tender Bidding Start" showArrow />
|
<InsideHeader title="Tender Bidding Start" showArrow />
|
||||||
@@ -420,7 +449,7 @@ const TenderBidding = () => {
|
|||||||
<View style={styles.card}>
|
<View style={styles.card}>
|
||||||
<Text style={styles.sectionTitle}>Bid Envelopes</Text>
|
<Text style={styles.sectionTitle}>Bid Envelopes</Text>
|
||||||
<View style={styles.envelopeRow}>
|
<View style={styles.envelopeRow}>
|
||||||
{tenderData?.showEA && (
|
{tenderData?.showEA && (
|
||||||
<EnvelopeButton
|
<EnvelopeButton
|
||||||
title="Envelope A"
|
title="Envelope A"
|
||||||
envelopeType="A"
|
envelopeType="A"
|
||||||
@@ -456,7 +485,7 @@ const TenderBidding = () => {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
{/* Envelope A List */}
|
{/* Envelope A List */}
|
||||||
{tenderData?.[`tenderEnvelope${activeEnvelope}List`]?.length > 0 && (
|
{tenderData?.[`tenderEnvelope${activeEnvelope}List`]?.length > 0 && bidData?.envelopeB_Logs !== null && (
|
||||||
<View style={styles.card}>
|
<View style={styles.card}>
|
||||||
<Text style={styles.sectionTitle}>Envelope {activeEnvelope} Details</Text>
|
<Text style={styles.sectionTitle}>Envelope {activeEnvelope} Details</Text>
|
||||||
<FlatList
|
<FlatList
|
||||||
@@ -519,7 +548,7 @@ const TenderBidding = () => {
|
|||||||
handleSubmitEnvelopeB();
|
handleSubmitEnvelopeB();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
// disabled={loading}
|
// disabled={loading}
|
||||||
>
|
>
|
||||||
<Text style={styles.primaryButtonText}>
|
<Text style={styles.primaryButtonText}>
|
||||||
{loading ? <ActivityIndicator size={'small'} color={'#fff'} /> : `Submit Bid (${activeEnvelope})`}
|
{loading ? <ActivityIndicator size={'small'} color={'#fff'} /> : `Submit Bid (${activeEnvelope})`}
|
||||||
|
|||||||
Reference in New Issue
Block a user