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