From 90b6240233ef9a896a4075758eabb7342e2c49a0 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 21 四月 2026 09:00:56 +0800
Subject: [PATCH] 湟水峡 1.销售、采购模块不要客户合同号、项目名称 2.销售报价和销售台账价格导入按照客户类型赋值 3.人力资源字段增减 4.仓储物流四根模块tab标签页和查询条件修改 5.销售、采购模块字段增减

---
 src/views/basicData/customerFile/index.vue |  738 +++++++++++++++++++++++++++++++-------------------------
 1 files changed, 413 insertions(+), 325 deletions(-)

diff --git a/src/views/basicData/customerFile/index.vue b/src/views/basicData/customerFile/index.vue
index 1437beb..812dc5f 100644
--- a/src/views/basicData/customerFile/index.vue
+++ b/src/views/basicData/customerFile/index.vue
@@ -15,10 +15,10 @@
                    style="width: 240px"
                    clearable
                    @change="handleQuery">
-          <el-option label="闆跺敭瀹㈡埛"
-                     value="闆跺敭瀹㈡埛" />
-          <el-option label="杩涢攢鍟嗗鎴�"
-                     value="杩涢攢鍟嗗鎴�" />
+          <el-option label="涓�鎵瑰晢"
+                     value="涓�鎵瑰晢" />
+          <el-option label="缁堢鍟�"
+                     value="缁堢鍟�" />
         </el-select>
         <el-button type="primary"
                    @click="handleQuery"
@@ -66,16 +66,6 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="绾崇◣浜鸿瘑鍒彿锛�"
-                          prop="taxpayerIdentificationNumber">
-              <el-input v-model="form.taxpayerIdentificationNumber"
-                        placeholder="璇疯緭鍏�"
-                        clearable />
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row :gutter="30">
-          <el-col :span="12">
             <el-form-item label="鍏徃鍦板潃锛�"
                           prop="companyAddress">
               <el-input v-model="form.companyAddress"
@@ -83,88 +73,22 @@
                         clearable />
             </el-form-item>
           </el-col>
-          <el-col :span="12">
-            <el-form-item label="鍏徃鐢佃瘽锛�"
-                          prop="companyPhone">
-              <el-input v-model="form.companyPhone"
-                        placeholder="璇疯緭鍏�"
-                        clearable />
-            </el-form-item>
-          </el-col>
         </el-row>
         <el-row :gutter="30">
-          <el-col :span="12">
-            <el-form-item label="閾惰鍩烘湰鎴凤細"
-                          prop="basicBankAccount">
-              <el-input v-model="form.basicBankAccount"
-                        placeholder="璇疯緭鍏�"
-                        clearable />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="閾惰璐﹀彿锛�"
-                          prop="bankAccount">
-              <el-input v-model="form.bankAccount"
-                        placeholder="璇疯緭鍏�"
-                        clearable />
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row :gutter="30">
-          <el-col :span="12">
-            <el-form-item label="寮�鎴疯鍙凤細"
-                          prop="bankCode">
-              <el-input v-model="form.bankCode"
-                        placeholder="璇疯緭鍏�"
-                        clearable />
-            </el-form-item>
-          </el-col>
           <el-col :span="12">
             <el-form-item label="瀹㈡埛鍒嗙被锛�"
                           prop="customerType">
               <el-select v-model="form.customerType"
                          placeholder="璇烽�夋嫨"
                          clearable>
-                <el-option label="闆跺敭瀹㈡埛"
-                           value="闆跺敭瀹㈡埛" />
-                <el-option label="杩涢攢鍟嗗鎴�"
-                           value="杩涢攢鍟嗗鎴�" />
+                <el-option label="涓�鎵瑰晢"
+                           value="涓�鎵瑰晢" />
+                <el-option label="缁堢鍟�"
+                           value="缁堢鍟�" />
               </el-select>
             </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="缁存姢浜猴細"
@@ -267,18 +191,17 @@
         <el-form-item label="鎻愰啋鏃堕棿锛�"
                       prop="reminderTime">
           <el-date-picker v-model="reminderForm.reminderTime"
