From 336aa0c6affadffce030d93fb1ea901960f1e966 Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期六, 06 六月 2026 12:00:10 +0800
Subject: [PATCH] fix: 客户档案改成一个,不区分公海私海

---
 src/views/basicData/customerFileOpenSea/index.vue |  351 +++++++--------------------------------------------------
 1 files changed, 46 insertions(+), 305 deletions(-)

diff --git a/src/views/basicData/customerFileOpenSea/index.vue b/src/views/basicData/customerFileOpenSea/index.vue
index bad28e1..1c8e6c4 100644
--- a/src/views/basicData/customerFileOpenSea/index.vue
+++ b/src/views/basicData/customerFileOpenSea/index.vue
@@ -1,6 +1,7 @@
 <template>
   <div class="app-container">
-    <div class="search_form" style="margin-bottom: 20px;">
+    <div class="search_form"
+         style="margin-bottom: 20px;">
       <div>
         <span class="search_title">瀹㈡埛鍚嶇О锛�</span>
         <el-input v-model="searchForm.customerName"
@@ -202,75 +203,6 @@
         </div>
       </template>
     </el-dialog>
-    <el-dialog v-model="assignDialogVisible"
-               title="鍒嗛厤瀹㈡埛"
-               width="500px"
-               @close="closeAssignDialog">
-      <el-form :model="assignForm"
-               :rules="assignRules"
-               ref="assignFormRef"
-               label-width="100px">
-        <el-form-item label="瀹㈡埛鍚嶇О">
-          <el-input v-model="assignForm.customerName"
-                    disabled />
-        </el-form-item>
-        <el-form-item label="鍒嗛厤浜哄憳"
-                      prop="boundId">
-          <el-select v-model="assignForm.boundId"
-                     placeholder="璇烽�夋嫨鍒嗛厤浜哄憳"
-                     style="width: 100%"
-                     filterable>
-            <el-option v-for="item in userList"
-                       :key="item.userId || item.nickName"
-                       :label="item.nickName"
-                       :value="item.userId" />
-          </el-select>
-        </el-form-item>
-      </el-form>
-      <template #footer>
-        <div class="dialog-footer">
-          <el-button type="primary"
-                     @click="submitAssignForm">纭</el-button>
-          <el-button @click="closeAssignDialog">鍙栨秷</el-button>
-        </div>
-      </template>
-    </el-dialog>
-    <el-dialog v-model="shareDialogVisible"
-               title="鍏变韩瀹㈡埛"
-               width="500px"
-               @close="closeShareDialog">
-      <el-form :model="shareForm"
-               :rules="shareRules"
-               ref="shareFormRef"
-               label-width="100px">
-        <el-form-item label="瀹㈡埛鍚嶇О">
-          <el-input v-model="shareForm.customerName"
-                    disabled />
-        </el-form-item>
-        <el-form-item label="鍏变韩浜哄憳"
-                      prop="boundIds">
-          <el-select v-model="shareForm.boundIds"
-                     placeholder="璇烽�夋嫨鍏变韩浜哄憳"
-                     style="width: 100%"
-                     filterable
-                     multiple
-                     collapse-tags
-                     collapse-tags-tooltip>
-            <el-option v-for="item in userList"
-                       :key="item.userId || item.nickName"
-                       :label="item.nickName"
-                       :value="item.userId" />
-          </el-select>
-        </el-form-item>
-      </el-form>
-      <template #footer>
-        <div class="dialog-footer">
-          <el-button type="primary"
-                     @click="submitShareForm">纭</el-button>
-          <el-button @click="closeShareDialog">鍙栨秷</el-button>
-        </div>
-      </template>
-    </el-dialog>
     <!-- 鐢ㄦ埛瀵煎叆瀵硅瘽妗� -->
     <el-dialog :title="upload.title"
                v-model="upload.open"
@@ -346,7 +278,8 @@
       </el-form>
       <template #footer>
         <div class="dialog-footer">
-          <el-button type="primary" @click="submitReminderForm">纭</el-button>
+          <el-button type="primary"
+                     @click="submitReminderForm">纭</el-button>
           <el-button @click="closeReminderDialog">鍙栨秷</el-button>
         </div>
       </template>
@@ -429,7 +362,8 @@
       </el-form>
       <template #footer>
         <div class="dialog-footer">
