From c4263eabb45d79932caee4827c01322406049be0 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期二, 12 五月 2026 13:39:55 +0800
Subject: [PATCH] feat(customer): 添加客户流入公海功能

---
 src/views/basicData/customerFile/index.vue |   35 ++++++++++++++++++++++++++++++++++-
 src/api/basicData/customer.js              |    8 ++++++++
 2 files changed, 42 insertions(+), 1 deletions(-)

diff --git a/src/api/basicData/customer.js b/src/api/basicData/customer.js
index 28f2eab..0934193 100644
--- a/src/api/basicData/customer.js
+++ b/src/api/basicData/customer.js
@@ -26,6 +26,14 @@
     })
 }
 
+// 娴佸叆鍏捣
+export function backCustomer(id) {
+    return request({
+        url: '/basic/customer/back/' + id,
+        method: 'post'
+    })
+}
+
 export function shareCustomer(data) {
     return request({
         url: '/basic/customer/together',
diff --git a/src/views/basicData/customerFile/index.vue b/src/views/basicData/customerFile/index.vue
index 97ea3e6..7091a02 100644
--- a/src/views/basicData/customerFile/index.vue
+++ b/src/views/basicData/customerFile/index.vue
@@ -27,6 +27,9 @@
       <div>
         <el-button type="primary"
                    @click="openForm('add')">鏂板瀹㈡埛</el-button>
+        <el-button type="primary"
+                   plain
+                   @click="back">娴佸叆鍏捣</el-button>
         <el-button @click="handleOut">瀵煎嚭</el-button>
         <el-button type="info"
                    plain
@@ -619,7 +622,7 @@
     addReturnVisit,
     getReturnVisit,
   } from "@/api/basicData/customerFile.js";
-  import {listCustomer, getCustomer, addCustomer, updateCustomer, delCustomer} from "@/api/basicData/customer.js";
+  import {listCustomer, getCustomer, addCustomer, updateCustomer, delCustomer, backCustomer} from "@/api/basicData/customer.js";
   import { ElMessageBox } from "element-plus";
   import { userListNoPage } from "@/api/system/user.js";
   import useUserStore from "@/store/modules/user";
@@ -1126,6 +1129,36 @@
       });
   };
 
+  const back = () => {
+    if (selectedRows.value.length === 0) {
+      proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+      return;
+    }
+    const ids = selectedRows.value.map(item => item.id);
+    ElMessageBox.confirm("閫変腑鐨勫鎴峰皢娴佸叆鍏捣锛屾槸鍚︾‘璁わ紵", "娴佸叆鍏捣鎻愮ず", {
+      confirmButtonText: "纭",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    })
+      .then(() => {
+        tableLoading.value = true;
+        return Promise.all(ids.map(id => backCustomer(id)))
+          .then(() => {
+            proxy.$modal.msgSuccess("娴佸叆鍏捣鎴愬姛");
+            selectedRows.value = [];
+            getList();
+          })
+          .finally(() => {
+            tableLoading.value = false;
+          });
+      })
+      .catch(error => {
+        if (error === "cancel" || error === "close") {
+          proxy.$modal.msg("宸插彇娑�");
+        }
+      });
+  };
+
   // 鎵撳紑鍥炶鎻愰啋寮圭獥
   const openReminderDialog = row => {
     currentCustomerId.value = row.id;

--
Gitblit v1.9.3