-                          type="date"
-                          value-format="YYYY-MM-DD"
-                          format="YYYY-MM-DD"
+                          type="datetime"
+                          value-format="YYYY-MM-DD HH:mm:ss"
+                          format="YYYY-MM-DD HH:mm:ss"
                           placeholder="璇烽�夋嫨鎻愰啋鏃堕棿"
                           style="width: 100%" />
         </el-form-item>
       </el-form>
       <template #footer>
         <div class="dialog-footer">
+          <el-button type="primary" @click="submitReminderForm">纭</el-button>
           <el-button @click="closeReminderDialog">鍙栨秷</el-button>
-          <el-button type="primary"
-                     @click="submitReminderForm">鎻愪氦</el-button>
         </div>
       </template>
     </el-dialog>
@@ -360,16 +283,15 @@
       </el-form>
       <template #footer>
         <div class="dialog-footer">
+          <el-button type="primary" @click="submitNegotiationForm">纭</el-button>
           <el-button @click="closeNegotiationDialog">鍙栨秷</el-button>
-          <el-button type="primary"
-                     @click="submitNegotiationForm">鎻愪氦</el-button>
         </div>
       </template>
     </el-dialog>
     <!-- 瀹㈡埛璇︽儏瀵硅瘽妗� -->
     <el-dialog title="瀹㈡埛璇︽儏"
                v-model="detailDialogVisible"
-               width="800px"
+               width="1000px"
                @close="closeDetailDialog">
       <!-- 瀹㈡埛鍩烘湰淇℃伅 -->
       <div class="detail-section">
@@ -392,56 +314,8 @@
           <el-row :gutter="20">
             <el-col :span="12">
               <div class="info-item">
-                <span class="info-label">绾崇◣浜鸿瘑鍒彿锛�</span>
-                <span class="info-value">{{ detailForm.taxpayerIdentificationNumber }}</span>
-              </div>
-            </el-col>
-            <el-col :span="12">
-              <div class="info-item">
-                <span class="info-label">鍏徃鐢佃瘽锛�</span>
-                <span class="info-value">{{ detailForm.companyPhone }}</span>
-              </div>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <el-col :span="12">
-              <div class="info-item">
                 <span class="info-label">鍏徃鍦板潃锛�</span>
                 <span class="info-value">{{ detailForm.companyAddress }}</span>
-              </div>
-            </el-col>
-            <el-col :span="12">
-              <div class="info-item">
-                <span class="info-label">閾惰鍩烘湰鎴凤細</span>
-                <span class="info-value">{{ detailForm.basicBankAccount }}</span>
-              </div>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <el-col :span="12">
-              <div class="info-item">
-                <span class="info-label">閾惰璐﹀彿锛�</span>
-                <span class="info-value">{{ detailForm.bankAccount }}</span>
-              </div>
-            </el-col>
-            <el-col :span="12">
-              <div class="info-item">
-                <span class="info-label">寮�鎴疯鍙凤細</span>
-                <span class="info-value">{{ detailForm.bankCode }}</span>
-              </div>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <el-col :span="12">
-              <div class="info-item">
-                <span class="info-label">鑱旂郴浜猴細</span>
-                <span class="info-value">{{ detailForm.contactPerson }}</span>
-              </div>
-            </el-col>
-            <el-col :span="12">
-              <div class="info-item">
-                <span class="info-label">鑱旂郴鐢佃瘽锛�</span>
-                <span class="info-value">{{ detailForm.contactPhone }}</span>
               </div>
             </el-col>
           </el-row>
@@ -481,27 +355,39 @@
                            label="璺熻繘鏂瑰紡"
                            width="100" />
           <el-table-column prop="followUpLevel"
-                           label="璺熻繘绋嬪害"
-                           width="120" />
+                           label="璺熻繘绋嬪害" />
           <el-table-column prop="followerUserName"
                            label="璺熻繘浜�"
                            width="100" />
           <el-table-column prop="content"
                            label="鍐呭"
                            show-overflow-tooltip />
