From 8bb675aa9bd1ed5e6eeeb6bf5aa7f6e240bddf43 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期三, 29 四月 2026 10:59:01 +0800
Subject: [PATCH] 共享客户回显

---
 src/views/basicData/customerFileOpenSea/index.vue |   47 ++++++++++++++++++++++++++---------------------
 1 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/src/views/basicData/customerFileOpenSea/index.vue b/src/views/basicData/customerFileOpenSea/index.vue
index 71cc051..e2b68b3 100644
--- a/src/views/basicData/customerFileOpenSea/index.vue
+++ b/src/views/basicData/customerFileOpenSea/index.vue
@@ -681,20 +681,23 @@
   import { onMounted, ref, reactive, getCurrentInstance, toRefs } from "vue";
   import { Search, Paperclip, Upload } from "@element-plus/icons-vue";
   import {
-    addCustomer,
-    addCustomerPrivatePool,
-    delCustomerPrivatePool,
-    delCustomer,
-    getCustomer,
-    shareCustomer,
-    listCustomer,
-    updateCustomer,
     addCustomerFollow,
     updateCustomerFollow,
     delCustomerFollow,
     addReturnVisit,
     getReturnVisit,
   } from "@/api/basicData/customerFile.js";
+  import {
+    listCustomer,
+    addCustomer,
+    delCustomer,
+    updateCustomer,
+    getCustomer,
+    assignCustomer,
+    recycleCustomer,
+    shareCustomer,
+  } from "@/api/basicData/customer.js";
+
   import { ElMessageBox } from "element-plus";
   import { userListNoPage } from "@/api/system/user.js";
   import useUserStore from "@/store/modules/user";
@@ -915,7 +918,7 @@
           type: "text",
           showHide: row => row.usageStatus == 1,
           clickFun: row => {
-            recycleCustomer(row);
+            recycle(row);
           },
         },
 				{
@@ -970,6 +973,7 @@
     searchForm: {
       customerName: "",
       customerType: "",
+      type: 1
     },
     form: {
       customerName: "",
@@ -984,6 +988,7 @@
       bankAccount: "",
       bankCode: "",
       customerType: "",
+      type: 1
     },
     rules: {
       customerName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
@@ -1122,6 +1127,7 @@
       },
     ];
     form.value.maintenanceTime = getCurrentDate();
+    form.value.type = 1;
     userListNoPage().then(res => {
       userList.value = res.data;
     });
@@ -1214,7 +1220,7 @@
   const openShareDialog = row => {
     shareForm.id = row.id;
     shareForm.customerName = row.customerName;
-    shareForm.boundIds = [];
+    shareForm.boundIds = row.userIds || [];
     ensureUserList().then(() => {
       shareDialogVisible.value = true;
     });
@@ -1231,9 +1237,9 @@
       if (!valid) {
         return;
       }
-      addCustomerPrivatePool({
-        customerId: assignForm.id,
-        boundId: assignForm.boundId,
+      assignCustomer({
+        id: assignForm.id,
+        usageUser: assignForm.boundId,
       }).then(() => {
         proxy.$modal.msgSuccess("鍒嗛厤鎴愬姛");
         closeAssignDialog();
@@ -1247,8 +1253,8 @@
         return;
       }
       shareCustomer({
-        customerId: shareForm.id,
-        boundIds: shareForm.boundIds,
+        id: shareForm.id,
+        userIds: shareForm.boundIds,
       }).then(() => {
         proxy.$modal.msgSuccess("鍏变韩鎴愬姛");
         closeShareDialog();
@@ -1256,18 +1262,17 @@
       });
     });
   };
-  const recycleCustomer = row => {
+  const recycle = row => {
     ElMessageBox.confirm("纭鍥炴敹瀹㈡埛鈥�" + row.customerName + "鈥濆悧锛�", "鍥炴敹鎻愮ず", {
       confirmButtonText: "纭",
       cancelButtonText: "鍙栨秷",
       type: "warning",
     })
       .then(() => {
-        return delCustomerPrivatePool(row.id);
-      })
-      .then(() => {
-        proxy.$modal.msgSuccess("鍥炴敹鎴愬姛");
-        getList();
+        return recycleCustomer({id: row.id}).then(() => {
+          proxy.$modal.msgSuccess("鍥炴敹鎴愬姛");
+          getList();
+        })
       })
       .catch(error => {
         if (error === "cancel" || error === "close") {

--
Gitblit v1.9.3