From 0ae264879768af568bb9d12df7c629839583e9ef Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期五, 17 四月 2026 16:08:05 +0800
Subject: [PATCH] Merge branch 'dev_New' of http://114.132.189.42:9002/r/product-inventory-management into dev_New

---
 src/views/basicData/customerFile/index.vue |  102 +++++++++++++++++++++++---------------------------
 1 files changed, 47 insertions(+), 55 deletions(-)

diff --git a/src/views/basicData/customerFile/index.vue b/src/views/basicData/customerFile/index.vue
index 79b1616..d0f829c 100644
--- a/src/views/basicData/customerFile/index.vue
+++ b/src/views/basicData/customerFile/index.vue
@@ -612,11 +612,13 @@
   import { onMounted, ref, reactive, getCurrentInstance, toRefs } from "vue";
   import { Search, Paperclip, Upload } from "@element-plus/icons-vue";
   import {
-    addCustomer,
-    delCustomer,
+    addCustomerPrivate,
+    delCustomerPrivate,
     getCustomer,
-    listCustomer,
-    updateCustomer,
+    getCustomerPrivatePoolById,
+    getCustomerPrivatePoolInfo,
+    listCustomerPrivatePool,
+    updateCustomerPrivatePool,
     addCustomerFollow,
     updateCustomerFollow,
     delCustomerFollow,
@@ -654,7 +656,7 @@
   const negotiationFormRef = ref();
   const negotiationForm = reactive({
     customerName: "",
-    customerId: "",
+		customerPrivatePoolId: "",
     followUpMethod: "",
     followUpLevel: "",
     followUpTime: "",
@@ -726,7 +728,7 @@
     },
     {
       label: "鍦板潃鍙婅仈绯绘柟寮�",
-      prop: "addressPhone",
+      prop: "companyAddress",
       width: 250,
     },
     {
@@ -766,6 +768,24 @@
     {
       label: "缁存姢浜�",
       prop: "maintainer",
+    },
+    {
+      label: "瀹㈡埛鏉ユ簮",
+      prop: "type",
+      dataType: "tag",
+      width: 100,
+      formatData: value => {
+        if (value === 1 || value === "1") {
+          return "鍏捣";
+        }
+        return "绉佹捣";
+      },
+      formatType: value => {
+        if (value === 1 || value === "1") {
+          return "warning";
+        }
+        return "success";
+      },
     },
     {
       label: "缁存姢鏃堕棿",
@@ -881,7 +901,7 @@
     // 璁剧疆涓婁紶鐨勮姹傚ご閮�
     headers: { Authorization: "Bearer " + getToken() },
     // 涓婁紶鐨勫湴鍧�
-    url: import.meta.env.VITE_APP_BASE_API + "/basic/customer/importData",
+    url: import.meta.env.VITE_APP_BASE_API + "/customerPrivate/importData",
     // 鏂囦欢涓婁紶鍓嶇殑鍥炶皟
     beforeUpload: file => {
       console.log("鏂囦欢鍗冲皢涓婁紶", file);
@@ -952,10 +972,10 @@
   };
   const getList = () => {
     tableLoading.value = true;
-    listCustomer({ ...searchForm.value, ...page }).then(res => {
+    listCustomerPrivatePool({ ...searchForm.value, ...page }).then(res => {
       tableLoading.value = false;
-      tableData.value = res.records;
-      page.total = res.total;
+      tableData.value = res.data.records;
+      page.total = res.data.total;
     });
   };
   // 琛ㄦ牸閫夋嫨鏁版嵁
@@ -974,7 +994,7 @@
   }
   /** 涓嬭浇妯℃澘 */
   function importTemplate() {
-    proxy.download("/basic/customer/downloadTemplate", {}, "瀹㈡埛瀵煎叆妯℃澘.xlsx");
+    proxy.download("/customerPrivate/downloadTemplate", {}, "瀹㈡埛瀵煎叆妯℃澘.xlsx");
   }
   // 鎵撳紑寮规
   const openForm = (type, row) => {
@@ -992,7 +1012,7 @@
       userList.value = res.data;
     });
     if (type === "edit") {
-      getCustomer(row.id).then(res => {
+      getCustomerPrivatePoolById(row.id).then(res => {
         form.value = { ...res.data };
         formYYs.value.contactList = res.data.contactPerson
           .split(",")
@@ -1029,7 +1049,7 @@
     form.value.contactPhone = formYYs.value.contactList
       .map(item => item.contactPhone)
       .join(",");
-    addCustomer(form.value).then(res => {
+    addCustomerPrivate(form.value).then(res => {
       proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
       closeDia();
       getList();
@@ -1043,7 +1063,7 @@
     form.value.contactPhone = formYYs.value.contactList
       .map(item => item.contactPhone)
       .join(",");
-    updateCustomer(form.value).then(res => {
+    updateCustomerPrivatePool(form.value).then(res => {
       proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
       closeDia();
       getList();
@@ -1062,7 +1082,7 @@
       type: "warning",
     })
       .then(() => {
-        proxy.download("/basic/customer/export", {}, "瀹㈡埛妗f.xlsx");
+        proxy.download("/customerPrivate/export", {}, "瀹㈡埛妗f.xlsx");
       })
       .catch(() => {
         proxy.$modal.msg("宸插彇娑�");
@@ -1072,12 +1092,11 @@
   const handleDelete = () => {
     let ids = [];
     if (selectedRows.value.length > 0) {
-      // 妫�鏌ユ槸鍚︽湁浠栦汉缁存姢鐨勬暟鎹�
       const unauthorizedData = selectedRows.value.filter(
-        item => item.maintainer !== userStore.nickName
+        item => item.type === 1 || item.type === "1"
       );
       if (unauthorizedData.length > 0) {
-        proxy.$modal.msgWarning("涓嶅彲鍒犻櫎浠栦汉缁存姢鐨勬暟鎹�");
+        proxy.$modal.msgWarning("鍏捣鍒嗛厤鐨勫鎴蜂笉鑳藉垹闄�");
         return;
       }
       ids = selectedRows.value.map(item => item.id);
@@ -1092,8 +1111,8 @@
     })
       .then(() => {
         tableLoading.value = true;
-        delCustomer(ids)
-          .then(res => {
+        delCustomerPrivate(ids)
+          .then(() => {
             proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
             getList();
           })
@@ -1146,7 +1165,8 @@
         if (reminderForm.id) {
           submitvalue.value = {
             id: reminderForm.id,
-            customerId: currentCustomerId.value,
+						customerPrivatePoolId: reminderForm.id,
+						customerPrivatePoolId: currentCustomerId.value,
             isEnabled: reminderForm.reminderSwitch ? 1 : 0,
             content: reminderForm.reminderContent,
             reminderTime: reminderForm.reminderTime,
@@ -1154,15 +1174,13 @@
           };
         } else {
           submitvalue.value = {
-            customerId: currentCustomerId.value,
+						customerPrivatePoolId: currentCustomerId.value,
             isEnabled: reminderForm.reminderSwitch ? 1 : 0,
             content: reminderForm.reminderContent,
             reminderTime: reminderForm.reminderTime,
             remindUserId: userStore.id,
           };
         }
-
-        console.log("鎻愪氦鍥炶鎻愰啋鏁版嵁:", submitvalue.value);
 
         // 璋冪敤鎺ュ彛
         addReturnVisit(submitvalue.value)
@@ -1185,20 +1203,12 @@
   // 鎵撳紑娲借皥杩涘害寮圭獥
   const openNegotiationDialog = row => {
     negotiationForm.customerName = row.customerName;
-    negotiationForm.customerId = row.id;
+    negotiationForm.customerPrivatePoolId = row.id;
     negotiationForm.followUpMethod = "";
     negotiationForm.followUpLevel = "";
     negotiationForm.followUpTime = "";
     negotiationForm.followerUserName = userStore.nickName; // 榛樿褰撳墠鐧诲綍浜�
     negotiationForm.content = "";
-    // {
-    // 	"customerId": 152,
-    // 	"followUpMethod": "鐢佃瘽娌熼��",
-    // 	"followUpLevel": "娌℃湁鎰忓悜",
-    // 	"followUpTime": "2026-03-04T15:30:00",
-    // 	"followerUserName": "绠$悊鍛樿处鍙�",
-    // 	"content": "111"
-    // }
     negotiationDialogVisible.value = true;
   };
 
@@ -1220,26 +1230,9 @@
 
         if (isEdit) {
           // 淇敼鎿嶄綔
-          console.log("淇敼娲借皥杩涘害鏁版嵁:", negotiationForm);
-          // 杩欓噷鍙互璋冪敤鏇存柊鎺ュ彛
-          // 瀹為檯椤圭洰涓渶瑕佹牴鎹悗绔帴鍙h繘琛岃皟鏁�
-          // 绀轰緥锛歶pdateCustomerFollow(negotiationForm).then(res => {
-          //   // 鏇存柊鏈湴鏁版嵁
-          //   const index = negotiationForm.editIndex;
-          //   negotiationRecords.value[index] = {
-          //     followUpTime: negotiationForm.followUpTime,
-          //     followUpMethod: negotiationForm.followUpMethod,
-          //     followUpLevel: negotiationForm.followUpLevel,
-          //     followerUserName: negotiationForm.followerUserName,
-          //     content: negotiationForm.content,
-          //     id: negotiationForm.id,
-          //   };
-          //   proxy.$modal.msgSuccess("淇敼鎴愬姛");
-          //   closeNegotiationDialog();
-          // });
           updateCustomerFollow(negotiationForm).then(res => {
             // 鏇存柊鏈湴鏁版嵁
-            getCustomer(negotiationForm.customerId).then(res => {
+            getCustomer(negotiationForm.customerPrivatePoolId).then(res => {
               // 鏇存柊鏈湴鏁版嵁
               negotiationRecords.value = res.data.followUpList || [];
             });
@@ -1271,8 +1264,7 @@
 
   // 鎵撳紑璇︽儏寮圭獥
   const openDetailDialog = row => {
-    // 璋冪敤getCustomer鎺ュ彛鑾峰彇瀹㈡埛璇︽儏
-    getCustomer(row.id).then(res => {
+    getCustomerPrivatePoolInfo(row.id).then(res => {
       // 濉厖瀹㈡埛鍩烘湰淇℃伅
       Object.assign(detailForm, res.data);
 
@@ -1293,7 +1285,7 @@
     // 灏嗗綋鍓嶈褰曟暟鎹~鍏呭埌琛ㄥ崟
     Object.assign(negotiationForm, {
       customerName: row.customerName,
-      customerId: row.customerId,
+			customerPrivatePoolId: row.customerPrivatePoolId,
       followUpMethod: row.followUpMethod,
       followUpLevel: row.followUpLevel,
       followUpTime: row.followUpTime,
@@ -1321,7 +1313,7 @@
         // });
         delCustomerFollow(row.id).then(() => {
           // 鍒犻櫎鎴愬姛鍚庢洿鏂版湰鍦版暟鎹�
-          getCustomer(row.customerId).then(res => {
+          getCustomer(row.customerPrivatePoolId).then(res => {
             // 鏇存柊鏈湴鏁版嵁
             negotiationRecords.value = res.data.followUpList || [];
           });

--
Gitblit v1.9.3