+          <el-table-column label="闄勪欢"
+                           width="100"
+                           align="center">
+            <template #default="{ row }">
+              <el-button type="info"
+                         link
+                         @click="openAttachmentDialog(row)">
+                <el-icon>
+                  <Paperclip />
+                </el-icon>
+                闄勪欢
+                <!-- {{ row.fileList && row.fileList.length > 0 ? row.fileList.length : '涓婁紶' }} -->
+              </el-button>
+            </template>
+          </el-table-column>
           <el-table-column label="鎿嶄綔"
                            width="150"
                            align="center">
             <template #default="{ row, $index }">
               <el-button type="primary"
                          link
-                         size="small"
                          @click="editNegotiationRecord(row, $index)">
                 淇敼
               </el-button>
               <el-button type="danger"
                          link
-                         size="small"
                          @click="deleteNegotiationRecord(row, $index)">
                 鍒犻櫎
               </el-button>
@@ -519,21 +405,101 @@
         </div>
       </template>
     </el-dialog>
+    <!-- 闄勪欢涓婁紶寮圭獥 -->
+    <el-dialog title="闄勪欢绠$悊"
+               v-model="attachmentDialogVisible"
+               width="600px"
+               @close="closeAttachmentDialog">
+      <div class="attachment-section">
+        <div class="upload-area">
+          <el-upload ref="attachmentUploadRef"
+                     :action="getAttachmentUploadUrl()"
+                     :headers="attachmentUploadHeaders"
+                     :file-list="currentAttachmentList"
+                     :on-success="handleAttachmentSuccess"
+                     :on-error="handleAttachmentError"
+                     :on-remove="handleAttachmentRemove"
+                     :before-upload="beforeAttachmentUpload"
+                     multiple
+                     :limit="10"
+                     name="files">
+            <el-button type="primary">
+              <el-icon>
+                <Upload />
+              </el-icon>
+              涓婁紶闄勪欢
+            </el-button>
+            <template #tip>
+              <div class="el-upload__tip">
+                鏀寔涓婁紶鍥剧墖銆佹枃妗g瓑鏂囦欢锛屽崟涓枃浠朵笉瓒呰繃50MB
+              </div>
+            </template>
+          </el-upload>
+        </div>
+        <div v-if="currentAttachmentList.length > 0"
+             class="attachment-list">
+          <h4>宸蹭笂浼犻檮浠讹細</h4>
+          <el-table :data="currentAttachmentList"
+                    border
+                    size="small">
+            <el-table-column prop="name"
+                             label="鏂囦欢鍚�"
+                             show-overflow-tooltip />
+            <el-table-column prop="size"
+                             label="澶у皬"
+                             width="100">
+              <template #default="{ row }">
+                {{ formatFileSize(row.size) }}
+              </template>
+            </el-table-column>
+            <el-table-column label="鎿嶄綔"
+                             width="120"
+                             align="center">
+              <template #default="{ row, $index }">
+                <el-button type="primary"
+                           link
+                           @click="downloadAttachment(row)">
+                  涓嬭浇
+                </el-button>
+                <el-button type="danger"
+                           link
+                           @click="deleteAttachment(row, $index)">
+                  鍒犻櫎
+                </el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+        <div v-else
+             class="no-attachment">
+          鏆傛棤闄勪欢
+        </div>
+      </div>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="closeAttachmentDialog">鍏抽棴</el-button>
+        </div>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
 <script setup>
   import { onMounted, ref, reactive, getCurrentInstance, toRefs } from "vue";
-  import { Search } from "@element-plus/icons-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,
+    addReturnVisit,
+    getReturnVisit,
   } from "@/api/basicData/customerFile.js";
   import { ElMessageBox } from "element-plus";
   import { userListNoPage } from "@/api/system/user.js";
@@ -545,6 +511,7 @@
   // 鍥炶鎻愰啋鐩稿叧
   const reminderDialogVisible = ref(false);
   const reminderFormRef = ref();
