diff --git a/src/app/api/stockTake/actions.ts b/src/app/api/stockTake/actions.ts index 34285e4..dc105cd 100644 --- a/src/app/api/stockTake/actions.ts +++ b/src/app/api/stockTake/actions.ts @@ -371,14 +371,24 @@ export interface BatchSaveApproverStockTakeRecordResponse { errorCount: number; errors: string[]; } - +/* export interface BatchSaveApproverStockTakeAllRequest { stockTakeId: number; approverId: number; variancePercentTolerance?: number | null; } - - +*/ +export interface BatchSaveApproverStockTakeAllRequest { + stockTakeId: number; + approverId: number; + // UI 用,batch 不應該用它來 skip + variancePercentTolerance?: number | null; + // 新增:讓 batch 只處理搜尋結果那批 + itemKeyword?: string | null; + warehouseKeyword?: string | null; + sectionDescription?: string | null; + stockTakeSections?: string | null; // 逗號字串 + } export const saveApproverStockTakeRecord = async ( request: SaveApproverStockTakeRecordRequest, stockTakeId: number diff --git a/src/components/StockTakeManagement/ApproverStockTakeAll.tsx b/src/components/StockTakeManagement/ApproverStockTakeAll.tsx index bc19a0f..eebcfc8 100644 --- a/src/components/StockTakeManagement/ApproverStockTakeAll.tsx +++ b/src/components/StockTakeManagement/ApproverStockTakeAll.tsx @@ -672,7 +672,13 @@ const ApproverStockTakeAll: React.FC = ({ const request: BatchSaveApproverStockTakeAllRequest = { stockTakeId: selectedSession.stockTakeId, approverId: currentUserId, - variancePercentTolerance: parseFloat(variancePercentTolerance || "0") || undefined, + itemKeyword: appliedFilters?.itemKeyword || null, + warehouseKeyword: appliedFilters?.warehouseKeyword || null, + sectionDescription: + appliedFilters?.sectionDescription && appliedFilters.sectionDescription !== "All" + ? appliedFilters.sectionDescription + : null, + stockTakeSections: appliedFilters?.stockTakeSession || null, }; const result = await batchSaveApproverStockTakeRecordsAll(request);