mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-01 12:03:11 +00:00
Update dispatch for multi-WO support
- Pass WorkOrderIds array in dispatch API call - DispatchDetailModal shows WO list from junction table in header - dispatchToVendor API simplified to pass full payload
This commit is contained in:
parent
4de6c54fc0
commit
714376c61b
2 changed files with 7 additions and 7 deletions
|
|
@ -138,11 +138,8 @@ export const addDispatchComment = async (dispatchId, text, sendEmail = true) =>
|
|||
});
|
||||
};
|
||||
|
||||
export const dispatchToVendor = async (workOrderId, payload) => {
|
||||
return post(`${API_URL}/WorkOrder/DispatchToVendor`, {
|
||||
WorkOrderId: workOrderId,
|
||||
...payload,
|
||||
});
|
||||
export const dispatchToVendor = async (payload) => {
|
||||
return post(`${API_URL}/WorkOrder/DispatchToVendor`, payload);
|
||||
};
|
||||
|
||||
export const changeWorkOrderStatus = async (id, status) => {
|
||||
|
|
|
|||
|
|
@ -249,7 +249,9 @@ function DispatchDetailModal({ dispatchId, onClose, onUpdated }) {
|
|||
<div className="woDispatchHeader">
|
||||
<div>
|
||||
<h3>{dispatch.dispatchNumber || dispatch.poNumber} · {dispatch.vendorName}</h3>
|
||||
<span className="dispatchDetailSub">PO: {dispatch.poNumber} · WO: {dispatch.woNumber} · {dispatch.vendorEmail}</span>
|
||||
<span className="dispatchDetailSub">
|
||||
PO: {dispatch.poNumber} · {dispatch.workOrders?.length > 0 ? `${dispatch.workOrders.length} WO(s): ${dispatch.workOrders.map(w => w.woNumber).join(", ")}` : `WO: ${dispatch.woNumber}`} · {dispatch.vendorEmail}
|
||||
</span>
|
||||
</div>
|
||||
<button className="woDispatchClose" onClick={onClose}>×</button>
|
||||
</div>
|
||||
|
|
@ -406,7 +408,8 @@ function DispatchModal({ wo, onClose, onDispatched }) {
|
|||
if (!selectedId) { toast.error("Select a vendor"); return; }
|
||||
setSending(true);
|
||||
try {
|
||||
await dispatchToVendor(wo.id, {
|
||||
await dispatchToVendor({
|
||||
WorkOrderIds: [wo.id],
|
||||
VendorIds: [selectedId],
|
||||
NTEAmount: nteAmount ? parseFloat(nteAmount) : null,
|
||||
ScheduledDate: scheduledDate || null,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue