From 46624ce480a3c14da21f39cc4ad5f7eecea2bb1e Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期四, 17 九月 2026 16:24:28 +0800
Subject: [PATCH] feat(mes): 优化生产批次和袋码管理功能

---
 src/api/mes/pro/batch/index.ts |   45 ++++++++++++++++++++++++++++++++++-----------
 1 files changed, 34 insertions(+), 11 deletions(-)

diff --git a/src/api/mes/pro/batch/index.ts b/src/api/mes/pro/batch/index.ts
index 01e4424..0f9aae7 100644
--- a/src/api/mes/pro/batch/index.ts
+++ b/src/api/mes/pro/batch/index.ts
@@ -18,16 +18,14 @@
   /** 鐢熶骇鎵规 */
   export interface Batch {
     id?: number; // 缂栧彿
-    code?: string; // 鎵规鍙凤紙鑷姩鐢熸垚锛�
-    itemId?: number; // 鍝佺锛堜骇鍝佺墿鏂欙級缂栧彿
-    itemCode?: string; // 鍝佺缂栫爜锛堝悗绔嫾鎺ワ級
-    itemName?: string; // 鍝佺鍚嶇О锛堝悗绔嫾鎺ワ級
-    itemSpecification?: string; // 鍝佺瑙勬牸锛堝悗绔嫾鎺ワ級
-    lineId?: number; // 浜х嚎缂栧彿
-    lineCode?: string; // 浜х嚎缂栫爜锛堝悗绔洖濉級
-    lineName?: string; // 浜х嚎鍚嶇О锛堝悗绔洖濉級
+    code?: string; // 鎵规鍙凤紙琛ュ綍姝e紡淇℃伅鍚庤嚜鍔ㄧ敓鎴愶級
+    tempCode?: string; // 涓存椂鎵规鐮侊紙棰勭敓鎴愪簩缁寸爜闃舵浣跨敤锛屾壂鐮佽拷婧吋瀹癸級
+    lineId?: number; // 浜х嚎缂栧彿锛堥〉闈㈠睍绀轰负銆屽姞宸ュ崟浣嶃�嶏級
+    lineCode?: string; // 浜х嚎缂栫爜锛堝悗绔洖濉紝椤甸潰宸查殣钘忥級
+    lineName?: string; // 浜х嚎鍚嶇О锛堝悗绔洖濉紝椤甸潰灞曠ず涓恒�屽姞宸ュ崟浣嶃�嶏級
+    processingTeam?: string; // 鍔犲伐鐝粍锛堟墜宸ュ~鍐欙級
     produceDate?: string; // 鐢熶骇鏃ユ湡
-    planQuantity?: number; // 璁″垝鏁伴噺
+    planQuantity?: number; // 鍔犲伐鏁伴噺锛堝師璁″垝鏁伴噺锛岄〉闈㈠睍绀轰负銆屽姞宸ユ暟閲忋�嶏級
     ownerUserId?: number; // 璐d换浜虹敤鎴风紪鍙�
     ownerUserName?: string; // 璐d换浜烘樀绉�
     bagQuantity?: number; // 宸茬敓鎴愯鐮佹暟閲�
@@ -36,12 +34,14 @@
     remark?: string; // 澶囨敞
     createTime?: string; // 鍒涘缓鏃堕棿
     workers?: BatchWorker[]; // 鐢熶骇浜哄憳閰嶇疆鍒楄〃
+    palletIds?: number[]; // 缁戝畾鎵樼洏缂栧彿鍒楄〃锛堜粎鏂板/琛ュ綍鎻愪氦鏃朵紶鍏ワ紝缁戝畾鏃舵壒娆$洿鎺ヨ繘鍏ョ敓浜т腑锛�
   }
 
   /** 鐢熶骇鎵规鎵爜杩芥函 */
   export interface BatchTrace {
     id?: number; // 鐢熶骇鎵规缂栧彿
-    code?: string; // 鎵规鍙凤紙浜岀淮鐮佸唴瀹癸級
+    code?: string; // 鎵规鍙凤紙琛ュ綍鍚庣殑姝e紡鎵规鍙凤級
+    tempCode?: string; // 涓存椂鎵规鐮侊紙浜岀淮鐮佸唴瀹癸紱鏈ˉ褰曚俊鎭椂灞曠ず锛�
     status?: number; // 鎵规鐘舵�侊紙瀛楀吀 mes_pro_batch_status锛�
     produceDate?: string; // 鐢熶骇鏃ユ湡
     lineCode?: string; // 浜х嚎缂栫爜
@@ -65,14 +65,21 @@
   /** 鐢熶骇鎵规鍒嗛〉鏌ヨ鍙傛暟 */
   export interface PageParams extends PageParam {
     code?: string;
-    itemId?: number;
+    tempCode?: string;
     lineId?: number;
     lineCode?: string;
     lineName?: string;
+    processingTeam?: string;
     ownerUserId?: number;
     status?: number;
     produceDate?: string[];
     createTime?: string[];
+  }
+
+  /** 棰勭敓鎴愭壒娆′簩缁寸爜杩斿洖椤� */
+  export interface PreGenerateResult {
+    id: number; // 鐢熶骇鎵规缂栧彿
+    tempCode: string; // 涓存椂鎵规鐮侊紙浜岀淮鐮佸唴瀹癸級
   }
 }
 
@@ -91,6 +98,22 @@
   );
 }
 
+/** 棰勭敓鎴愭壒娆′复鏃朵簩缁寸爜锛堜粎鐢熸垚涓存椂鎵规鐮侊紝涓嶅綍鍏ヤ笟鍔′俊鎭級 */
+export function preGenerateBatch(data: {
+  count: number;
+  remark?: string;
+}) {
+  return requestClient.post<MesProBatchApi.PreGenerateResult[]>(
+    '/mes/pro/batch/pre-generate',
+    data,
+  );
+}
+
+/** 琛ュ綍鎵规姝e紡淇℃伅锛堢敓鎴愭寮忔壒娆″彿锛� */
+export function fillBatchInfo(data: MesProBatchApi.Batch) {
+  return requestClient.put('/mes/pro/batch/fill-info', data);
+}
+
 /** 鏂板鐢熶骇鎵规锛堣嚜鍔ㄧ敓鎴愭壒娆″彿锛� */
 export function createBatch(data: MesProBatchApi.Batch) {
   return requestClient.post<number>('/mes/pro/batch/create', data);

--
Gitblit v1.9.3