+  const currentCustomerId = ref();
   const reminderForm = reactive({
     customerName: "",
     reminderSwitch: false,
@@ -565,7 +532,7 @@
   const negotiationFormRef = ref();
   const negotiationForm = reactive({
     customerName: "",
-    customerId: "",
+		customerPrivatePoolId: "",
     followUpMethod: "",
     followUpLevel: "",
     followUpTime: "",
@@ -590,48 +557,50 @@
   const detailForm = reactive({
     customerName: "",
     customerType: "",
-    taxpayerIdentificationNumber: "",
-    companyPhone: "",
     companyAddress: "",
-    basicBankAccount: "",
-    bankAccount: "",
-    bankCode: "",
-    contactPerson: "",
-    contactPhone: "",
     maintainer: "",
     maintenanceTime: "",
   });
   const negotiationRecords = ref([]);
 
+  // 闄勪欢鐩稿叧
+  const attachmentDialogVisible = ref(false);
+  const attachmentUploadRef = ref();
+  const currentAttachmentList = ref([]);
+  const currentFollowRecord = ref({});
+  const attachmentUploadHeaders = { Authorization: "Bearer " + getToken() };
+
+  // 鍔ㄦ�佹瀯寤轰笂浼燯RL
+  const getAttachmentUploadUrl = () => {
+    const baseUrl =
+      import.meta.env.VITE_APP_BASE_API + "/basic/customer-follow/upload";
+    return currentFollowRecord.value.id
+      ? `${baseUrl}/${currentFollowRecord.value.id}`
+      : baseUrl;
+  };
+
   const tableColumn = ref([
-    {
-      label: "瀹㈡埛鍒嗙被",
-      prop: "customerType",
-      width: 120,
-    },
     {
       label: "瀹㈡埛鍚嶇О",
       prop: "customerName",
       width: 220,
     },
     {
-      label: "绾崇◣浜鸿瘑鍒爜",
-      prop: "taxpayerIdentificationNumber",
-      width: 220,
+      label: "瀹㈡埛鍒嗙被",
+      prop: "customerType",
+      dataType: "tag",
+      width: 120,
+      formatType: value => {
+        if (value === "涓�鎵瑰晢") {
+          return "primary";
+        }
+        return "success";
+      },
     },
     {
-      label: "鍦板潃鍙婅仈绯绘柟寮�",
-      prop: "addressPhone",
+      label: "鍏徃鍦板潃",
+      prop: "companyAddress",
       width: 250,
-    },
-    {
-      label: "鑱旂郴浜�",
-      prop: "contactPerson",
-    },
-    {
-      label: "鑱旂郴鐢佃瘽",
-      prop: "contactPhone",
-      width: 150,
     },
     {
       label: "璺熻繘杩涘害",
@@ -644,23 +613,26 @@
       width: 120,
     },
     {
-      label: "閾惰鍩烘湰鎴�",
-      prop: "basicBankAccount",
-      width: 220,
-    },
-    {
-      label: "閾惰璐﹀彿",
-      prop: "bankAccount",
-      width: 220,
-    },
-    {
-      label: "寮�鎴疯鍙�",
-      prop: "bankCode",
-      width: 220,
-    },
-    {
       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: "缁存姢鏃堕棿",
@@ -672,7 +644,7 @@
       label: "鎿嶄綔",
       align: "center",
       fixed: "right",
-      width: 250,
+      width: 290,
       operation: [
         {
           name: "缂栬緫",
@@ -681,13 +653,13 @@
             openForm("edit", row);
           },
         },
-        {
-          name: "璇︽儏",
-          type: "text",
-          clickFun: row => {
-            openDetailDialog(row);
-          },
-        },
+				{
+					name: "娣诲姞娲借皥杩涘害",
+					type: "text",
+					clickFun: row => {
+						openNegotiationDialog(row);
+					},
+				},
         {
           name: "鍥炶鎻愰啋",
           type: "text",
@@ -695,13 +667,13 @@
             openReminderDialog(row);
           },
         },
-        {
-          name: "娣诲姞娲借皥杩涘害",
-          type: "text",
-          clickFun: row => {
-            openNegotiationDialog(row);
-          },
-        },
+				{
+					name: "璇︽儏",
+					type: "text",
+					clickFun: row => {
+						openDetailDialog(row);
+					},
+				},
       ],
     },
   ]);
@@ -719,15 +691,6 @@
   // 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
   const operationType = ref("");
   const dialogFormVisible = ref(false);
-  const formYYs = ref({
-    // 鍏朵粬瀛楁...
-    contactList: [
-      {
-        contactPerson: "",
-        contactPhone: "",
-      },
-    ],
-  });
   const data = reactive({
     searchForm: {
       customerName: "",
@@ -735,34 +698,18 @@
     },
     form: {
       customerName: "",
-      taxpayerIdentificationNumber: "",
       companyAddress: "",
-      companyPhone: "",
-      contactPerson: "",
-      contactPhone: "",
       maintainer: "",
       maintenanceTime: "",
-      basicBankAccount: "",
-      bankAccount: "",
-      bankCode: "",
       customerType: "",
     },
     rules: {
       customerName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
-      taxpayerIdentificationNumber: [
-        { required: true, message: "璇疯緭鍏�", trigger: "blur" },
-      ],
       companyAddress: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
-      companyPhone: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
-      // contactPerson: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
-      // contactPhone: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
       maintainer: [{ required: false, message: "璇烽�夋嫨", trigger: "change" }],
       maintenanceTime: [
         { required: false, message: "璇烽�夋嫨", trigger: "change" },
       ],
-      basicBankAccount: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
-      bankAccount: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
-      bankCode: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
       customerType: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
     },
   });
@@ -776,7 +723,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);
@@ -822,18 +769,6 @@
     },
   });
   const { searchForm, form, rules } = toRefs(data);
