From 91c82965b2d987452ca276e3a03b48c8dcda2ae9 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期三, 19 八月 2026 11:47:26 +0800
Subject: [PATCH] config(env): 更新生产环境配置和公司名称
---
src/api/mes/pro/batch/index.ts | 136 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 136 insertions(+), 0 deletions(-)
diff --git a/src/api/mes/pro/batch/index.ts b/src/api/mes/pro/batch/index.ts
new file mode 100644
index 0000000..01e4424
--- /dev/null
+++ b/src/api/mes/pro/batch/index.ts
@@ -0,0 +1,136 @@
+import type { PageParam, PageResult } from '@vben/request';
+
+import { requestClient } from '#/api/request';
+import type { MesProBagCodeApi } from '#/api/mes/pro/bagCode';
+import type { MesProPalletApi } from '#/api/mes/pro/pallet';
+
+export namespace MesProBatchApi {
+ /** 鐢熶骇鎵规浜哄憳閰嶇疆 */
+ export interface BatchWorker {
+ id?: number; // 缂栧彿
+ batchId?: number; // 鎵规缂栧彿
+ userId?: number; // 鐢熶骇浜哄憳鐢ㄦ埛缂栧彿
+ userName?: string; // 鐢熶骇浜哄憳鏄电О
+ workerType?: number; // 宀椾綅绫诲瀷锛堝瓧鍏� mes_pro_batch_worker_type锛�
+ remark?: string; // 澶囨敞
+ }
+
+ /** 鐢熶骇鎵规 */
+ export interface Batch {
+ id?: number; // 缂栧彿
+ code?: string; // 鎵规鍙凤紙鑷姩鐢熸垚锛�
+ itemId?: number; // 鍝佺锛堜骇鍝佺墿鏂欙級缂栧彿
+ itemCode?: string; // 鍝佺缂栫爜锛堝悗绔嫾鎺ワ級
+ itemName?: string; // 鍝佺鍚嶇О锛堝悗绔嫾鎺ワ級
+ itemSpecification?: string; // 鍝佺瑙勬牸锛堝悗绔嫾鎺ワ級
+ lineId?: number; // 浜х嚎缂栧彿
+ lineCode?: string; // 浜х嚎缂栫爜锛堝悗绔洖濉級
+ lineName?: string; // 浜х嚎鍚嶇О锛堝悗绔洖濉級
+ produceDate?: string; // 鐢熶骇鏃ユ湡
+ planQuantity?: number; // 璁″垝鏁伴噺
+ ownerUserId?: number; // 璐d换浜虹敤鎴风紪鍙�
+ ownerUserName?: string; // 璐d换浜烘樀绉�
+ bagQuantity?: number; // 宸茬敓鎴愯鐮佹暟閲�
+ palletQuantity?: number; // 宸茬敓鎴愭墭鐩樼爜鏁伴噺
+ status?: number; // 鎵规鐘舵�侊紙瀛楀吀 mes_pro_batch_status锛�
+ remark?: string; // 澶囨敞
+ createTime?: string; // 鍒涘缓鏃堕棿
+ workers?: BatchWorker[]; // 鐢熶骇浜哄憳閰嶇疆鍒楄〃
+ }
+
+ /** 鐢熶骇鎵规鎵爜杩芥函 */
+ export interface BatchTrace {
+ id?: number; // 鐢熶骇鎵规缂栧彿
+ code?: string; // 鎵规鍙凤紙浜岀淮鐮佸唴瀹癸級
+ status?: number; // 鎵规鐘舵�侊紙瀛楀吀 mes_pro_batch_status锛�
+ produceDate?: string; // 鐢熶骇鏃ユ湡
+ lineCode?: string; // 浜х嚎缂栫爜
+ lineName?: string; // 浜х嚎鍚嶇О
+ ownerUserId?: number; // 璐d换浜虹敤鎴风紪鍙�
+ ownerUserName?: string; // 璐d换浜烘樀绉�
+ planQuantity?: number; // 璁″垝鏁伴噺
+ bagQuantity?: number; // 宸茬敓鎴愯鐮佹暟閲�
+ palletQuantity?: number; // 宸茬敓鎴愭墭鐩樼爜鏁伴噺
+ remark?: string; // 澶囨敞
+ itemId?: number; // 鍝佺锛堢墿鏂欙級缂栧彿
+ itemCode?: string; // 鍝佺缂栫爜
+ itemName?: string; // 鍝佺鍚嶇О
+ itemSpecification?: string; // 鍝佺瑙勬牸
+ workers?: BatchWorker[]; // 鐢熶骇浜哄憳閰嶇疆鍒楄〃
+ pallets?: MesProPalletApi.Pallet[]; // 鎵樼洏鐮佸垪琛�
+ bags?: MesProBagCodeApi.BagCode[]; // 琚嬬爜鍒楄〃锛堟渶澶氬墠 2000 鏉★紝鎸夎搴忓彿鍗囧簭锛�
+ bagTotal?: number; // 琚嬬爜鎬绘暟
+ }
+
+ /** 鐢熶骇鎵规鍒嗛〉鏌ヨ鍙傛暟 */
+ export interface PageParams extends PageParam {
+ code?: string;
+ itemId?: number;
+ lineId?: number;
+ lineCode?: string;
+ lineName?: string;
+ ownerUserId?: number;
+ status?: number;
+ produceDate?: string[];
+ createTime?: string[];
+ }
+}
+
+/** 鏌ヨ鐢熶骇鎵规鍒嗛〉 */
+export function getBatchPage(params: MesProBatchApi.PageParams) {
+ return requestClient.get<PageResult<MesProBatchApi.Batch>>(
+ '/mes/pro/batch/page',
+ { params },
+ );
+}
+
+/** 鏌ヨ鐢熶骇鎵规璇︽儏锛堝惈浜哄憳閰嶇疆锛� */
+export function getBatch(id: number) {
+ return requestClient.get<MesProBatchApi.Batch>(
+ `/mes/pro/batch/get?id=${id}`,
+ );
+}
+
+/** 鏂板鐢熶骇鎵规锛堣嚜鍔ㄧ敓鎴愭壒娆″彿锛� */
+export function createBatch(data: MesProBatchApi.Batch) {
+ return requestClient.post<number>('/mes/pro/batch/create', data);
+}
+
+/** 淇敼鐢熶骇鎵规 */
+export function updateBatch(data: MesProBatchApi.Batch) {
+ return requestClient.put('/mes/pro/batch/update', data);
+}
+
+/** 鍒犻櫎鐢熶骇鎵规 */
+export function deleteBatch(id: number) {
+ return requestClient.delete(`/mes/pro/batch/delete?id=${id}`);
+}
+
+/** 鏇存柊鐢熶骇鎵规鐘舵�� */
+export function updateBatchStatus(id: number, status: number) {
+ return requestClient.put(
+ `/mes/pro/batch/update-status?id=${id}&status=${status}`,
+ );
+}
+
+/** 鏌ヨ鐢熶骇鎵规绮剧畝鍒楄〃锛堜緵涓嬫媺閫夋嫨锛� */
+export function getBatchSimpleList() {
+ return requestClient.get<MesProBatchApi.Batch[]>('/mes/pro/batch/simple-list');
+}
+
+/** 瀵煎嚭鐢熶骇鎵规 Excel */
+export function exportBatchExcel(params: MesProBatchApi.PageParams) {
+ return requestClient.download('/mes/pro/batch/export-excel', { params });
+}
+
+/** 鎵爜杩芥函锛氭牴鎹壒娆″彿锛堜簩缁寸爜鍐呭锛夊弽鏌ユ壒娆°�佷汉鍛樸�佹墭鐩樸�佽鐮佷俊鎭� */
+export function getBatchByCode(code: string) {
+ return requestClient.get<MesProBatchApi.BatchTrace>(
+ `/mes/pro/batch/get-by-code?code=${encodeURIComponent(code)}`,
+ );
+}
+
+/** 鎵归噺瀵煎嚭鎵规浜岀淮鐮佸浘鐗� ZIP锛堟壒娆″浘 + 璇ユ壒娆″叏閮ㄦ墭鐩樺浘锛� */
+export function exportBatchQr(batchId: number) {
+ return requestClient.download(`/mes/pro/batch/export-qr?batchId=${batchId}`);
+}
--
Gitblit v1.9.3