-          <el-button type="primary" @click="submitNegotiationForm">纭</el-button>
+          <el-button type="primary"
+                     @click="submitNegotiationForm">纭</el-button>
           <el-button @click="closeNegotiationDialog">鍙栨秷</el-button>
         </div>
       </template>
@@ -690,41 +624,17 @@
   } from "@/api/basicData/customerFile.js";
   import {
     listCustomer,
-    addCustomer,
-    delCustomer,
-    updateCustomer,
     getCustomer,
-    assignCustomer,
-    recycleCustomer,
-    shareCustomer,
+    addCustomer,
+    updateCustomer,
+    delCustomer,
   } from "@/api/basicData/customer.js";
-
   import { ElMessageBox } from "element-plus";
   import { userListNoPage } from "@/api/system/user.js";
   import useUserStore from "@/store/modules/user";
   import { getToken } from "@/utils/auth.js";
   const { proxy } = getCurrentInstance();
   const userStore = useUserStore();
-  const assignDialogVisible = ref(false);
-  const assignFormRef = ref();
-  const assignForm = reactive({
-    id: undefined,
-    customerName: "",
-    boundId: undefined,
-  });
-  const assignRules = {
-    boundId: [{ required: true, message: "璇烽�夋嫨鍒嗛厤浜哄憳", trigger: "change" }],
-  };
-  const shareDialogVisible = ref(false);
-  const shareFormRef = ref();
-  const shareForm = reactive({
-    id: undefined,
-    customerName: "",
-    boundIds: [],
-  });
-  const shareRules = {
-    boundIds: [{ required: true, message: "璇烽�夋嫨鍏变韩浜哄憳", trigger: "change" }],
-  };
 
   // 鍥炶鎻愰啋鐩稿叧
   const reminderDialogVisible = ref(false);
@@ -822,7 +732,7 @@
     },
     {
       label: "鍦板潃鍙婅仈绯绘柟寮�",
-      prop: "addressPhone",
+      prop: "companyAddress",
       width: 250,
     },
     {
@@ -834,16 +744,16 @@
       prop: "contactPhone",
       width: 150,
     },
-    // {
-    //   label: "璺熻繘杩涘害",
-    //   prop: "followUpLevel",
-    //   width: 120,
-    // },
-    // {
-    //   label: "璺熻繘鏃堕棿",
-    //   prop: "followUpTime",
-    //   width: 120,
-    // },
+    {
+      label: "璺熻繘杩涘害",
+      prop: "followUpLevel",
+      width: 120,
+    },
+    {
+      label: "璺熻繘鏃堕棿",
+      prop: "followUpTime",
+      width: 120,
+    },
     {
       label: "閾惰鍩烘湰鎴�",
       prop: "basicBankAccount",
@@ -863,87 +773,46 @@
       label: "缁存姢浜�",
       prop: "maintainer",
     },
-		{
-			label: "缁存姢鏃堕棿",
-			prop: "maintenanceTime",
-			width: 100,
-		},
     {
-      label: "棰嗙敤浜�",
-      prop: "usageUserName",
-      width: 120,
-			fixed: "right",
-    },
-    {
-      label: "棰嗙敤鐘舵��",
-      prop: "usageStatus",
-      dataType: "tag",
+      label: "缁存姢鏃堕棿",
+      prop: "maintenanceTime",
       width: 100,
-			fixed: "right",
-      formatData: value => {
-        if (value === 1 || value === "1") {
-          return "宸查鐢�";
-        }
-        return "鏈鐢�";
-      },
-      formatType: value => {
-        if (value === 1 || value === "1") {
-          return "success";
-        }
-        return "info";
-      },
     },
