From b41552e7d56a7068e9080a475baaef9c173f8b7e Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期三, 22 四月 2026 15:22:31 +0800
Subject: [PATCH] feat(生产报工): 支持多班组成员选择和补产数量录入

---
 src/views/basicData/customerFile/index.vue |  116 +++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 83 insertions(+), 33 deletions(-)

diff --git a/src/views/basicData/customerFile/index.vue b/src/views/basicData/customerFile/index.vue
index cc6590c..77206ed 100644
--- a/src/views/basicData/customerFile/index.vue
+++ b/src/views/basicData/customerFile/index.vue
@@ -32,6 +32,9 @@
                    plain
                    icon="Upload"
                    @click="handleImport">瀵煎叆</el-button>
+        <el-button type="warning"
+                   plain
+                   @click="handleSyncPublic">鍚屾鍏捣</el-button>
         <el-button type="danger"
                    plain
                    @click="handleDelete">鍒犻櫎</el-button>
@@ -152,7 +155,40 @@
           </el-col>
           
         </el-row>
-        <el-row :gutter="30">
+        <el-row :gutter="30"
+                v-for="(contact, index) in formYYs.contactList"
+                :key="index">
+          <el-col :span="12">
+            <el-form-item label="鑱旂郴浜猴細"
+                          prop="contactPerson">
+              <el-input v-model="contact.contactPerson"
+                        placeholder="璇疯緭鍏�"
+                        clearable />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="鑱旂郴鐢佃瘽锛�"
+                          prop="contactPhone">
+              <div style="display: flex; align-items: center;width: 100%;">
+                <el-input v-model="contact.contactPhone"
+                          placeholder="璇疯緭鍏�"
+                          clearable />
+                <el-button @click="removeContact(index)"
+                           type="danger"
+                           circle
+                           style="margin-left: 5px;">
+                  <el-icon>
+                    <Close />
+                  </el-icon>
+                </el-button>
+              </div>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        
+        <el-button @click="addNewContact"
+                   style="margin-bottom: 10px;">+ 鏂板鑱旂郴浜�</el-button>
+                   <el-row :gutter="30">
           <el-col :span="12">
             <el-form-item label="浠g悊浜�"
                           prop="agent">
@@ -184,38 +220,6 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <el-row :gutter="30"
-                v-for="(contact, index) in formYYs.contactList"
-                :key="index">
-          <el-col :span="12">
-            <el-form-item label="鑱旂郴浜猴細"
-                          prop="contactPerson">
-              <el-input v-model="contact.contactPerson"
-                        placeholder="璇疯緭鍏�"
-                        clearable />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="鑱旂郴鐢佃瘽锛�"
-                          prop="contactPhone">
-              <div style="display: flex; align-items: center;width: 100%;">
-                <el-input v-model="contact.contactPhone"
-                          placeholder="璇疯緭鍏�"
-                          clearable />
-                <el-button @click="removeContact(index)"
-                           type="danger"
-                           circle
-                           style="margin-left: 5px;">
-                  <el-icon>
-                    <Close />
-                  </el-icon>
-                </el-button>
-              </div>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-button @click="addNewContact"
-                   style="margin-bottom: 10px;">+ 鏂板鑱旂郴浜�</el-button>
         <el-row :gutter="30">
           <el-col :span="12">
             <el-form-item label="缁存姢浜猴細"
@@ -670,6 +674,7 @@
     delCustomerFollow,
     addReturnVisit,
     getReturnVisit,
+    throwCustomer,
   } from "@/api/basicData/customerFile.js";
   import { ElMessageBox } from "element-plus";
   import { userListNoPage } from "@/api/system/user.js";
@@ -1221,6 +1226,51 @@
       });
   };
 
+  // 鍚屾鍏捣 - 灏嗛�変腑鐨勫鎴锋墧鍥炲叕娴�
+  const handleSyncPublic = () => {
+    if (selectedRows.value.length === 0) {
+      proxy.$modal.msgWarning("璇烽�夋嫨瑕佸悓姝ョ殑瀹㈡埛");
+      return;
+    }
+    // 妫�鏌ユ槸鍚︽湁鍏捣绫诲瀷鐨勫鎴�
+    const publicSeaData = selectedRows.value.filter(
+      item => item.type === 1 || item.type === "1"
+    );
+    if (publicSeaData.length > 0) {
+      const names = publicSeaData.map(item => item.customerName).join("銆�");
+      proxy.$modal.msgWarning(`鍏捣瀹㈡埛涓嶈兘鍚屾锛�${names}`);
+      return;
+    }
+    const ids = selectedRows.value.map(item => item.id);
+    const customerNames = selectedRows.value.map(item => item.customerName).join("銆�");
+    const confirmText = selectedRows.value.length === 1 
+      ? `纭畾瑕佸皢瀹㈡埛銆�${customerNames}銆戝悓姝ュ埌鍏捣鍚楋紵`
+      : `纭畾瑕佸皢閫変腑鐨� ${selectedRows.value.length} 涓鎴峰悓姝ュ埌鍏捣鍚楋紵\n\n瀹㈡埛锛�${customerNames}`;
+    ElMessageBox.confirm(
+      confirmText,
+      "鍚屾鎻愮ず",
+      {
+        confirmButtonText: "纭",
+        cancelButtonText: "鍙栨秷",
+        type: "warning",
+      }
+    )
+      .then(() => {
+        tableLoading.value = true;
+        throwCustomer(ids)
+          .then(() => {
+            proxy.$modal.msgSuccess("鍚屾鍏捣鎴愬姛");
+            getList();
+          })
+          .finally(() => {
+            tableLoading.value = false;
+          });
+      })
+      .catch(() => {
+        proxy.$modal.msg("宸插彇娑�");
+      });
+  };
+
   // 鎵撳紑鍥炶鎻愰啋寮圭獥
   const openReminderDialog = row => {
     currentCustomerId.value = row.id;

--
Gitblit v1.9.3