From 08bb5d242135e2c1f0fc17d2b5f7ae548275a3a2 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期五, 28 八月 2026 17:15:33 +0800
Subject: [PATCH] feat(mes): 实现临时码预生成和补录功能

---
 src/views/mes/pro/batch/modules/form.vue |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/views/mes/pro/batch/modules/form.vue b/src/views/mes/pro/batch/modules/form.vue
index 2e45243..6242291 100644
--- a/src/views/mes/pro/batch/modules/form.vue
+++ b/src/views/mes/pro/batch/modules/form.vue
@@ -15,7 +15,12 @@
 
   import { useVbenForm } from "#/adapter/form";
   import { TableAction, useVbenVxeGrid } from "#/adapter/vxe-table";
-  import { createBatch, getBatch, updateBatch } from "#/api/mes/pro/batch";
+  import {
+    createBatch,
+    fillBatchInfo,
+    getBatch,
+    updateBatch,
+  } from "#/api/mes/pro/batch";
   import { $t } from "#/locales";
   import { UserSelect } from "#/views/system/user/components";
 
@@ -33,7 +38,7 @@
   const formData = ref<MesProBatchApi.Batch>();
 
   const isEditable = computed(() =>
-    ["create", "update"].includes(formType.value)
+    ["create", "update", "fill"].includes(formType.value)
   );
 
   const getTitle = computed(() => {
@@ -43,6 +48,9 @@
       }
       case "update": {
         return $t("ui.actionTitle.edit", ["鐢熶骇鎵规"]);
+      }
+      case "fill": {
+        return "琛ュ綍鎵规淇℃伅";
       }
       default: {
         return $t("ui.actionTitle.create", ["鐢熶骇鎵规"]);
@@ -177,7 +185,9 @@
       modalApi.lock();
       try {
         const data = (await formApi.getValues()) as MesProBatchApi.Batch;
-        if (formData.value?.id) {
+        if (formType.value === "fill") {
+          await fillBatchInfo({ ...data, id: formData.value!.id, workers });
+        } else if (formData.value?.id) {
           await updateBatch({ ...data, id: formData.value.id, workers });
         } else {
           await createBatch({ ...data, workers });

--
Gitblit v1.9.3