correction for envelop sumission
This commit is contained in:
@@ -22,6 +22,11 @@ export const apiCall = async <R, D = {}>(
|
||||
'Content-Type': contentType || 'application/json',
|
||||
},
|
||||
});
|
||||
console.log("method : ", method)
|
||||
console.log("url : ", url)
|
||||
console.log("params : ", params)
|
||||
console.log("data : ", data)
|
||||
|
||||
|
||||
return response.data;
|
||||
} catch (error: any) {
|
||||
|
||||
@@ -21,7 +21,6 @@ const NavigationString = {
|
||||
LiveTenderDetail:'LiveTenderDetail',
|
||||
AuctionDetail: 'AuctionDetail',
|
||||
Profile:'Profile',
|
||||
ViewTenderDetail:'ViewTenderDetail',
|
||||
ResetPassword:'ResetPassword',
|
||||
KycWebViewScreen:'KycWebViewScreen'
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ export default function MainStack() {
|
||||
<Stack.Screen name={NavigationString.Partnership} component={Screens.Partnership} options={option} />
|
||||
<Stack.Screen name={NavigationString.LiveTenderDetail} component={Screens.LiveTenderDetail} options={option} />
|
||||
<Stack.Screen name={NavigationString.ResetPassword} component={Screens.ResetPassword} options={option} />
|
||||
<Stack.Screen name={NavigationString.ViewTenderDetail} component={Screens.ViewTenderDetail} options={option} />
|
||||
<Stack.Screen name={NavigationString.KycWebViewScreen} component={Screens.KycWebViewScreen} options={option} />
|
||||
</Stack.Navigator>
|
||||
);
|
||||
|
||||
@@ -71,8 +71,6 @@ const LiveTender = () => {
|
||||
if (isLoading) {
|
||||
return <Skelton />;
|
||||
}
|
||||
|
||||
console.log("data live : ", data )
|
||||
return (
|
||||
<View style={{ flex: 1 }}>
|
||||
<SearchInput onChange={() => { }} placeholder="Search...." />
|
||||
|
||||
@@ -21,7 +21,7 @@ const LiveTenderTile: React.FC<LiveTenderTileProps> = ({
|
||||
tenderNumber,
|
||||
}) => {
|
||||
const navigation: any = useNavigation();
|
||||
const purchaseEnded = !moment().isAfter(moment(purchaseEnd, 'DD-MM-YYYY HH:mm:ss'));
|
||||
const purchaseEnded = moment().isAfter(moment(purchaseEnd, 'DD-MM-YYYY HH:mm:ss'));
|
||||
|
||||
const contractorIds = typeof data?.contractorId === 'string'
|
||||
? data.contractorId.split(',').map((id: any) => id.trim())
|
||||
|
||||
@@ -265,10 +265,7 @@ const ProceedToBidDetail = () => {
|
||||
</TouchableOpacity>
|
||||
|
||||
) :
|
||||
// <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>
|
||||
<Text style={styles.footerText}>One time bidding is completed</Text>
|
||||
}
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@@ -3,14 +3,16 @@ import { View, Text, FlatList, StyleSheet, TouchableOpacity, Alert } from 'react
|
||||
import { InsideHeader, Loader } from '../../Component/Index';
|
||||
import colors from '../../Constant/Color';
|
||||
import { CreditCard, Calendar, User, DollarSign, ArrowRight } from 'lucide-react-native';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import { useOfflineTenderPurchase } from '../../Services/BBPS/Hooks';
|
||||
import { StackActions, useNavigation } from '@react-navigation/native';
|
||||
import NavigationString from '../../Constant/NavigationString';
|
||||
import { showErrorAlert, showToast } from '../../Constant/ShowDailog';
|
||||
import { clearPurchaseTender } from '../../Redux/Slices/SelectedPurchaseTender';
|
||||
|
||||
const ProceedToPurTender = () => {
|
||||
const navigation: any = useNavigation();
|
||||
const Dispatch = useDispatch()
|
||||
const [loading, setLoading] = useState(false);
|
||||
const SelectedPurchaseList = useSelector((state: any) => state.selectPurchaseTender);
|
||||
|
||||
@@ -28,7 +30,7 @@ const ProceedToPurTender = () => {
|
||||
const handleOfflinePurchase = async () => {
|
||||
const orderNo = `ORD${Date.now()}`;
|
||||
const body = {
|
||||
tenderDetails: SelectedPurchaseList.map((item: any, index:number) => ({
|
||||
tenderDetails: SelectedPurchaseList.map((item: any, index: number) => ({
|
||||
gst: item.gst,
|
||||
regId: item.regId || 0,
|
||||
deptId: item.deptId || 1,
|
||||
@@ -53,9 +55,13 @@ const ProceedToPurTender = () => {
|
||||
mutate(body, {
|
||||
onSuccess: (res) => {
|
||||
console.log(res, '---------------------purchsase response');
|
||||
if(res.statusCode === 200 ){
|
||||
showToast(res.message);
|
||||
navigation.dispatch(StackActions.pop(2));
|
||||
if (res.statusCode === 200) {
|
||||
showToast(res.message);
|
||||
navigation.dispatch(StackActions.pop(2));
|
||||
Dispatch(
|
||||
clearPurchaseTender()
|
||||
);
|
||||
|
||||
}
|
||||
},
|
||||
onError: (error) => {
|
||||
@@ -124,7 +130,7 @@ const ProceedToPurTender = () => {
|
||||
<FlatList
|
||||
data={SelectedPurchaseList}
|
||||
renderItem={renderItem}
|
||||
keyExtractor={(item) => item.tenderId.toString()}
|
||||
keyExtractor={(item) => item?.tenderId?.toString()}
|
||||
contentContainerStyle={styles.container}
|
||||
/>
|
||||
</View>
|
||||
|
||||
@@ -1,631 +0,0 @@
|
||||
import { ScrollView, StyleSheet, Text, View, TouchableOpacity, SafeAreaView, Alert } from 'react-native'
|
||||
import React from 'react'
|
||||
import { InsideHeader } from '../../Component/Index'
|
||||
import colors from '../../Constant/Color'
|
||||
import { useFetchLiveTenderById, useFetchTenderBidDetailById, useFetchTenderById } from '../../Services/BBPS/Hooks'
|
||||
import { useRoute } from '@react-navigation/native'
|
||||
import {
|
||||
Mail,
|
||||
FileText,
|
||||
CheckCircle,
|
||||
AlertCircle,
|
||||
Briefcase,
|
||||
Calendar,
|
||||
Download,
|
||||
Folder,
|
||||
Hash,
|
||||
Receipt,
|
||||
IndianRupee,
|
||||
Building,
|
||||
Tag,
|
||||
Settings,
|
||||
PlayCircle,
|
||||
Square,
|
||||
Type,
|
||||
SpellCheck,
|
||||
File,
|
||||
Circle,
|
||||
ArrowLeft,
|
||||
FileSpreadsheet
|
||||
} from 'lucide-react-native'
|
||||
import ReactNativeBlobUtil from 'react-native-blob-util';
|
||||
import { GET_DOCID } from '../../Services/BBPS/ApiUrls'
|
||||
import { useSelector } from 'react-redux'
|
||||
import EnvelopeCExcelPreview from './Component/EnvelopeCExcelPreview'
|
||||
|
||||
const ViewTenderDetail = () => {
|
||||
const route: any = useRoute()
|
||||
const { data: tenderResponse }: any = useFetchLiveTenderById(route?.params?.tenderId);
|
||||
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)
|
||||
const formatDate = (dateArray: any) => {
|
||||
if (!dateArray) return "N/A";
|
||||
const [year, month, day, hour, minute] = dateArray;
|
||||
return `${day.toString().padStart(2, '0')}/${month.toString().padStart(2, '0')}/${year} ${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}`;
|
||||
};
|
||||
|
||||
const getLabelTypeText = (type: any) => {
|
||||
switch (type) {
|
||||
case 1: return "Text";
|
||||
case 2: return "Number";
|
||||
case 3: return "Document";
|
||||
case 4: return "Currency";
|
||||
default: return "Unknown";
|
||||
}
|
||||
};
|
||||
|
||||
const renderInfoCard = (title: string, value: string, IconComponent: any) => (
|
||||
<View style={styles.infoCard}>
|
||||
<View style={styles.infoHeader}>
|
||||
<IconComponent size={18} color={colors.primary} />
|
||||
<Text style={styles.infoTitle}>{title}</Text>
|
||||
</View>
|
||||
<Text style={styles.infoValue}>{value || "N/A"}</Text>
|
||||
</View>
|
||||
);
|
||||
|
||||
const handleDownload = async (doc: any) => {
|
||||
console.log("doc details : ", doc)
|
||||
try {
|
||||
const { dirs } = ReactNativeBlobUtil.fs;
|
||||
const path = `${dirs.DownloadDir}/${doc?.documentFileName}.pdf`;
|
||||
const downloadUrl = `${GET_DOCID}${doc?.docEnvelopeSeqId}`;
|
||||
console.log("download url : ", downloadUrl)
|
||||
const response = await ReactNativeBlobUtil.config({
|
||||
fileCache: true,
|
||||
addAndroidDownloads: {
|
||||
useDownloadManager: true,
|
||||
notification: true,
|
||||
path,
|
||||
mime: 'application/pdf',
|
||||
title: `${doc?.documentFileName}.pdf`,
|
||||
description: 'Downloading document',
|
||||
mediaScannable: true,
|
||||
},
|
||||
}).fetch('GET', downloadUrl, {
|
||||
Authentication:`Bearer ${Token?.token}`,
|
||||
Accept: 'application/pdf',
|
||||
});
|
||||
|
||||
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}`);
|
||||
console.log("file response : ", response)
|
||||
} catch (error: any) {
|
||||
Alert.alert('Error', error?.message || 'Something went wrong while downloading.');
|
||||
}
|
||||
};
|
||||
|
||||
const renderEnvelopeSection = (title: string, data: any, isDocument = false) => {
|
||||
if (!data || data.length === 0) return null;
|
||||
|
||||
return (
|
||||
<View style={styles.envelopeSection}>
|
||||
<View style={styles.sectionHeader}>
|
||||
<Mail size={24} color={colors.primary} />
|
||||
<Text style={styles.sectionTitle}>{title}</Text>
|
||||
</View>
|
||||
{data.map((item: any, index: number) => (
|
||||
<View key={index} style={styles.envelopeItem}>
|
||||
<View style={styles.envelopeHeader}>
|
||||
<Text style={styles.labelName}>
|
||||
{item.labelNameA || item.labelNameB || "Document"}
|
||||
</Text>
|
||||
{item.labelMandatoryA || item.labelMandatoryB ? (
|
||||
<Text style={styles.mandatoryTag}>Required</Text>
|
||||
) : null}
|
||||
</View>
|
||||
|
||||
{item.fieldValue && (
|
||||
<View style={[styles.fieldRow,{backgroundColor:colors.lightGray,borderRadius:20,padding:10}]}>
|
||||
<Type size={16} color={colors.gray} />
|
||||
<Text style={styles.fieldValue}>{item.fieldValue}</Text>
|
||||
</View>
|
||||
)}
|
||||
|
||||
{item.fieldValueInWord && (
|
||||
<View style={styles.fieldRow}>
|
||||
<SpellCheck size={16} color={colors.gray} />
|
||||
<Text style={styles.fieldValueInWord}>{item.fieldValueInWord}</Text>
|
||||
</View>
|
||||
)}
|
||||
|
||||
{item.documentFileName && (
|
||||
<TouchableOpacity style={styles.documentButton} onPress={()=>handleDownload(item)}>
|
||||
<File size={18} color={colors.white} />
|
||||
<Text style={styles.documentText}>{item.documentFileName}</Text>
|
||||
<Download size={18} color={colors.white} />
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<SafeAreaView style={styles.safeArea}>
|
||||
<View style={styles.container}>
|
||||
<InsideHeader title="Tender Bid Detail" showArrow />
|
||||
|
||||
<ScrollView
|
||||
style={styles.scrollView}
|
||||
showsVerticalScrollIndicator={false}
|
||||
contentContainerStyle={styles.scrollContent}
|
||||
>
|
||||
{/* Status Banner */}
|
||||
<View style={[
|
||||
styles.statusBanner,
|
||||
data?.status === "Success" ? styles.successBanner : styles.errorBanner
|
||||
]}>
|
||||
{data?.status === "Success" ? (
|
||||
<CheckCircle size={24} color={colors.success} />
|
||||
) : (
|
||||
<AlertCircle size={24} color={colors.error} />
|
||||
)}
|
||||
<View style={styles.statusContent}>
|
||||
<Text style={styles.statusTitle}>{data?.message}</Text>
|
||||
<Text style={styles.statusSubtitle}>Status: {data?.status}</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
{/* Tender Overview */}
|
||||
<View style={styles.overviewSection}>
|
||||
<View style={styles.sectionHeader}>
|
||||
<FileText size={24} color={colors.primary} />
|
||||
<Text style={styles.sectionTitle}>Tender Overview</Text>
|
||||
</View>
|
||||
|
||||
<View style={styles.gridContainer}>
|
||||
<View style={styles.gridRow}>
|
||||
{renderInfoCard("Tender No.", data?.data?.tenderNumber, Hash)}
|
||||
</View>
|
||||
<View style={styles.gridRow}>
|
||||
{renderInfoCard("NIT No.", data?.data?.nitNo, Receipt)}
|
||||
{renderInfoCard("EMD Amount", `₹${data?.data?.emdInFig}`, IndianRupee)}
|
||||
</View>
|
||||
<View style={styles.gridRow}>
|
||||
{renderInfoCard("PAC Value", `₹${data?.data?.pacValue}`, Building)}
|
||||
{renderInfoCard("Type", data?.data?.typesOfTender, Tag)}
|
||||
</View>
|
||||
</View>
|
||||
|
||||
{/* Work Description */}
|
||||
<View style={styles.descriptionCard}>
|
||||
<View style={styles.infoHeader}>
|
||||
<Briefcase size={20} color={colors.primary} />
|
||||
<Text style={styles.infoTitle}>Work Description</Text>
|
||||
</View>
|
||||
<Text style={styles.descriptionText}>{data?.data?.nameofWork}</Text>
|
||||
</View>
|
||||
|
||||
{/* Timeline */}
|
||||
<View style={styles.timelineCard}>
|
||||
<View style={styles.infoHeader}>
|
||||
<Calendar size={20} color={colors.primary} />
|
||||
<Text style={styles.infoTitle}>Timeline</Text>
|
||||
</View>
|
||||
<View style={styles.timelineRow}>
|
||||
<PlayCircle size={18} color={colors.success} />
|
||||
<View style={styles.timelineItem}>
|
||||
<Text style={styles.timelineLabel}>Start Date</Text>
|
||||
<Text style={styles.timelineValue}>
|
||||
{formatDate(data?.data?.submittedStartDate)}
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View style={styles.timelineRow}>
|
||||
<Square size={18} color={colors.error} />
|
||||
<View style={styles.timelineItem}>
|
||||
<Text style={styles.timelineLabel}>End Date</Text>
|
||||
<Text style={styles.timelineValue}>
|
||||
{formatDate(data?.data?.submittedEndDate)}
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
{/* Bid Options */}
|
||||
<View style={styles.optionsCard}>
|
||||
<View style={styles.infoHeader}>
|
||||
<Settings size={20} color={colors.primary} />
|
||||
<Text style={styles.infoTitle}>Bid Options</Text>
|
||||
</View>
|
||||
<View style={styles.optionsGrid}>
|
||||
<View style={[
|
||||
styles.optionBadge,
|
||||
data?.data?.bidWithdraw === "Allowed" ? styles.allowedBadge : styles.notAllowedBadge
|
||||
]}>
|
||||
<Text style={styles.optionText}>Bid Withdrawal</Text>
|
||||
<Text style={styles.optionStatus}>{data?.data?.bidWithdraw}</Text>
|
||||
</View>
|
||||
<View style={[
|
||||
styles.optionBadge,
|
||||
data?.data?.reBid === "Allowed" ? styles.allowedBadge : styles.notAllowedBadge
|
||||
]}>
|
||||
<Text style={styles.optionText}>Re-Bid</Text>
|
||||
<Text style={styles.optionStatus}>{data?.data?.reBid}</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
{/* Envelope Sections */}
|
||||
{data?.data?.showEA && renderEnvelopeSection("Envelope A", data?.data?.tenderEnvelopeAList)}
|
||||
{data?.data?.showEB && renderEnvelopeSection("Envelope B", data?.data?.tenderEnvelopeBList)}
|
||||
|
||||
{/* Envelope C - Document Section */}
|
||||
{data?.data?.showEC && data?.data?.tenderEnvelopeCViewBidResDTO && (
|
||||
<View style={styles.envelopeSection}>
|
||||
<View style={styles.sectionHeader}>
|
||||
<Mail size={24} color={colors.primary} />
|
||||
<Text style={styles.sectionTitle}>Envelope C</Text>
|
||||
</View>
|
||||
{data?.data?.tenderEnvelopeCViewBidResDTO.map((item: any, index: number) => (
|
||||
<View>
|
||||
<View key={index} style={styles.documentCard}>
|
||||
<Folder size={40} color={colors.primary} />
|
||||
<View style={styles.documentInfo}>
|
||||
<Text style={styles.documentName}>
|
||||
{item.documentFileName || "Document"}
|
||||
</Text>
|
||||
{/* <Text style={styles.documentMeta}>Department User ID: {item.deptUserId}</Text> */}
|
||||
</View>
|
||||
{item.documentFileName && (
|
||||
<TouchableOpacity style={styles.downloadButton}>
|
||||
{/* <Download size={24} color={colors.primary} /> */}
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
|
||||
</View>
|
||||
<EnvelopeCExcelPreview tenderId={tender[0]} buttonEnable={false}/>
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
)}
|
||||
|
||||
{/* Envelope Status Indicators */}
|
||||
<View style={styles.envelopeStatusSection}>
|
||||
<View style={styles.statusGrid}>
|
||||
<View style={styles.statusIndicator}>
|
||||
<View style={[
|
||||
styles.statusDot,
|
||||
data?.data?.showEA ? styles.activeDot : styles.inactiveDot
|
||||
]} />
|
||||
<Text style={styles.statusText}>Envelope A</Text>
|
||||
</View>
|
||||
<View style={styles.statusIndicator}>
|
||||
<View style={[
|
||||
styles.statusDot,
|
||||
data?.data?.showEB ? styles.activeDot : styles.inactiveDot
|
||||
]} />
|
||||
<Text style={styles.statusText}>Envelope B</Text>
|
||||
</View>
|
||||
<View style={styles.statusIndicator}>
|
||||
<View style={[
|
||||
styles.statusDot,
|
||||
data?.data?.showEC ? styles.activeDot : styles.inactiveDot
|
||||
]} />
|
||||
<Text style={styles.statusText}>Envelope C</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</ScrollView>
|
||||
</View>
|
||||
</SafeAreaView>
|
||||
)
|
||||
}
|
||||
|
||||
export default ViewTenderDetail
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
safeArea: {
|
||||
flex: 1,
|
||||
backgroundColor: colors.white,
|
||||
},
|
||||
container: {
|
||||
flex: 1,
|
||||
},
|
||||
scrollView: {
|
||||
flex: 1,
|
||||
},
|
||||
scrollContent: {
|
||||
paddingBottom: 30,
|
||||
},
|
||||
statusBanner: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
padding: 16,
|
||||
marginHorizontal: 16,
|
||||
marginTop: 16,
|
||||
borderRadius: 12,
|
||||
backgroundColor: colors.successLight,
|
||||
},
|
||||
successBanner: {
|
||||
backgroundColor: colors.successLight,
|
||||
},
|
||||
errorBanner: {
|
||||
backgroundColor: colors.error,
|
||||
},
|
||||
statusContent: {
|
||||
flex: 1,
|
||||
marginLeft: 12,
|
||||
},
|
||||
statusTitle: {
|
||||
fontSize: 14,
|
||||
fontWeight: '600',
|
||||
color: colors.darkText,
|
||||
marginBottom: 4,
|
||||
},
|
||||
statusSubtitle: {
|
||||
fontSize: 12,
|
||||
color: colors.gray,
|
||||
},
|
||||
overviewSection: {
|
||||
marginHorizontal: 16,
|
||||
marginTop: 24,
|
||||
},
|
||||
sectionHeader: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
marginBottom: 20,
|
||||
},
|
||||
sectionTitle: {
|
||||
fontSize: 20,
|
||||
fontWeight: '700',
|
||||
color: colors.darkText,
|
||||
marginLeft: 12,
|
||||
},
|
||||
gridContainer: {
|
||||
marginBottom: 20,
|
||||
},
|
||||
gridRow: {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between',
|
||||
marginBottom: 12,
|
||||
},
|
||||
infoCard: {
|
||||
flex: 1,
|
||||
backgroundColor: colors.white,
|
||||
padding: 16,
|
||||
borderRadius: 12,
|
||||
marginHorizontal: 4,
|
||||
borderWidth: 1,
|
||||
borderColor: colors.lightGray,
|
||||
},
|
||||
infoHeader: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
marginBottom: 8,
|
||||
},
|
||||
infoTitle: {
|
||||
fontSize: 12,
|
||||
fontWeight: '600',
|
||||
color: colors.gray,
|
||||
marginLeft: 8,
|
||||
},
|
||||
infoValue: {
|
||||
fontSize: 16,
|
||||
fontWeight: '700',
|
||||
color: colors.darkText,
|
||||
},
|
||||
descriptionCard: {
|
||||
backgroundColor: colors.white,
|
||||
padding: 16,
|
||||
borderRadius: 12,
|
||||
borderWidth: 1,
|
||||
borderColor: colors.lightGray,
|
||||
marginBottom: 16,
|
||||
},
|
||||
descriptionText: {
|
||||
fontSize: 14,
|
||||
color: colors.darkText,
|
||||
lineHeight: 20,
|
||||
marginTop: 8,
|
||||
},
|
||||
timelineCard: {
|
||||
backgroundColor: colors.white,
|
||||
padding: 16,
|
||||
borderRadius: 12,
|
||||
borderWidth: 1,
|
||||
borderColor: colors.lightGray,
|
||||
marginBottom: 16,
|
||||
},
|
||||
timelineRow: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
marginTop: 12,
|
||||
},
|
||||
timelineItem: {
|
||||
flex: 1,
|
||||
marginLeft: 12,
|
||||
},
|
||||
timelineLabel: {
|
||||
fontSize: 12,
|
||||
color: colors.gray,
|
||||
marginBottom: 4,
|
||||
},
|
||||
timelineValue: {
|
||||
fontSize: 14,
|
||||
fontWeight: '600',
|
||||
color: colors.darkText,
|
||||
},
|
||||
optionsCard: {
|
||||
backgroundColor: colors.primaryLight,
|
||||
padding: 16,
|
||||
borderRadius: 12,
|
||||
borderWidth: 1,
|
||||
borderColor: colors.lightGray,
|
||||
marginBottom: 24,
|
||||
},
|
||||
optionsGrid: {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between',
|
||||
marginTop: 12,
|
||||
},
|
||||
optionBadge: {
|
||||
flex: 1,
|
||||
alignItems: 'center',
|
||||
paddingVertical: 12,
|
||||
borderRadius: 8,
|
||||
marginHorizontal: 4,
|
||||
},
|
||||
allowedBadge: {
|
||||
backgroundColor: colors.successLight,
|
||||
borderWidth: 1,
|
||||
borderColor: colors.success,
|
||||
},
|
||||
notAllowedBadge: {
|
||||
backgroundColor: colors.error,
|
||||
borderWidth: 1,
|
||||
borderColor: colors.error,
|
||||
},
|
||||
optionText: {
|
||||
fontSize: 12,
|
||||
color: colors.gray,
|
||||
marginBottom: 4,
|
||||
},
|
||||
optionStatus: {
|
||||
fontSize: 14,
|
||||
fontWeight: '700',
|
||||
},
|
||||
envelopeSection: {
|
||||
marginHorizontal: 16,
|
||||
marginTop: 24,
|
||||
},
|
||||
envelopeItem: {
|
||||
backgroundColor: colors.white,
|
||||
padding: 16,
|
||||
borderRadius: 12,
|
||||
borderWidth: 1,
|
||||
borderColor: colors.lightGray,
|
||||
marginBottom: 12,
|
||||
},
|
||||
envelopeHeader: {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between',
|
||||
alignItems: 'center',
|
||||
marginBottom:8,
|
||||
},
|
||||
labelName: {
|
||||
fontSize: 16,
|
||||
fontWeight: '700',
|
||||
color: colors.primary,
|
||||
},
|
||||
mandatoryTag: {
|
||||
fontSize: 12,
|
||||
fontWeight: '600',
|
||||
color: colors.error,
|
||||
backgroundColor: colors.primaryHighlight,
|
||||
paddingHorizontal: 8,
|
||||
paddingVertical: 4,
|
||||
borderRadius: 6,
|
||||
},
|
||||
fieldRow: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
marginTop: 4,
|
||||
},
|
||||
fieldValue: {
|
||||
fontSize: 14,
|
||||
color: colors.darkText,
|
||||
marginLeft: 8,
|
||||
flex: 1,
|
||||
},
|
||||
fieldValueInWord: {
|
||||
fontSize: 13,
|
||||
color: colors.gray,
|
||||
fontStyle: 'italic',
|
||||
marginLeft: 8,
|
||||
flex: 1,
|
||||
},
|
||||
documentButton: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
backgroundColor: colors.primary,
|
||||
padding: 12,
|
||||
borderRadius: 8,
|
||||
marginTop: 12,
|
||||
},
|
||||
documentText: {
|
||||
flex: 1,
|
||||
fontSize: 14,
|
||||
color: colors.white,
|
||||
marginLeft: 12,
|
||||
marginRight: 8,
|
||||
},
|
||||
metaInfo: {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between',
|
||||
marginTop: 12,
|
||||
paddingTop: 12,
|
||||
borderTopWidth: 1,
|
||||
borderTopColor: colors.lightGray,
|
||||
},
|
||||
metaText: {
|
||||
fontSize: 12,
|
||||
color: colors.gray,
|
||||
},
|
||||
documentCard: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
backgroundColor: colors.white,
|
||||
padding: 16,
|
||||
borderRadius: 12,
|
||||
borderWidth: 1,
|
||||
borderColor: colors.lightGray,
|
||||
marginBottom: 12,
|
||||
},
|
||||
documentInfo: {
|
||||
flex: 1,
|
||||
marginLeft: 16,
|
||||
},
|
||||
documentName: {
|
||||
fontSize: 14,
|
||||
fontWeight: '600',
|
||||
color: colors.darkText,
|
||||
marginBottom: 4,
|
||||
},
|
||||
documentMeta: {
|
||||
fontSize: 12,
|
||||
color: colors.gray,
|
||||
},
|
||||
downloadButton: {
|
||||
padding: 8,
|
||||
},
|
||||
envelopeStatusSection: {
|
||||
marginHorizontal: 16,
|
||||
marginTop: 24,
|
||||
marginBottom: 30,
|
||||
},
|
||||
statusGrid: {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-around',
|
||||
},
|
||||
statusIndicator: {
|
||||
alignItems: 'center',
|
||||
},
|
||||
statusDot: {
|
||||
width: 12,
|
||||
height: 12,
|
||||
borderRadius: 6,
|
||||
marginBottom: 8,
|
||||
},
|
||||
activeDot: {
|
||||
backgroundColor: colors.success,
|
||||
},
|
||||
inactiveDot: {
|
||||
backgroundColor: colors.gray,
|
||||
},
|
||||
statusText: {
|
||||
fontSize: 12,
|
||||
color: colors.gray,
|
||||
},
|
||||
})
|
||||
@@ -41,21 +41,21 @@ interface InfoRowProps {
|
||||
const TenderBidding = () => {
|
||||
const route = useRoute<any>();
|
||||
const navigation = useNavigation();
|
||||
console.log("-=-=-=-=-=",route)
|
||||
console.log("-=-=-=-=-=", route)
|
||||
|
||||
console.log("ROUTE DATA",route)
|
||||
console.log("ROUTE DATA", route)
|
||||
|
||||
const tenderId = useState<any>(route.params?.tenderId || null);
|
||||
const tenderId = useState<any>(route.params?.tenderId || null);
|
||||
|
||||
const { data: tenderResponse, refetch: tenderRefetch }: any = useFetchTenderById(route.params?.tenderId);
|
||||
const { data: tenderResponse, refetch: tenderRefetch }: any = useFetchTenderById(route.params?.tenderId);
|
||||
|
||||
|
||||
const bidData= tenderResponse?.data;
|
||||
console.log(" --------------1",bidData)
|
||||
const { data:tender, refetch } = useProceedToBid(route.params?.tenderId);
|
||||
const tenderData= tender?.data
|
||||
const bidData = tenderResponse?.data;
|
||||
console.log(" --------------1", bidData)
|
||||
const { data: tender, refetch } = useProceedToBid(route.params?.tenderId);
|
||||
const tenderData = tender?.data
|
||||
|
||||
console.log(" --------------2",tenderData)
|
||||
console.log(" --------------2", tenderData)
|
||||
const [activeEnvelope, setActiveEnvelope] = useState<EnvelopeType>('A');
|
||||
const [envelopForm, setEnvelopForm] = useState<EnvelopeFormState>({
|
||||
A: {},
|
||||
@@ -331,7 +331,7 @@ const TenderBidding = () => {
|
||||
|
||||
|
||||
const handleSubmitEnvelopeA = async () => {
|
||||
console.log("hitting here ",envelopForm?.[activeEnvelope])
|
||||
console.log("hitting here ", envelopForm?.[activeEnvelope])
|
||||
if (!validateEnvelope()) {
|
||||
Alert.alert('Validation Error', 'Please fill all mandatory fields');
|
||||
return;
|
||||
@@ -438,7 +438,7 @@ const TenderBidding = () => {
|
||||
}
|
||||
console.log("bidData : ", bidData)
|
||||
console.log("tender data : ", tenderData)
|
||||
// console.log( `bold ${tenderData?.[`tenderEnvelope${activeEnvelope}List`]}`,tenderData?.[`tenderEnvelope${activeEnvelope}List`])
|
||||
// console.log( `bold ${tenderData?.[`tenderEnvelope${activeEnvelope}List`]}`,tenderData?.[`tenderEnvelope${activeEnvelope}List`])
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<InsideHeader title="Tender Bidding Start" showArrow />
|
||||
@@ -463,7 +463,7 @@ const TenderBidding = () => {
|
||||
<View style={styles.card}>
|
||||
<Text style={styles.sectionTitle}>Bid Envelopes</Text>
|
||||
<View style={styles.envelopeRow}>
|
||||
{tenderData?.showEA && (
|
||||
{tenderData?.showEA && (
|
||||
<EnvelopeButton
|
||||
title="Envelope A"
|
||||
envelopeType="A"
|
||||
@@ -474,29 +474,14 @@ const TenderBidding = () => {
|
||||
<EnvelopeButton
|
||||
title="Envelope B"
|
||||
envelopeType="B"
|
||||
onPress={() => {
|
||||
if (tenderData?.envelopeASubmittStatus) {
|
||||
|
||||
setActiveEnvelope('B')
|
||||
} else {
|
||||
Alert.alert('Info', 'Submit Envelop A First')
|
||||
}
|
||||
}}
|
||||
onPress={() => setActiveEnvelope('B')}
|
||||
/>
|
||||
)}
|
||||
{tenderData?.showEC && (
|
||||
<EnvelopeButton
|
||||
title="Envelope C"
|
||||
envelopeType="C"
|
||||
onPress={() => {
|
||||
if(tenderData?.showEB){ if (tenderData?.envelopeBSubmittStatus ) {
|
||||
setActiveEnvelope('C')
|
||||
} else {
|
||||
Alert.alert('Info', 'Submit Envelop B First')
|
||||
}}else{
|
||||
setActiveEnvelope('C')
|
||||
}
|
||||
}}
|
||||
onPress={() => setActiveEnvelope('C')}
|
||||
/>
|
||||
)}
|
||||
</View>
|
||||
@@ -504,7 +489,7 @@ const TenderBidding = () => {
|
||||
{/* Envelope A List */}
|
||||
|
||||
|
||||
{tenderData?.[`tenderEnvelope${activeEnvelope}List`]?.length > 0 && bidData?.envelopeB_Logs === null && (
|
||||
{tenderData?.[`tenderEnvelope${activeEnvelope}List`]?.length > 0 && (
|
||||
<View style={styles.card}>
|
||||
<Text style={styles.sectionTitle}>Envelope {activeEnvelope} Details</Text>
|
||||
<FlatList
|
||||
@@ -545,7 +530,7 @@ const TenderBidding = () => {
|
||||
</>
|
||||
) : (
|
||||
|
||||
<EnvelopeCExcelPreview tenderId={tenderData} buttonEnable={true}/>
|
||||
<EnvelopeCExcelPreview tenderId={tenderData} buttonEnable={true} />
|
||||
|
||||
)}
|
||||
</View>
|
||||
@@ -559,16 +544,16 @@ const TenderBidding = () => {
|
||||
|
||||
|
||||
if (activeEnvelope === 'A') {
|
||||
if (!check) {
|
||||
Alert.alert('Info', 'check first terms & condition');
|
||||
return;
|
||||
}
|
||||
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;
|
||||
}
|
||||
if (!check) {
|
||||
Alert.alert('Info', 'check first terms & condition');
|
||||
return;
|
||||
}
|
||||
handleSubmitEnvelopeB();
|
||||
}
|
||||
}}
|
||||
|
||||
@@ -20,7 +20,6 @@ import ProceedToPurTender from "./Tender/ProceedToPurTender";
|
||||
import PurchaseTenderList from "./Tender/PurchaseTenderList";
|
||||
import Tender from "./Tender/Tender";
|
||||
import TenderBidding from "./Tender/tenderBidding/TenderBidding";
|
||||
import ViewTenderDetail from "./Tender/ViewTenderDetail";
|
||||
|
||||
|
||||
const Screens = {
|
||||
@@ -44,7 +43,6 @@ const Screens = {
|
||||
Partnership,
|
||||
LiveTenderDetail,
|
||||
ProfileTab,
|
||||
ViewTenderDetail,
|
||||
ResetPassword,
|
||||
KycWebViewScreen
|
||||
}
|
||||
|
||||
@@ -389,9 +389,6 @@ export const uploadEnvelopeFile = async ({
|
||||
return data
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export const tenderDetails = async (tenderId:any ): Promise<any> => {
|
||||
const data = await apiCall<any>('get', `${GET_TENDER_DETAILS}${tenderId}`, );
|
||||
return data
|
||||
|
||||
Reference in New Issue
Block a user