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/views/mes/pro/bagCode/index.vue | 47 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/src/views/mes/pro/bagCode/index.vue b/src/views/mes/pro/bagCode/index.vue
index 910602c..65ae024 100644
--- a/src/views/mes/pro/bagCode/index.vue
+++ b/src/views/mes/pro/bagCode/index.vue
@@ -14,13 +14,16 @@
exportBagCodeExcel,
exportBagQr,
getBagCodePage,
+ bindBagCodeBatch,
unbindBagCodePallet,
} from "#/api/mes/pro/bagCode";
import { $t } from "#/locales";
import { useGridColumns, useGridFormSchema } from "./data";
+ import BindBatchModal from "./modules/bind-batch.vue";
import BindPalletModal from "./modules/bind-pallet.vue";
import GenerateModal from "./modules/generate-form.vue";
+ import RawGenerateModal from "./modules/raw-generate-form.vue";
import ReplaceModal from "./modules/replace-form.vue";
import QrTraceModal from "../components/qr-trace-modal.vue";
@@ -28,6 +31,16 @@
const [GenerateFormModal, generateFormModalApi] = useVbenModal({
connectedComponent: GenerateModal,
+ destroyOnClose: true,
+ });
+
+ const [RawGenerateFormModal, rawGenerateFormModalApi] = useVbenModal({
+ connectedComponent: RawGenerateModal,
+ destroyOnClose: true,
+ });
+
+ const [BindBatchFormModal, bindBatchFormModalApi] = useVbenModal({
+ connectedComponent: BindBatchModal,
destroyOnClose: true,
});
@@ -54,6 +67,11 @@
/** 鐢熸垚鏁版嵁鍖� */
function handleGenerate() {
generateFormModalApi.open();
+ }
+
+ /** 鐢熸垚鍘熷琚嬬爜 */
+ function handleRawGenerate() {
+ rawGenerateFormModalApi.open();
}
/** 鏇挎崲鎴愬姛鍚庡睍绀虹粨鏋滃苟鍒锋柊鍒楄〃 */
@@ -178,10 +196,25 @@
.open();
}
+ /** 鎵归噺褰曞叆鐢熶骇鎵规 */
+ function handleBindBatch() {
+ const records = getSelectedRecords();
+ if (!records) return;
+ if (records.some((record) => record.status !== MesProBagCodeStatusEnum.GENERATED || record.batchId)) {
+ message.warning("璇烽�夋嫨鏈綍鍏ユ壒娆′笖鐘舵�佷负宸茬敓鎴愮殑琚嬬爜");
+ return;
+ }
+ bindBatchFormModalApi.setData({ ids: records.map((record) => record.id!) }).open();
+ }
+
/** 鎵归噺缁戝畾鎵樼洏 */
function handleBindPallet() {
const records = getSelectedRecords();
if (!records) return;
+ if (records.some((record) => !record.batchId)) {
+ message.warning("璇峰厛褰曞叆鐢熶骇鎵规锛屽啀缁戝畾鎵樼洏");
+ return;
+ }
const batchIds = new Set(records.map((record) => record.batchId));
if (batchIds.size > 1) {
message.warning("璇烽�夋嫨鍚屼竴鎵规涓嬬殑琚嬬爜杩涜缁戝畾");
@@ -281,6 +314,8 @@
<template>
<Page auto-content-height>
<GenerateFormModal @success="handleRefresh" />
+ <RawGenerateFormModal @success="handleRefresh" />
+ <BindBatchFormModal @success="handleRefresh" />
<BindPalletFormModal @success="handleRefresh" />
<ReplaceFormModal @success="handleReplaceSuccess" />
<QrTraceQueryModal />
@@ -295,6 +330,18 @@
onClick: handleGenerate,
},
{
+ label: '鐢熸垚鍘熷琚嬬爜',
+ icon: ACTION_ICON.ADD,
+ auth: ['mes:pro-bag-code:create'],
+ onClick: handleRawGenerate,
+ },
+ {
+ label: '褰曞叆鎵规',
+ type: 'primary',
+ auth: ['mes:pro-bag-code:update'],
+ onClick: handleBindBatch,
+ },
+ {
label: '缁戝畾鎵樼洏',
type: 'primary',
auth: ['mes:pro-bag-code:update'],
--
Gitblit v1.9.3