From 557c2b3c50027c2eb6fb9f7e562fc2c7b2b38203 Mon Sep 17 00:00:00 2001
From: quxin <592870522@qq.com>
Date: 星期五, 04 九月 2026 11:37:17 +0800
Subject: [PATCH] 修复: 生产领料后的退料应该是选择领料的记录,不是选择库存的记录(同时库存数据需要根据领料退料变动,比如库存100,领用80,然后领用80中退料30,库存应由原来的20变成50)

---
 src/api/mes/pro/ai/index.ts |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/api/mes/pro/ai/index.ts b/src/api/mes/pro/ai/index.ts
index d632e91..2215dc4 100644
--- a/src/api/mes/pro/ai/index.ts
+++ b/src/api/mes/pro/ai/index.ts
@@ -65,33 +65,33 @@
 const BASE = '/mes/pro/ai';
 
 /** AI 鐗╂枡鐭己棰勬祴 */
-export function predictMaterial(workOrderId: number) {
+export function predictMaterial(workOrderId?: number, mpsId?: number) {
   return requestClient.post<MesProAiApi.PredictMaterialRespVO>(
     `${BASE}/predict-material`,
-    { workOrderId },
+    { workOrderId, mpsId },
   );
 }
 
 /** AI 鐢熶骇鏃堕暱棰勬祴 */
-export function predictDuration(workOrderId: number) {
+export function predictDuration(workOrderId?: number, mpsId?: number) {
   return requestClient.post<MesProAiApi.PredictDurationRespVO>(
     `${BASE}/predict-duration`,
-    { workOrderId },
+    { workOrderId, mpsId },
   );
 }
 
 /** AI 鐢熶骇椋庨櫓棰勬祴 */
-export function predictRisk(workOrderId: number) {
+export function predictRisk(workOrderId?: number, mpsId?: number) {
   return requestClient.post<MesProAiApi.PredictRiskRespVO>(
     `${BASE}/predict-risk`,
-    { workOrderId },
+    { workOrderId, mpsId },
   );
 }
 
 /** AI 鎸夋椂浜や粯棰勬祴 */
-export function predictDelivery(workOrderId: number) {
+export function predictDelivery(workOrderId?: number, mpsId?: number) {
   return requestClient.post<MesProAiApi.PredictDeliveryRespVO>(
     `${BASE}/predict-delivery`,
-    { workOrderId },
+    { workOrderId, mpsId },
   );
 }

--
Gitblit v1.9.3