-  const addNewContact = () => {
-    formYYs.value.contactList.push({
-      contactPerson: "",
-      contactPhone: "",
-    });
-  };
-
-  const removeContact = index => {
-    if (formYYs.value.contactList.length > 1) {
-      formYYs.value.contactList.splice(index, 1);
-    }
-  };
   // 鏌ヨ鍒楄〃
   /** 鎼滅储鎸夐挳鎿嶄綔 */
   const handleQuery = () => {
@@ -847,10 +782,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;
     });
   };
   // 琛ㄦ牸閫夋嫨鏁版嵁
@@ -869,34 +804,20 @@
   }
   /** 涓嬭浇妯℃澘 */
   function importTemplate() {
-    proxy.download("/basic/customer/downloadTemplate", {}, "瀹㈡埛瀵煎叆妯℃澘.xlsx");
+    proxy.download("/customerPrivate/downloadTemplate", {}, "瀹㈡埛瀵煎叆妯℃澘.xlsx");
   }
   // 鎵撳紑寮规
   const openForm = (type, row) => {
     operationType.value = type;
     form.value = {};
     form.value.maintainer = userStore.nickName;
-    formYYs.value.contactList = [
-      {
-        contactPerson: "",
-        contactPhone: "",
-      },
-    ];
     form.value.maintenanceTime = getCurrentDate();
     userListNoPage().then(res => {
       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(",")
-          .map((item, index) => {
-            return {
-              contactPerson: item,
-              contactPhone: res.data.contactPhone.split(",")[index],
-            };
-          });
       });
     }
     dialogFormVisible.value = true;
