{"body": [{"tabs": [{"label": "Overview", "elements": [{"type": "table", "options": {"addButton": false, "tableName": "rfq_headers", "filterField": "rfq_id", "columnsToShow": ["title", "type", "status", "due_at", "category", "currency", "created_by_name"]}}, {"html": "<div class='divider my-2'>Attachments</div>", "type": "html"}, {"type": "table", "options": {"addButton": false, "tableName": "rfq_attachments", "filterField": "rfq_id", "columnsToShow": ["label", "filetype", "file_url", "include_when"]}}, {"html": "<div class='divider my-2'>Invites &amp; Responses</div>", "type": "html"}, {"type": "table", "options": {"addButton": false, "tableName": "rfq_invites", "filterField": "rfq_id", "columnsToShow": ["vendor_name", "contact_name", "contact_email", "contact_phone", "status", "sent_at", "opened_at", "responded_at"]}}, {"type": "table", "options": {"addButton": false, "tableName": "vendor_quotes", "filterField": "rfq_id", "columnsToShow": ["vendor_id", "status"]}}, {"html": "<div class='divider my-2'>Recent Activity</div>", "type": "html"}, {"type": "table", "options": {"addButton": false, "tableName": "rfq_events", "filterField": "rfq_id", "columnsToShow": ["type", "actor_type", "created_at"]}}, {"html": "<div id='rfq-sections-preview' class='prose max-w-none mt-2'></div>", "type": "html"}]}, {"label": "Items", "elements": [{"type": "button", "class": "btn btn-primary btn-sm", "label": "Add Item", "onClick": "addRfqItem"}, {"type": "table", "options": {"addButton": false, "tableName": "rfq_items", "inlineEdit": true, "filterField": "rfq_id", "columnsToShow": ["description", "quantity", "uom", "delivery_terms", "delivery_location", "is_optional"]}}]}, {"label": "Shortlist", "elements": [{"type": "button", "class": "btn btn-primary btn-sm", "label": "Add Vendor", "onClick": "addInvite"}, {"type": "table", "options": {"addButton": false, "tableName": "rfq_invites", "inlineEdit": true, "filterField": "rfq_id", "columnsToShow": ["vendor_name", "contact_name", "contact_email", "contact_phone", "status", "sent_at", "opened_at", "responded_at"]}}]}, {"label": "Invitations", "elements": [{"type": "button", "class": "btn btn-sm", "label": "Remind Pending", "onClick": "remindVendors"}, {"type": "table", "options": {"addButton": false, "tableName": "rfq_invites", "filterField": "rfq_id", "columnsToShow": ["vendor_name", "contact_name", "contact_email", "contact_phone", "status", "sent_at", "opened_at", "responded_at", "reminder_count"]}}]}, {"label": "Responses", "elements": [{"html": "<div class='flex items-center gap-2 mb-2'><button class='btn btn-sm btn-warning' onclick=\"openTenderBoxForSelected()\">Open Tender Box</button><span class='text-xs opacity-70'>(Available after RFQ is closed)</span></div>", "type": "html"}, {"type": "table", "options": {"addButton": false, "tableName": "vendor_quotes", "rowActions": [{"label": "Open Quote", "onClick": "openVendorQuoteDetail"}], "filterField": "rfq_id", "columnsToShow": ["vendor_name", "status"]}}]}, {"label": "Compare", "elements": [{"html": "<div id='rfq-compare-matrix'></div>", "type": "html"}]}, {"label": "Contracts", "elements": [{"type": "table", "options": {"addButton": false, "tableName": "rfq_contracts", "rowActions": [{"label": "Open", "onClick": "openContractDetail"}], "filterField": "rfq_id", "columnLabels": {"created_at": "Created", "total_value": "Total", "vendor_name": "Vendor", "contract_number": "Contract #"}, "columnsToShow": ["contract_number", "vendor_name", "status", "total_value", "currency", "created_at"]}}]}, {"label": "Timeline", "elements": [{"type": "table", "options": {"addButton": false, "tableName": "rfq_events", "filterField": "rfq_id"}}]}, {"label": "Messages", "elements": [{"html": "<div class='flex gap-2 mb-4'><button class='btn btn-sm' onclick=\"postInternalMessage()\">New Internal</button><button class='btn btn-sm btn-primary' onclick=\"postBroadcastMessage()\">New Broadcast</button></div>", "type": "html"}, {"html": "<div class='tabs tabs-boxed mb-4'><a class='tab tab-active' onclick=\"filterMessagesByType('all')\">All</a><a class='tab' onclick=\"filterMessagesByType('internal')\">Internal</a><a class='tab' onclick=\"filterMessagesByType('vendor')\">Vendor Q&A</a><a class='tab' onclick=\"filterMessagesByType('broadcast')\">Broadcast</a></div>", "type": "html"}, {"html": "<div id='rfq-messages-container' class='space-y-4 max-h-96 overflow-y-auto'></div>", "type": "html"}, {"id": "rfqMsgs", "type": "table", "hidden": true, "options": {"addButton": false, "tableName": "rfq_messages", "rowActions": [{"label": "Approve", "onClick": "approvePendingMessage"}, {"label": "Reply", "onClick": "replyToMessage"}], "filterField": "rfq_id", "columnLabels": {"created_at": "Date", "body_markdown": "Messages"}, "columnsToShow": ["vendor_name", "status", "created_at", "body_markdown"]}}]}], "type": "tabs"}], "title": "RFQ Detail", "footer": [{"type": "button", "label": "Close", "onClick": "closeModal"}], "header": [{"type": "button", "class": "btn btn-primary btn-sm", "label": "Generate Contract Draft", "onClick": "generateRfqContract"}, {"type": "button", "class": "btn btn-ghost btn-sm", "label": "Open Latest Contract", "onClick": "openLatestRfqContract"}]}