import React, { useState } from 'react'; // Fictional commercial data modeled closely on the Project N-7 evaluation rules and spreadsheet audit trail. const INITIAL_BIDDERS = [ { id: 'Bidder A', name: 'Bidder A (Al-Falah EPC)', lumpSum: 42000000, workUnits: 4500000, laborCost: 3100000, equipCost: 2200000, demobPct: 2.15, formOfBidDiff: 0, compliance: 'PASS' }, { id: 'Bidder B', name: 'Bidder B (Gulf Industrial)', lumpSum: 43500000, workUnits: 4700000, laborCost: 2900000, equipCost: 2100000, demobPct: 2.30, formOfBidDiff: -1240000, compliance: 'PASS' }, { id: 'Bidder C', name: 'Bidder C (Red Sea Constructors)', lumpSum: 39500000, workUnits: 4200000, laborCost: 3400000, equipCost: 1800000, demobPct: 0.79, formOfBidDiff: 150000, compliance: 'FAIL (Demob < 2.0%)' }, { id: 'Bidder D', name: 'Bidder D (Neom Pioneers)', lumpSum: 41800000, workUnits: 4600000, laborCost: 3200000, equipCost: 2300000, demobPct: 2.12, formOfBidDiff: 0, compliance: 'PASS' }, { id: 'Bidder E', name: 'Bidder E (Saudi Engineering)', lumpSum: 45000000, workUnits: 4100000, laborCost: 2800000, equipCost: 2000000, demobPct: 2.08, formOfBidDiff: -50000, compliance: 'PASS' }, { id: 'Bidder F', name: 'Bidder F (Apex Infrastructure)', lumpSum: 38900000, workUnits: 4300000, laborCost: 3000000, equipCost: 1900000, demobPct: 1.97, formOfBidDiff: 0, compliance: 'FAIL (Demob < 2.0%)' } ]; export default function App() { // Analytical & Parametric Assumptions state variables const [outlierThreshold, setOutlierThreshold] = useState(50); // in percent const [offer1Pct, setOffer1Pct] = useState(85); const [offer2Pct, setOffer2Pct] = useState(90); const [offer3Pct, setOffer3Pct] = useState(95); const [winningBidderId, setWinningBidderId] = useState('Bidder B'); const [bidders, setBidders] = useState(INITIAL_BIDDERS); // Simple state for creating a new custom bid / modifying existing rates const [selectedBidderData, setSelectedBidderData] = useState(INITIAL_BIDDERS[1]); // defaults to Bidder B // Format currency const formatSR = (val) => { return new Intl.NumberFormat('en-US', { style: 'currency', currency: 'SAR', maximumFractionDigits: 0 }).format(val).replace('SAR', 'SR'); }; // Modify any bidder's figures on the fly const handleBidderValueChange = (field, val) => { const numericValue = parseFloat(val) || 0; const updatedBidders = bidders.map(b => { if (b.id === selectedBidderData.id) { const updated = { ...b, [field]: numericValue }; // Recalculate basic compliance label for demo if (field === 'demobPct') { updated.compliance = numericValue >= 2.0 ? 'PASS' : 'FAIL (Demob < 2.0%)'; } return updated; } return b; }); setBidders(updatedBidders); setSelectedBidderData(updatedBidders.find(b => b.id === selectedBidderData.id)); }; // Calculates the cumulative evaluated price const getEvaluatedPrice = (bidder) => { return bidder.lumpSum + bidder.workUnits + bidder.laborCost + bidder.equipCost; }; // Sort and rank bidders based on compliance and evaluated cost // Note: Standard evaluation rule specifies lowest evaluated compliant bidder is target. const rankedBidders = [...bidders].sort((a, b) => getEvaluatedPrice(a) - getEvaluatedPrice(b)); const winningBidder = bidders.find(b => b.id === winningBidderId) || bidders[0]; const winningEvaluatedPrice = getEvaluatedPrice(winningBidder); // Company Estimate representation (Calculated from average of non-outliers) const averageEvaluatedPrice = bidders.reduce((sum, b) => sum + getEvaluatedPrice(b), 0) / bidders.length; // Dynamic Negotiation Targets const targetOffer1 = winningEvaluatedPrice * (offer1Pct / 100); const targetOffer2 = winningEvaluatedPrice * (offer2Pct / 100); const targetOffer3 = winningEvaluatedPrice * (offer3Pct / 100); return (
Interactive Commercial Evaluation Board for Team Review & Decision-Making
Excludes bidder rates more than this % above/below initial average.
Modify the values directly below to evaluate the impact on total rankings and compliance immediately.
| Bidder | Lump Sum (SR) | Work Unit Rates (SR) | Labor Cost (SR) | Equip Cost (SR) | Evaluated Total (SR) | Demob % | FoB Diff (SR) |
|---|---|---|---|---|---|---|---|
| {b.name} | {formatSR(b.lumpSum)} | {formatSR(b.workUnits)} | {formatSR(b.laborCost)} | {formatSR(b.equipCost)} | {formatSR(totalCost)} | = 2.0 ? 'bg-emerald-500/10 text-emerald-400' : 'bg-rose-500/10 text-rose-400'}`}> {b.demobPct}% | 0 ? 'text-amber-400' : 'text-slate-400'}`}> {b.formOfBidDiff === 0 ? '0' : formatSR(b.formOfBidDiff)} |
Compare negotiation target offers based on your configured percentages of the evaluated bid of {formatSR(winningEvaluatedPrice)}.