@@ -915,16 +836,7 @@
   };
   // 鎻愪氦鏂板
   const submitAdd = () => {
-    if (formYYs.value.contactList.length < 1) {
-      return proxy.$modal.msgWarning("璇疯嚦灏戞坊鍔犱竴涓仈绯讳汉");
-    }
-    form.value.contactPerson = formYYs.value.contactList
-      .map(item => item.contactPerson)
-      .join(",");
-    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();
@@ -932,13 +844,7 @@
   };
   // 鎻愪氦淇敼
   const submitEdit = () => {
-    form.value.contactPerson = formYYs.value.contactList
-      .map(item => item.contactPerson)
-      .join(",");
-    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();
@@ -957,7 +863,7 @@
       type: "warning",
     })
       .then(() => {
-        proxy.download("/basic/customer/export", {}, "瀹㈡埛妗f.xlsx");
+        proxy.download("/customerPrivate/export", {}, "瀹㈡埛妗f.xlsx");
       })
       .catch(() => {
         proxy.$modal.msg("宸插彇娑�");
@@ -967,12 +873,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);
@@ -987,8 +892,8 @@
     })
       .then(() => {
         tableLoading.value = true;
-        delCustomer(ids)
-          .then(res => {
+        delCustomerPrivate(ids)
+          .then(() => {
             proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
             getList();
           })
@@ -1003,10 +908,25 @@
 
   // 鎵撳紑鍥炶鎻愰啋寮圭獥
   const openReminderDialog = row => {
+    currentCustomerId.value = row.id;
     reminderForm.customerName = row.customerName;
     reminderForm.reminderSwitch = false;
     reminderForm.reminderContent = "";
     reminderForm.reminderTime = "";
+
+    // 灏濊瘯鑾峰彇宸叉湁鐨勫洖璁挎彁閱�
+    getReturnVisit(row.id)
+      .then(res => {
+        if (res.code === 200 && res.data) {
+          reminderForm.reminderSwitch = res.data.isEnabled === 1;
+          reminderForm.reminderContent = res.data.content;
+          reminderForm.reminderTime = res.data.reminderTime;
+          reminderForm.id = res.data.id;
+        }
+      })
+      .catch(error => {
+        console.error("鑾峰彇鍥炶鎻愰啋澶辫触:", error);
+      });
 
     reminderDialogVisible.value = true;
   };
@@ -1016,20 +936,47 @@
     proxy.resetForm("reminderFormRef");
     reminderDialogVisible.value = false;
   };
+  const submitvalue = ref({});
 
   // 鎻愪氦鍥炶鎻愰啋
   const submitReminderForm = () => {
+    console.log("鎻愪氦鍥炶鎻愰啋鏁版嵁:", userStore.id, userStore);
     proxy.$refs.reminderFormRef.validate(valid => {
       if (valid) {
-        // 杩欓噷鍋囪涓�涓帴鍙f潵鎻愪氦鍥炶鎻愰啋鏁版嵁
-        // 瀹為檯椤圭洰涓渶瑕佹牴鎹悗绔帴鍙h繘琛岃皟鏁�
-        console.log("鎻愪氦鍥炶鎻愰啋鏁版嵁:", reminderForm);
+        if (reminderForm.id) {
+          submitvalue.value = {
+            id: reminderForm.id,
+						customerPrivatePoolId: reminderForm.id,
+						customerPrivatePoolId: currentCustomerId.value,
+            isEnabled: reminderForm.reminderSwitch ? 1 : 0,
+            content: reminderForm.reminderContent,
+            reminderTime: reminderForm.reminderTime,
+            remindUserId: userStore.id,
+          };
+        } else {
+          submitvalue.value = {
+						customerPrivatePoolId: currentCustomerId.value,
+            isEnabled: reminderForm.reminderSwitch ? 1 : 0,
+            content: reminderForm.reminderContent,
+            reminderTime: reminderForm.reminderTime,
+            remindUserId: userStore.id,
+          };
+        }
 
-        // 妯℃嫙鎺ュ彛璋冪敤
-        setTimeout(() => {
-          proxy.$modal.msgSuccess("鍥炶鎻愰啋璁剧疆鎴愬姛");
-          closeReminderDialog();
-        }, 1000);
+        // 璋冪敤鎺ュ彛
+        addReturnVisit(submitvalue.value)
+          .then(res => {
+            if (res.code === 200) {
+              proxy.$modal.msgSuccess("鍥炶鎻愰啋璁剧疆鎴愬姛");
+              closeReminderDialog();
+            } else {
+              proxy.$modal.msgError(res.msg || "璁剧疆澶辫触");
+            }
+          })
+          .catch(error => {
+            console.error("璁剧疆鍥炶鎻愰啋澶辫触:", error);
+            proxy.$modal.msgError("璁剧疆澶辫触");
+          });
       }
     });
   };
@@ -1037,20 +984,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;
   };
 
@@ -1072,26 +1011,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 || [];
             });
