From 919177aceb22d6cca9c176a46c299d099a0ba0af Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期二, 12 五月 2026 17:46:09 +0800
Subject: [PATCH] 分派生产单到班组长,班组长:排产工单到班组成员

---
 src/views/productionPlan/productionPlan/index.vue |   73 ++++++++++++++++++++++++++++--------
 1 files changed, 57 insertions(+), 16 deletions(-)

diff --git a/src/views/productionPlan/productionPlan/index.vue b/src/views/productionPlan/productionPlan/index.vue
index 01a513b..ae087f4 100644
--- a/src/views/productionPlan/productionPlan/index.vue
+++ b/src/views/productionPlan/productionPlan/index.vue
@@ -111,6 +111,7 @@
                title="鍚堝苟涓嬪彂"
                width="600px">
       <el-form :model="mergeForm"
+               ref="mergeFormRef"
                label-width="120px">
         <el-row :gutter="20">
           <el-col :span="10">
@@ -138,6 +139,29 @@
                            :max="sumAssignedQuantity"
                            @change="onBlur"
                            style="width: 100%" />
+        </el-form-item>
+
+        <el-form-item
+            prop="leaderId"
+            label="鐝粍闀�"
+            :rules="[
+              {
+                required: true,
+                message: '璇烽�夋嫨鐝粍闀�',
+                trigger: 'change',
+              }
+            ]"
+        >
+          <el-select v-model="mergeForm.leaderId"
+                     placeholder="璇烽�夋嫨"
+                     filterable
+                     @focus="fetchTeamLeaderOptions"
+                     style="width: 100%">
+            <el-option v-for="item in teamLeaderOptions"
+                       :key="item.userId"
+                       :label="item.nickName"
+                       :value="item.userId" />
+          </el-select>
         </el-form-item>
       </el-form>
       <template #footer>
@@ -269,8 +293,10 @@
     exportProductionPlan,
   } from "@/api/productionPlan/productionPlan.js";
   import { productTreeList, modelListPage } from "@/api/basicData/product.js";
+  import { getTeamLeaderList } from "@/api/productionManagement/productionTeamUserRel.js";
   import PIMTable from "./components/PIMTable.vue";
   import ImportDialog from "@/components/Dialog/ImportDialog.vue";
+  import {afterSalesServiceDispose} from "@/api/customerService/index.js";
 
   const { proxy } = getCurrentInstance();
   const router = useRouter();
@@ -473,7 +499,18 @@
     totalAssignedQuantity: 0,
     planCompleteTime: "",
     productId: "",
+    leaderId: "",
   });
+
+  // 鐝粍闀垮垪琛�
+  const teamLeaderOptions = ref([]);
+
+  // 鏌ヨ鐝粍闀垮垪琛�
+  const fetchTeamLeaderOptions = () => {
+    return getTeamLeaderList().then(res => {
+      teamLeaderOptions.value = res.data || [];
+    });
+  };
 
   // 瀵煎叆鐩稿叧
   const importDialogRef = ref(null);
@@ -778,22 +815,26 @@
     const payload = {
       ...mergeForm,
     };
-    productionPlanCombine(payload)
-      .then(res => {
-        if (res.code === 200) {
-          ElMessage.success("涓嬪彂鎴愬姛");
-          getList();
-          isShowNewModal.value = false;
-          // 鍙互閫夋嫨鍒锋柊鍒楄〃鎴栧叾浠栨搷浣�
-          getList();
-        } else {
-          ElMessage.error(res.message || "涓嬪彂澶辫触");
-        }
-      })
-      .catch(err => {
-        console.error("鍚堝苟涓嬪彂寮傚父锛�", err);
-        ElMessage.error("绯荤粺寮傚父锛屽悎骞朵笅鍙戝け璐�");
-      });
+    proxy.$refs["mergeFormRef"].validate(valid => {
+      if (!valid) return;
+      productionPlanCombine(payload)
+          .then(res => {
+            if (res.code === 200) {
+              ElMessage.success("涓嬪彂鎴愬姛");
+              getList();
+              isShowNewModal.value = false;
+              // 鍙互閫夋嫨鍒锋柊鍒楄〃鎴栧叾浠栨搷浣�
+              getList();
+            } else {
+              ElMessage.error(res.message || "涓嬪彂澶辫触");
+            }
+          })
+          .catch(err => {
+            console.error("鍚堝苟涓嬪彂寮傚父锛�", err);
+            ElMessage.error("绯荤粺寮傚父锛屽悎骞朵笅鍙戝け璐�");
+          });
+    })
+
     // 鍙互閫夋嫨鍒锋柊鍒楄〃鎴栧叾浠栨搷浣�
   };
 

--
Gitblit v1.9.3