-		{
-			label: "鍏变韩浜�",
-			prop: "togetherUserNames",
-			width: 120,
-			fixed: "right",
-		},
     {
       dataType: "action",
       label: "鎿嶄綔",
       align: "center",
       fixed: "right",
-      width: 200,
+      width: 290,
       operation: [
         {
-          name: "鍒嗛厤",
+          name: "缂栬緫",
           type: "text",
-          showHide: row => row.usageStatus != 1,
           clickFun: row => {
-            openAssignDialog(row);
+            openForm("edit", row);
           },
         },
         {
-          name: "鍥炴敹",
+          name: "娣诲姞娲借皥杩涘害",
           type: "text",
-          showHide: row => row.usageStatus == 1,
           clickFun: row => {
-            recycle(row);
+            openNegotiationDialog(row);
           },
         },
-				{
-					name: "鍏变韩",
-					type: "text",
-					showHide: row => row.usageStatus == 1,
-					clickFun: row => {
-						openShareDialog(row);
-					},
-				},
-				{
-					name: "缂栬緫",
-					type: "text",
-					clickFun: row => {
-						openForm("edit", row);
-					},
-				},
-        // {
-        //   name: "璇︽儏",
-        //   type: "text",
-        //   clickFun: row => {
-        //     openDetailDialog(row);
-        //   },
-        // },
+        {
+          name: "鍥炶鎻愰啋",
+          type: "text",
+          clickFun: row => {
+            openReminderDialog(row);
+          },
+        },
+        {
+          name: "璇︽儏",
+          type: "text",
+          clickFun: row => {
+            openDetailDialog(row);
+          },
+        },
       ],
     },
   ]);