@@ -1123,8 +1045,7 @@
 
   // 鎵撳紑璇︽儏寮圭獥
   const openDetailDialog = row => {
-    // 璋冪敤getCustomer鎺ュ彛鑾峰彇瀹㈡埛璇︽儏
-    getCustomer(row.id).then(res => {
+    getCustomerPrivatePoolInfo(row.id).then(res => {
       // 濉厖瀹㈡埛鍩烘湰淇℃伅
       Object.assign(detailForm, res.data);
 
@@ -1145,7 +1066,7 @@
     // 灏嗗綋鍓嶈褰曟暟鎹~鍏呭埌琛ㄥ崟
     Object.assign(negotiationForm, {
       customerName: row.customerName,
-      customerId: row.customerId,
+			customerPrivatePoolId: row.customerPrivatePoolId,
       followUpMethod: row.followUpMethod,
       followUpLevel: row.followUpLevel,
       followUpTime: row.followUpTime,
@@ -1173,7 +1094,7 @@
         // });
         delCustomerFollow(row.id).then(() => {
           // 鍒犻櫎鎴愬姛鍚庢洿鏂版湰鍦版暟鎹�
-          getCustomer(row.customerId).then(res => {
+          getCustomer(row.customerPrivatePoolId).then(res => {
             // 鏇存柊鏈湴鏁版嵁
             negotiationRecords.value = res.data.followUpList || [];
           });
@@ -1182,6 +1103,143 @@
         // 鏈湴鍒犻櫎锛堟ā鎷燂級
         negotiationRecords.value.splice(index, 1);
         proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+      })
+      .catch(() => {
+        proxy.$modal.msg("宸插彇娑堝垹闄�");
+      });
+  };
+
+  // 鎵撳紑闄勪欢寮圭獥
+  const openAttachmentDialog = row => {
+    currentFollowRecord.value = row;
+    // 杞崲涓虹鍚圗lement Plus fileList鏍煎紡鐨勬暟缁�
+    currentAttachmentList.value = (row.fileList || []).map((file, index) => ({
+      name: file.fileName,
+      url: file.fileUrl,
+      size: file.fileSize,
+      id: file.id,
+      uid: file.id || index,
+      status: "success",
+    }));
+
+    attachmentDialogVisible.value = true;
+  };
+
+  // 鍏抽棴闄勪欢寮圭獥
+  const closeAttachmentDialog = () => {
+    attachmentDialogVisible.value = false;
+    currentFollowRecord.value = {};
+    currentAttachmentList.value = [];
+  };
+
+  // 闄勪欢涓婁紶鎴愬姛
+  const handleAttachmentSuccess = (response, file, fileList) => {
+    if (response.code === 200) {
+      proxy.$modal.msgSuccess("涓婁紶鎴愬姛");
+      // 鏇存柊褰撳墠璁板綍鐨勯檮浠跺垪琛�
+      currentAttachmentList.value = fileList.map(item => ({
+        name: item.name,
+        size: item.size,
+        url: item.response?.data?.url || item.url,
+        id: item.response?.data?.id,
+        uid: item.uid,
+        status: "success",
+      }));
+      // 鏇存柊鍘熻褰曚腑鐨刦iles瀛楁
+      if (currentFollowRecord.value) {
+        currentFollowRecord.value.files = [...currentAttachmentList.value];
+      }
+    } else {
+      proxy.$modal.msgError(response.msg || "涓婁紶澶辫触");
+    }
+  };
+
+  // 闄勪欢涓婁紶澶辫触
+  const handleAttachmentError = (error, file, fileList) => {
+    console.error("涓婁紶澶辫触:", error);
+    proxy.$modal.msgError("涓婁紶澶辫触");
+  };
+
+  // 闄勪欢绉婚櫎
+  const handleAttachmentRemove = (file, fileList) => {
+    currentAttachmentList.value = fileList;
+    // 鏇存柊鍘熻褰曚腑鐨刦iles瀛楁
+    if (currentFollowRecord.value) {
+      currentFollowRecord.value.files = [...fileList];
+    }
+  };
+
+  // 闄勪欢涓婁紶鍓嶆牎楠�
+  const beforeAttachmentUpload = file => {
+    const maxSize = 50 * 1024 * 1024; // 50MB
+    if (file.size > maxSize) {
+      proxy.$modal.msgError("鏂囦欢澶у皬涓嶈兘瓒呰繃50MB");
+      return false;
+    }
+    return true;
+  };
+
+  // 鏍煎紡鍖栨枃浠跺ぇ灏�
+  const formatFileSize = size => {
+    if (size < 1024) {
+      return size + " B";
+    } else if (size < 1024 * 1024) {
+      return (size / 1024).toFixed(2) + " KB";
+    } else {
+      return (size / (1024 * 1024)).toFixed(2) + " MB";
+    }
+  };
+
+  // 涓嬭浇闄勪欢
+  const downloadAttachment = row => {
+    if (row.url) {
+      // proxy.download(row.url, {}, row.name);
+      proxy.$download.name(row.url);
+    } else {
+      proxy.$modal.msgError("涓嬭浇閾炬帴涓嶅瓨鍦�");
+    }
+  };
+
+  // 鍒犻櫎闄勪欢
+  const deleteAttachment = (row, index) => {
+    ElMessageBox.confirm("纭畾瑕佸垹闄よ繖涓檮浠跺悧锛�", "鍒犻櫎鎻愮ず", {
+      confirmButtonText: "纭畾",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    })
+      .then(() => {
+        // 璋冪敤鍚庣鎺ュ彛鍒犻櫎闄勪欢
+        const deleteUrl =
+          import.meta.env.VITE_APP_BASE_API +
+          "/basic/customer-follow/file/" +
+          row.id;
+        fetch(deleteUrl, {
+          method: "DELETE",
+          headers: {
+            Authorization: "Bearer " + getToken(),
+            "Content-Type": "application/json",
+          },
+        })
+          .then(response => response.json())
+          .then(res => {
+            if (res.code === 200) {
+              // 鍒犻櫎鎴愬姛鍚庢洿鏂版湰鍦版枃浠跺垪琛�
+              currentAttachmentList.value.splice(index, 1);
+              // 鏇存柊鍘熻褰曚腑鐨刦iles瀛楁
+              if (currentFollowRecord.value) {
+                currentFollowRecord.value.files = [
+                  ...currentAttachmentList.value,
+                ];
+              }
+              proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+            } else {
+              proxy.$modal.msgError(res.msg || "鍒犻櫎澶辫触");
+            }
+          })
+          .catch(error => {
+            console.error("鍒犻櫎闄勪欢澶辫触:", error);
+            proxy.$modal.msgError("鍒犻櫎澶辫触");
+          });
       })
       .catch(() => {
         proxy.$modal.msg("宸插彇娑堝垹闄�");
@@ -1255,4 +1313,34 @@
     color: #999;
     font-size: 14px;
   }
+
+  .attachment-section {
+    .upload-area {
+      margin-bottom: 20px;
+      padding: 20px;
+      background-color: #f9f9f9;
+      border-radius: 4px;
+      border: 1px dashed #d9d9d9;
+
+      .el-upload__tip {
+        margin-top: 10px;
+        color: #909399;
+      }
+    }
+
+    .attachment-list {
+      h4 {
+        margin: 0 0 10px 0;
+        font-size: 14px;
+        color: #606266;
+      }
+    }
+
+    .no-attachment {
+      text-align: center;
+      padding: 40px;
+      color: #909399;
+      font-size: 14px;
+    }
+  }
 </style>

--
Gitblit v1.9.3