Explorar el Código

update finshed QC part

MergeProblem1
CANCERYS\kw093 hace 9 horas
padre
commit
0389cbbc31
Se han modificado 3 ficheros con 38 adiciones y 3 borrados
  1. +5
    -1
      src/app/api/jo/actions.ts
  2. +31
    -1
      src/app/api/pickOrder/actions.ts
  3. +2
    -1
      src/components/ProductionProcess/ProductionProcessList.tsx

+ 5
- 1
src/app/api/jo/actions.ts Ver fichero

@@ -797,6 +797,7 @@ export const fetchJoborderProductProcessesPage = cache(async (params: {
bomIds?: number[] | null;
qcReady?: boolean | null;
type?: string | null;
includePutaway?: boolean | null;
page?: number;
size?: number;
}) => {
@@ -806,6 +807,7 @@ export const fetchJoborderProductProcessesPage = cache(async (params: {
jobOrderCode,
bomIds,
qcReady,
includePutaway,
type,
page = 0,
size = 50,
@@ -820,7 +822,9 @@ export const fetchJoborderProductProcessesPage = cache(async (params: {
if (bomIds && bomIds.length > 0) queryParts.push(`bomIds=${bomIds.join(",")}`);
if (qcReady !== undefined && qcReady !== null) queryParts.push(`qcReady=${qcReady}`);
if (type) queryParts.push(`type=${encodeURIComponent(type)}`);

if (includePutaway !== undefined && includePutaway !== null) {
queryParts.push(`includePutaway=${includePutaway}`);
}
queryParts.push(`page=${page}`);
queryParts.push(`size=${size}`);



+ 31
- 1
src/app/api/pickOrder/actions.ts Ver fichero

@@ -579,7 +579,7 @@ export const batchScan = async (data: BatchScanRequest) => {
},
);
console.log("📥 batchScan - Response:", response);
//console.log("📥 batchScan - Response:", response);
return response;
};
export const fetchDoPickOrderDetail = async (
@@ -765,6 +765,14 @@ export const fetchFGPickOrdersByUserId = async (userId: number) => {
);
return response;
};

/** DO workbench: FG headers from `delivery_order_pick_order`, not `do_pick_order_line`. */
export const fetchFGPickOrdersByUserIdWorkbench = async (userId: number) => {
return serverFetchJson<FGPickOrderResponse[]>(
`${BASE_API_URL}/pickOrder/fg-pick-orders-workbench/${userId}`,
{ method: "GET" },
);
};
export const updateSuggestedLotLineId = async (suggestedPickLotId: number, newLotLineId: number) => {
const response = await serverFetchJson<PostPickOrderResponse<UpdateSuggestedLotLineIdRequest>>(
`${BASE_API_URL}/suggestedPickLot/update-suggested-lot/${suggestedPickLotId}`,
@@ -824,6 +832,8 @@ export const recordPickExecutionIssue = async (data: PickExecutionIssueData) =>
revalidateTag("pickorder");
return result;
};


export const resuggestPickOrder = async (pickOrderId: number) => {
console.log("Resuggesting pick order:", pickOrderId);
const result = await serverFetchJson<PostPickOrderResponse>(
@@ -1134,6 +1144,26 @@ export const fetchAllPickOrderLotsHierarchical = cache(async (userId: number): P
};
}
});

/** DO workbench: hierarchical lots where header is `delivery_order_pick_order`. */
export const fetchAllPickOrderLotsHierarchicalWorkbench = cache(async (userId: number): Promise<any> => {
try {
const data = await serverFetchJson<any>(
`${BASE_API_URL}/pickOrder/all-lots-hierarchical-workbench/${userId}`,
{
method: "GET",
next: { tags: ["pickorder"] },
},
);
return data;
} catch (error) {
console.error("❌ Error fetching workbench hierarchical lot details:", error);
return {
pickOrder: null,
pickOrderLines: [],
};
}
});
export const fetchLotDetailsByDoPickOrderRecordId = async (doPickOrderRecordId: number): Promise<{
fgInfo: any;
pickOrders: any[];


+ 2
- 1
src/components/ProductionProcess/ProductionProcessList.tsx Ver fichero

@@ -258,6 +258,7 @@ const ProductProcessList: React.FC<ProductProcessListProps> = ({
itemCode: appliedSearch.itemCode,
jobOrderCode: appliedSearch.jobOrderCode,
qcReady,
includePutaway: qcReady ? true : null,
type: typeParam,
page,
size: PAGE_SIZE,
@@ -339,7 +340,7 @@ const ProductProcessList: React.FC<ProductProcessListProps> = ({
const closeNewModal = useCallback(() => {
// const response = updateJo({ id: 1, status: "storing" });
setOpenModal(false); // Close the modal first
fetchProcesses();
// fetchProcesses();
// setTimeout(() => {
// }, 300); // Add a delay to avoid immediate re-trigger of useEffect
}, [fetchProcesses]);


Cargando…
Cancelar
Guardar