diff --git a/attached_assets/{1E5184AA-0C27-40F8-9F92-7F1FB32F9BF2}_1755170457859.png b/attached_assets/{1E5184AA-0C27-40F8-9F92-7F1FB32F9BF2}_1755170457859.png new file mode 100644 index 0000000..6b3fc10 Binary files /dev/null and b/attached_assets/{1E5184AA-0C27-40F8-9F92-7F1FB32F9BF2}_1755170457859.png differ diff --git a/attached_assets/{434F083D-7786-432D-ABE0-5CC7073C875D}_1755170333557.png b/attached_assets/{434F083D-7786-432D-ABE0-5CC7073C875D}_1755170333557.png new file mode 100644 index 0000000..313c9c8 Binary files /dev/null and b/attached_assets/{434F083D-7786-432D-ABE0-5CC7073C875D}_1755170333557.png differ diff --git a/client/src/pages/SavTickets.tsx b/client/src/pages/SavTickets.tsx index 88c634d..6de9732 100644 --- a/client/src/pages/SavTickets.tsx +++ b/client/src/pages/SavTickets.tsx @@ -57,6 +57,9 @@ export default function SavTickets() { const [priorityFilter, setPriorityFilter] = useState("all"); const [supplierFilter, setSupplierFilter] = useState("all"); const [showCreateModal, setShowCreateModal] = useState(false); + const [showDetailModal, setShowDetailModal] = useState(false); + const [showEditModal, setShowEditModal] = useState(false); + const [selectedTicket, setSelectedTicket] = useState(null); const [formData, setFormData] = useState({ supplierId: "", groupId: "", @@ -209,6 +212,31 @@ export default function SavTickets() { createTicketMutation.mutate(ticketData); }; + // Handle viewing ticket details + const handleViewTicket = (ticket: SavTicketWithRelations) => { + setSelectedTicket(ticket); + setShowDetailModal(true); + }; + + // Handle editing ticket + const handleEditTicket = (ticket: SavTicketWithRelations) => { + setSelectedTicket(ticket); + // Pre-fill form with ticket data + setFormData({ + supplierId: ticket.supplierId.toString(), + groupId: ticket.groupId.toString(), + productGencode: ticket.productGencode, + productReference: ticket.productReference || "", + productDesignation: ticket.productDesignation, + problemType: ticket.problemType, + problemDescription: ticket.problemDescription, + priority: ticket.priority, + clientName: ticket.clientName || "", + clientPhone: ticket.clientPhone || "" + }); + setShowEditModal(true); + }; + // Handle permission check without early return if (!canView) { return ( @@ -681,12 +709,12 @@ export default function SavTickets() {
- {canModify && ( <> -