| @@ -3,7 +3,7 @@ | |||||
| import { cache } from 'react'; | import { cache } from 'react'; | ||||
| import { serverFetchJson } from "@/app/utils/fetchUtil"; // 改为 serverFetchJson | import { serverFetchJson } from "@/app/utils/fetchUtil"; // 改为 serverFetchJson | ||||
| import { BASE_API_URL } from "@/config/api"; | import { BASE_API_URL } from "@/config/api"; | ||||
| import { stockTakeDebugLog } from "@/components/StockTakeManagement/stockTakeDebugLog"; | |||||
| //import { stockTakeDebugLog } from "@/components/StockTakeManagement/stockTakeDebugLog"; | |||||
| export interface RecordsRes<T> { | export interface RecordsRes<T> { | ||||
| records: T[]; | records: T[]; | ||||
| @@ -270,20 +270,7 @@ export const saveStockTakeRecord = async ( | |||||
| console.log('saveStockTakeRecord: request:', request); | console.log('saveStockTakeRecord: request:', request); | ||||
| console.log('saveStockTakeRecord: stockTakeId:', stockTakeId); | console.log('saveStockTakeRecord: stockTakeId:', stockTakeId); | ||||
| console.log('saveStockTakeRecord: stockTakerId:', stockTakerId); | console.log('saveStockTakeRecord: stockTakerId:', stockTakerId); | ||||
| // #region agent log | |||||
| stockTakeDebugLog( | |||||
| "actions.ts:saveStockTakeRecord", | |||||
| "server action saveStockTakeRecord ok", | |||||
| "H3", | |||||
| { | |||||
| stockTakeId, | |||||
| stockTakerId, | |||||
| inventoryLotLineId: request.inventoryLotLineId, | |||||
| hasRecordId: request.stockTakeRecordId != null, | |||||
| resultId: result?.id ?? null, | |||||
| } | |||||
| ); | |||||
| // #endregion | |||||
| return result; | return result; | ||||
| } catch (error: any) { | } catch (error: any) { | ||||
| // 尝试从错误响应中提取消息 | // 尝试从错误响应中提取消息 | ||||
| @@ -319,19 +306,7 @@ export const batchSaveStockTakeRecords = cache(async (data: BatchSaveStockTakeRe | |||||
| body: JSON.stringify(data), | body: JSON.stringify(data), | ||||
| headers: { "Content-Type": "application/json" }, | headers: { "Content-Type": "application/json" }, | ||||
| }) | }) | ||||
| // #region agent log | |||||
| stockTakeDebugLog( | |||||
| "actions.ts:batchSaveStockTakeRecords", | |||||
| "server batch picker result", | |||||
| "H4", | |||||
| { | |||||
| stockTakeId: data.stockTakeId, | |||||
| stockTakeSection: data.stockTakeSection, | |||||
| successCount: r.successCount, | |||||
| errorCount: r.errorCount, | |||||
| } | |||||
| ); | |||||
| // #endregion | |||||
| return r | return r | ||||
| }) | }) | ||||
| // Add these interfaces and functions | // Add these interfaces and functions | ||||
| @@ -381,19 +356,7 @@ export const saveApproverStockTakeRecord = async ( | |||||
| body: JSON.stringify(request), | body: JSON.stringify(request), | ||||
| }, | }, | ||||
| ); | ); | ||||
| // #region agent log | |||||
| stockTakeDebugLog( | |||||
| "actions.ts:saveApproverStockTakeRecord", | |||||
| "server action saveApproverStockTakeRecord ok", | |||||
| "H3", | |||||
| { | |||||
| stockTakeId, | |||||
| stockTakeRecordId: request.stockTakeRecordId ?? null, | |||||
| lastSelect: request.lastSelect ?? null, | |||||
| hasApproverQty: request.approverQty != null, | |||||
| } | |||||
| ); | |||||
| // #endregion | |||||
| return result; | return result; | ||||
| } catch (error: any) { | } catch (error: any) { | ||||
| if (error?.response) { | if (error?.response) { | ||||
| @@ -431,19 +394,7 @@ export const batchSaveApproverStockTakeRecordsAll = cache(async (data: BatchSave | |||||
| headers: { "Content-Type": "application/json" }, | headers: { "Content-Type": "application/json" }, | ||||
| } | } | ||||
| ) | ) | ||||
| // #region agent log | |||||
| stockTakeDebugLog( | |||||
| "actions.ts:batchSaveApproverStockTakeRecordsAll", | |||||
| "server batch approver-all result", | |||||
| "H4", | |||||
| { | |||||
| stockTakeId: data.stockTakeId, | |||||
| approverId: data.approverId, | |||||
| successCount: r.successCount, | |||||
| errorCount: r.errorCount, | |||||
| } | |||||
| ); | |||||
| // #endregion | |||||
| return r | return r | ||||
| }) | }) | ||||