From bb91952d1f1f59c4719d77eaf56e47eafa10126a Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期三, 21 十月 2026 17:20:55 +0800
Subject: [PATCH] feat: 添加产品树过滤功能,支持新增和编辑场景下的产品类别选择

---
 src/views/productionPlan/productionPlan/index.vue |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/views/productionPlan/productionPlan/index.vue b/src/views/productionPlan/productionPlan/index.vue
index fd6c1a3..e254c57 100644
--- a/src/views/productionPlan/productionPlan/index.vue
+++ b/src/views/productionPlan/productionPlan/index.vue
@@ -186,7 +186,7 @@
           <el-tree-select v-model="form.productId"
                           placeholder="璇烽�夋嫨"
                           clearable
-                          :data="productOptions"
+                          :data="productTreeOptions"
                           :render-after-expand="false"
                           filterable
                           @change="handleProductChange"
@@ -283,6 +283,7 @@
     exportProductionPlan,
   } from "@/api/productionPlan/productionPlan.js";
   import { productTreeList, modelListPage } from "@/api/basicData/product.js";
+  import { filterFinishedProductTree } from "@/utils/productTree.js";
   import PIMTable from "./components/PIMTable.vue";
   import ImportDialog from "@/components/Dialog/ImportDialog.vue";
 
@@ -510,6 +511,12 @@
   const dialogVisible = ref(false);
   const operationType = ref("add"); // add | edit
   const productOptions = ref([]);
+  // 鏂板鐢熶骇璁″垝鏃朵骇鍝佸悕绉板彧灞曠ず銆屾垚鍝併�嶏紝缂栬緫鏃朵繚鎸佸畬鏁翠骇鍝佹爲
+  const productTreeOptions = computed(() =>
+    operationType.value === "add"
+      ? filterFinishedProductTree(productOptions.value)
+      : productOptions.value
+  );
   const specificationOptions = ref([]);
   const queryRef = ref(null);
   const formRef = ref(null);

--
Gitblit v1.9.3