CANCERYS\kw093 3 дней назад
Родитель
Сommit
e3df7b3975
1 измененных файлов: 5 добавлений и 54 удалений
  1. +5
    -54
      src/app/api/stockTake/actions.ts

+ 5
- 54
src/app/api/stockTake/actions.ts Просмотреть файл

@@ -3,7 +3,7 @@
import { cache } from 'react';
import { serverFetchJson } from "@/app/utils/fetchUtil"; // 改为 serverFetchJson
import { BASE_API_URL } from "@/config/api";
import { stockTakeDebugLog } from "@/components/StockTakeManagement/stockTakeDebugLog";
//import { stockTakeDebugLog } from "@/components/StockTakeManagement/stockTakeDebugLog";

export interface RecordsRes<T> {
records: T[];
@@ -270,20 +270,7 @@ export const saveStockTakeRecord = async (
console.log('saveStockTakeRecord: request:', request);
console.log('saveStockTakeRecord: stockTakeId:', stockTakeId);
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;
} catch (error: any) {
// 尝试从错误响应中提取消息
@@ -319,19 +306,7 @@ export const batchSaveStockTakeRecords = cache(async (data: BatchSaveStockTakeRe
body: JSON.stringify(data),
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
})
// Add these interfaces and functions
@@ -381,19 +356,7 @@ export const saveApproverStockTakeRecord = async (
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;
} catch (error: any) {
if (error?.response) {
@@ -431,19 +394,7 @@ export const batchSaveApproverStockTakeRecordsAll = cache(async (data: BatchSave
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
})



Загрузка…
Отмена
Сохранить