This commit is contained in:
Abin Toppo
2026-01-23 11:02:56 +05:30
parent 76ba2b66f7
commit 78a74472dd
19 changed files with 175 additions and 154 deletions
+2 -1
View File
@@ -27,6 +27,7 @@ import {
} from 'lucide-react-native';
import moment from 'moment';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { showSuccessAlert, showToast } from '../../Constant/ShowDailog';
const InfoRow = ({ label, value }: any) => (
<View style={styles.row}>
@@ -78,7 +79,7 @@ const LiveTenderDetail = () => {
Accept: 'application/pdf',
});
const stat = await ReactNativeBlobUtil.fs.stat(path);
Alert.alert('Download complete', `File saved to: ${path}`);
showToast('Download complete');
setDownloadingId(null);
} catch (error: any) {
setDownloadingId(null);
+3 -5
View File
@@ -217,7 +217,7 @@ const ProceedToBidDetail = () => {
</View>
</View>
{/* Feature Flags */}
{/* Feature Flags
<View style={styles.section}>
<Text style={styles.sectionTitle}>Available Features</Text>
<View style={styles.chipsContainer}>
@@ -228,7 +228,7 @@ const ProceedToBidDetail = () => {
<FeatureChip label="QCBS" enabled={tenderData?.showQCBS} />
<FeatureChip label="LCS" enabled={tenderData?.showLCS} />
</View>
</View>
</View> */}
{/* Final Status */}
<View style={styles.finalStatusCard}>
@@ -266,9 +266,7 @@ const ProceedToBidDetail = () => {
) :
// <Text style={styles.footerText}>One time bidding is completed</Text>
<TouchableOpacity onPress={() => navigation.navigate('ViewTenderDetail', tenderData)} style={[styles.actionButton, { borderColor: colors.primary, borderWidth: 1 }]}>
<Text>View Tender Bid Detail</Text>
</TouchableOpacity>
null
}
</View>
</View>
+1 -1
View File
@@ -12,7 +12,7 @@ const PurchaseTenderTile = ({ item, onPressDetails }: any) => {
const scale = useSharedValue(1);
const elevation = useSharedValue(8);
const navigation = useNavigation<any>();
console.log("obj000ect",item)
const animatedStyle = useAnimatedStyle(() => ({
transform: [{ scale: scale.value }],
elevation: elevation.value,
+8 -6
View File
@@ -32,17 +32,19 @@ import ReactNativeBlobUtil from 'react-native-blob-util';
import { GET_DOCID } from '../../Services/BBPS/ApiUrls'
import { useSelector } from 'react-redux'
import EnvelopeCExcelPreview from './Component/EnvelopeCExcelPreview'
import { showSuccessAlert } from '../../Constant/ShowDailog'
const ViewTenderDetail = () => {
const route: any = useRoute()
const route = useRoute<any>()
console.log("jjo",route?.params?.tenderId)
const { data: tenderResponse }: any = useFetchLiveTenderById(route?.params?.tenderId);
const tender = tenderResponse?.data;
const tender = tenderResponse?.data || {};
console.log("tender data : ", tender)
const { data } = useFetchTenderBidDetailById(route?.params?.tenderId)
const Token = useSelector((state: any) => state.token.token)
console.log("dasdddddddddddddddddddd : ", data)
// console.log("dasdddddddddddddddddddd:", data)
const formatDate = (dateArray: any) => {
if (!dateArray) return "N/A";
const [year, month, day, hour, minute] = dateArray;
@@ -95,7 +97,7 @@ const ViewTenderDetail = () => {
const stat = await ReactNativeBlobUtil.fs.stat(path);
console.log('File size:', stat.size);
console.log("start : ", stat)
Alert.alert('Download complete', `File saved to: ${path}`);
showSuccessAlert(`Download complete `);
console.log("file response : ", response)
} catch (error: any) {
Alert.alert('Error', error?.message || 'Something went wrong while downloading.');
@@ -111,7 +113,7 @@ const ViewTenderDetail = () => {
<Mail size={24} color={colors.primary} />
<Text style={styles.sectionTitle}>{title}</Text>
</View>
{data.map((item: any, index: number) => (
{data&& data.map((item: any, index: number) => (
<View key={index} style={styles.envelopeItem}>
<View style={styles.envelopeHeader}>
<Text style={styles.labelName}>
@@ -278,7 +280,7 @@ const ViewTenderDetail = () => {
</Text>
{/* <Text style={styles.documentMeta}>Department User ID: {item.deptUserId}</Text> */}
</View>
{item.documentFileName && (
{item?.documentFileName && (
<TouchableOpacity style={styles.downloadButton}>
{/* <Download size={24} color={colors.primary} /> */}
</TouchableOpacity>
@@ -41,9 +41,9 @@ interface InfoRowProps {
const TenderBidding = () => {
const route = useRoute<any>();
const navigation = useNavigation();
console.log("-=-=-=-=-=",route)
console.log("ROUTE DATA",route)
const tenderId = useState<any>(route.params?.tenderId || null);
@@ -51,12 +51,11 @@ const TenderBidding = () => {
const bidData= tenderResponse?.data;
console.log(" --------------1",bidData)
const { data:tender, refetch } = useProceedToBid(route.params?.tenderId);
const tenderData= tender?.data
console.log(" --------------2",tenderData)
const [activeEnvelope, setActiveEnvelope] = useState<EnvelopeType>('A');
const [activeEnvelope, setActiveEnvelope] = useState<EnvelopeType>('A');
const [envelopForm, setEnvelopForm] = useState<EnvelopeFormState>({
A: {},
B: {},
@@ -331,7 +330,7 @@ const TenderBidding = () => {
const handleSubmitEnvelopeA = async () => {
console.log("hitting here ",envelopForm?.[activeEnvelope])
if (!validateEnvelope()) {
Alert.alert('Validation Error', 'Please fill all mandatory fields');
return;
@@ -339,7 +338,7 @@ const TenderBidding = () => {
const payload = buildEnvelopePayload();
if (envelopForm?.[activeEnvelope]?.[3]) {
console.log("----",)
const result = await handleSubmitEnvelopeFile(SUBMIT_ENVELOPE_FILE_A)
if (result && result?.statusCode === 200) {
@@ -441,7 +440,7 @@ const TenderBidding = () => {
// console.log( `bold ${tenderData?.[`tenderEnvelope${activeEnvelope}List`]}`,tenderData?.[`tenderEnvelope${activeEnvelope}List`])
return (
<View style={styles.container}>
<InsideHeader title="Tender Bidding Start" showArrow />
<InsideHeader title="Tender Bidding" showArrow />
<ScrollView contentContainerStyle={styles.scrollContainer}>
{/* Tender Info */}
<View style={styles.card}>
@@ -551,42 +550,43 @@ const TenderBidding = () => {
</View>
)}
<View style={styles.footer}>
{hasEnvelopes() && activeEnvelope !== 'C' ? (
<TouchableOpacity
style={styles.primaryButton}
onPress={() => {
<View style={styles.footer}>
{hasEnvelopes() && activeEnvelope !== 'C' &&
!(activeEnvelope === 'A' && bidData.envelopeASubmittStatus) &&
!(activeEnvelope === 'B' && bidData.envelopeBSubmittStatus) ? (
<TouchableOpacity
style={styles.primaryButton}
onPress={() => {
if (!check) {
Alert.alert('Info', 'check first terms & condition');
return;
}
if (activeEnvelope === 'A') {
handleSubmitEnvelopeA();
} else if (activeEnvelope === 'B') {
handleSubmitEnvelopeB();
}
}}
>
<Text style={styles.primaryButtonText}>
{loading ? (
<ActivityIndicator size={'small'} color={'#fff'} />
) : (
`Submit Bid (${activeEnvelope})`
)}
</Text>
</TouchableOpacity>
) : (
<TouchableOpacity
style={styles.secondaryButton}
onPress={() => navigation.goBack()}
>
<Text style={styles.secondaryButtonText}>Go Back</Text>
</TouchableOpacity>
)}
</View>
if (activeEnvelope === 'A') {
if (!check) {
Alert.alert('Info', 'check first terms & condition');
return;
}
handleSubmitEnvelopeA();
} else if (activeEnvelope === 'B') {
if (!check) {
Alert.alert('Info', 'check first terms & condition');
return;
}
handleSubmitEnvelopeB();
}
}}
>
<Text style={styles.primaryButtonText}>
{loading ? <ActivityIndicator size={'small'} color={'#fff'} /> : `Submit Bid (${activeEnvelope})`}
</Text>
</TouchableOpacity>
) : (
<TouchableOpacity
style={styles.secondaryButton}
onPress={() => navigation.goBack()}
>
<Text style={styles.secondaryButtonText}>Go Back</Text>
</TouchableOpacity>
)}
</View>
</ScrollView>
</View>