@@ -974,7 +843,6 @@
     searchForm: {
       customerName: "",
       customerType: "",
-      type: 1
     },
     form: {
       customerName: "",
@@ -989,7 +857,6 @@
       bankAccount: "",
       bankCode: "",
       customerType: "",
-      type: 1
     },
     rules: {
       customerName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
@@ -1021,9 +888,7 @@
     headers: { Authorization: "Bearer " + getToken() },
     // 涓婁紶鐨勫湴鍧�
     url: import.meta.env.VITE_APP_BASE_API + "/basic/customer/importData",
-    data: {
-      type: 1
-    },
+    data: {},
     // 鏂囦欢涓婁紶鍓嶇殑鍥炶皟
     beforeUpload: file => {
       console.log("鏂囦欢鍗冲皢涓婁紶", file);
@@ -1094,8 +959,7 @@
   };
   const getList = () => {
     tableLoading.value = true;
-    const { total, ...queryPage } = page;
-    listCustomer({ ...searchForm.value, ...queryPage }).then(res => {
+    listCustomer({ ...searchForm.value, ...page }).then(res => {
       tableLoading.value = false;
       tableData.value = res.data.records;
       page.total = res.data.total;
@@ -1131,7 +995,6 @@
       },
     ];
     form.value.maintenanceTime = getCurrentDate();
-    form.value.type = 1;
     userListNoPage().then(res => {
       userList.value = res.data;
     });
@@ -1198,92 +1061,6 @@
     proxy.resetForm("formRef");
     dialogFormVisible.value = false;
   };
-  const ensureUserList = () => {
-    if (userList.value.length) {
-      return Promise.resolve();
-    }
-    return userListNoPage().then(res => {
-      userList.value = res.data || [];
-    });
-  };
-  const openAssignDialog = row => {
-    assignForm.id = row.id;
-    assignForm.customerName = row.customerName;
-    assignForm.boundId = undefined;
-    ensureUserList().then(() => {
-      assignDialogVisible.value = true;
-    });
-  };
-  const closeAssignDialog = () => {
-    proxy.resetForm("assignFormRef");
-    assignForm.id = undefined;
-    assignForm.customerName = "";
-    assignForm.boundId = undefined;
-    assignDialogVisible.value = false;
-  };
-  const openShareDialog = row => {
-    shareForm.id = row.id;
-    shareForm.customerName = row.customerName;
-    shareForm.boundIds = row.userIds || [];
-    ensureUserList().then(() => {
-      shareDialogVisible.value = true;
-    });
-  };
-  const closeShareDialog = () => {
-    proxy.resetForm("shareFormRef");
-    shareForm.id = undefined;
-    shareForm.customerName = "";
-    shareForm.boundIds = [];
-    shareDialogVisible.value = false;
-  };
-  const submitAssignForm = () => {
-    proxy.$refs.assignFormRef.validate(valid => {
-      if (!valid) {
-        return;
-      }
-      assignCustomer({
-        id: assignForm.id,
-        usageUser: assignForm.boundId,
-      }).then(() => {
-        proxy.$modal.msgSuccess("鍒嗛厤鎴愬姛");
-        closeAssignDialog();
-        getList();
-      });
-    });
-  };
-  const submitShareForm = () => {
-    proxy.$refs.shareFormRef.validate(valid => {
-      if (!valid) {
-        return;
-      }
-      shareCustomer({
-        id: shareForm.id,
-        userIds: shareForm.boundIds,
-      }).then(() => {
-        proxy.$modal.msgSuccess("鍏变韩鎴愬姛");
-        closeShareDialog();
-        getList();
-      });
-    });
-  };
-  const recycle = row => {
-    ElMessageBox.confirm("纭鍥炴敹瀹㈡埛鈥�" + row.customerName + "鈥濆悧锛�", "鍥炴敹鎻愮ず", {
-      confirmButtonText: "纭",
-      cancelButtonText: "鍙栨秷",
-      type: "warning",
-    })
-      .then(() => {
-        return recycleCustomer({id: row.id}).then(() => {
-          proxy.$modal.msgSuccess("鍥炴敹鎴愬姛");
-          getList();
-        })
-      })
-      .catch(error => {
-        if (error === "cancel" || error === "close") {
-          proxy.$modal.msg("宸插彇娑�");
-        }
-      });
-  };
   // 瀵煎嚭
   const handleOut = () => {
     ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
@@ -1292,7 +1069,7 @@
       type: "warning",
     })
       .then(() => {
-        proxy.download("/basic/customer/export", {type: 1}, "瀹㈡埛妗f.xlsx");
+        proxy.download("/basic/customer/export", {}, "瀹㈡埛妗f.xlsx");
       })
       .catch(() => {
         proxy.$modal.msg("宸插彇娑�");
@@ -1302,14 +1079,6 @@
   const handleDelete = () => {
     let ids = [];
     if (selectedRows.value.length > 0) {
-      // 妫�鏌ユ槸鍚︽湁浠栦汉缁存姢鐨勬暟鎹�
-      const unauthorizedData = selectedRows.value.filter(
-        item => item.maintainer !== userStore.nickName
-      );
-      if (unauthorizedData.length > 0) {
-        proxy.$modal.msgWarning("涓嶅彲鍒犻櫎浠栦汉缁存姢鐨勬暟鎹�");
-        return;
-      }
       ids = selectedRows.value.map(item => item.id);
     } else {
       proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
@@ -1323,7 +1092,7 @@
       .then(() => {
         tableLoading.value = true;
         delCustomer(ids)
-          .then(res => {
+          .then(() => {
             proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
             getList();
           })
@@ -1392,8 +1161,6 @@
           };
         }
 
-        console.log("鎻愪氦鍥炶鎻愰啋鏁版嵁:", submitvalue.value);
-
         // 璋冪敤鎺ュ彛
         addReturnVisit(submitvalue.value)
           .then(res => {
@@ -1421,14 +1188,6 @@
     negotiationForm.followUpTime = "";
     negotiationForm.followerUserName = userStore.nickName; // 榛樿褰撳墠鐧诲綍浜�
     negotiationForm.content = "";
-    // {
-    // 	"customerId": 152,
-    // 	"followUpMethod": "鐢佃瘽娌熼��",
-    // 	"followUpLevel": "娌℃湁鎰忓悜",
-    // 	"followUpTime": "2026-03-04T15:30:00",
-    // 	"followerUserName": "绠$悊鍛樿处鍙�",
-    // 	"content": "111"
-    // }
     negotiationDialogVisible.value = true;
   };
 
@@ -1450,23 +1209,6 @@
 
         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 => {
@@ -1501,7 +1243,6 @@
 
   // 鎵撳紑璇︽儏寮圭獥
   const openDetailDialog = row => {
-    // 璋冪敤getCustomer鎺ュ彛鑾峰彇瀹㈡埛璇︽儏
     getCustomer(row.id).then(res => {
       // 濉厖瀹㈡埛鍩烘湰淇℃伅
       Object.assign(detailForm, res.data);
@@ -1651,7 +1392,7 @@
   const downloadAttachment = row => {
     if (row.url) {
       // proxy.download(row.url, {}, row.name);
-			proxy.$download.byUrl(row.url, row.originalFilename);
+      proxy.$download.byUrl(row.url, row.originalFilename);
     } else {
       proxy.$modal.msgError("涓嬭浇閾炬帴涓嶅瓨鍦�");
     }

--
Gitblit v1.9.3