{ "type": "Page", "title": "Opportunity Management", "content": { "type": "VBox", "style": {"padding": "16px", "height": "100%"}, "children": [ { "type": "HBox", "justify": "space-between", "style": {"marginBottom": "16px"}, "children": [ {"type": "Text", "content": "Opportunity List", "style": {"fontSize": "20px", "fontWeight": "bold"}}, {"type": "Button", "text": "Add Opportunity", "variant": "primary", "leadingIcon": "add", "onclick": "openDialog('addOpportunityDialog')"} ] }, { "type": "CRUD", "id": "opportunityCRUD", "api": { "list": "api/opportunities_list.dspy", "create": "api/opportunities_create.dspy", "update": "api/opportunities_update.dspy", "delete": "api/opportunities_delete.dspy" }, "columns": [ {"field": "opportunity_name", "title": "Opportunity", "width": 200}, {"field": "customer_name", "title": "Customer", "width": 150}, {"field": "estimated_amount", "title": "Amount", "width": 120}, {"field": "current_stage", "title": "Stage", "width": 120}, {"field": "probability", "title": "Probability", "width": 100}, {"field": "expected_close_date", "title": "Close Date", "width": 120}, {"field": "owner_name", "title": "Owner", "width": 100}, {"field": "status", "title": "Status", "width": 80, "formatter": "code:opportunity_status"}, {"field": "created_at", "title": "Created", "width": 160} ], "style": {"flex": 1} }, { "type": "Dialog", "id": "addOpportunityDialog", "title": "Add Opportunity", "width": 600, "content": { "type": "Form", "id": "addOpportunityForm", "fields": [ {"field": "opportunity_name", "title": "Opportunity Name", "uitype": "TextField", "required": true}, {"field": "customer_id", "title": "Customer ID", "uitype": "TextField", "required": true}, {"field": "customer_name", "title": "Customer Name", "uitype": "TextField", "required": true}, {"field": "estimated_amount", "title": "Estimated Amount", "uitype": "TextField", "required": true}, {"field": "current_stage", "title": "Stage", "uitype": "TextField", "required": true}, {"field": "expected_close_date", "title": "Expected Close Date", "uitype": "DateField", "required": true}, {"field": "owner_id", "title": "Owner ID", "uitype": "TextField", "required": true}, {"field": "owner_name", "title": "Owner Name", "uitype": "TextField", "required": true}, {"field": "region", "title": "Region", "uitype": "TextField"}, {"field": "description", "title": "Description", "uitype": "TextField"} ], "actions": [ {"type": "Button", "text": "Cancel", "onclick": "closeDialog('addOpportunityDialog')"}, {"type": "Button", "text": "Submit", "variant": "primary", "onclick": "submitForm('addOpportunityForm', 'api/opportunities_create.dspy', 'addOpportunityDialog', 'opportunityCRUD')"} ] } } ] } }