From bcc665fab6efc7c73d6034272a29ab3f15fe1cf8 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期三, 29 四月 2026 13:57:30 +0800
Subject: [PATCH] 修改报价客户显示

---
 src/views/basicData/customerFile/index.vue |  123 ++++++++++++++++++-----------------------
 1 files changed, 54 insertions(+), 69 deletions(-)

diff --git a/src/views/basicData/customerFile/index.vue b/src/views/basicData/customerFile/index.vue
index ad1c5bb..e61f77c 100644
--- a/src/views/basicData/customerFile/index.vue
+++ b/src/views/basicData/customerFile/index.vue
@@ -211,7 +211,8 @@
                  :limit="1"
                  accept=".xlsx, .xls"
                  :headers="upload.headers"
-                 :action="upload.url + '?updateSupport=' + upload.updateSupport"
+                 :action="upload.url"
+                 :data="upload.data"
                  :disabled="upload.isUploading"
                  :before-upload="upload.beforeUpload"
                  :on-progress="upload.onProgress"
@@ -276,9 +277,8 @@
       </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,9 +360,8 @@
       </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>
@@ -494,7 +493,6 @@
             <template #default="{ row }">
               <el-button type="info"
                          link
-                         size="small"
                          @click="openAttachmentDialog(row)">
                 <el-icon>
                   <Paperclip />
@@ -510,13 +508,11 @@
             <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>
@@ -587,13 +583,11 @@
               <template #default="{ row, $index }">
                 <el-button type="primary"
                            link
-                           size="small"
                            @click="downloadAttachment(row)">
                   涓嬭浇
                 </el-button>
                 <el-button type="danger"
                            link
-                           size="small"
                            @click="deleteAttachment(row, $index)">
                   鍒犻櫎
                 </el-button>
@@ -619,17 +613,13 @@
   import { onMounted, ref, reactive, getCurrentInstance, toRefs } from "vue";
   import { Search, Paperclip, Upload } from "@element-plus/icons-vue";
   import {
-    addCustomer,
-    delCustomer,
-    getCustomer,
-    listCustomer,
-    updateCustomer,
     addCustomerFollow,
     updateCustomerFollow,
     delCustomerFollow,
     addReturnVisit,
     getReturnVisit,
   } from "@/api/basicData/customerFile.js";
+  import {listCustomer, getCustomer, 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";
@@ -661,7 +651,7 @@
   const negotiationFormRef = ref();
   const negotiationForm = reactive({
     customerName: "",
-    customerId: "",
+		customerId: "",
     followUpMethod: "",
     followUpLevel: "",
     followUpTime: "",
@@ -733,7 +723,7 @@
     },
     {
       label: "鍦板潃鍙婅仈绯绘柟寮�",
-      prop: "addressPhone",
+      prop: "companyAddress",
       width: 250,
     },
     {
@@ -775,6 +765,24 @@
       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: "缁存姢鏃堕棿",
       prop: "maintenanceTime",
       width: 100,
@@ -784,7 +792,7 @@
       label: "鎿嶄綔",
       align: "center",
       fixed: "right",
-      width: 250,
+      width: 290,
       operation: [
         {
           name: "缂栬緫",
@@ -793,13 +801,13 @@
             openForm("edit", row);
           },
         },
-        {
-          name: "璇︽儏",
-          type: "text",
-          clickFun: row => {
-            openDetailDialog(row);
-          },
-        },
+				{
+					name: "娣诲姞娲借皥杩涘害",
+					type: "text",
+					clickFun: row => {
+						openNegotiationDialog(row);
+					},
+				},
         {
           name: "鍥炶鎻愰啋",
           type: "text",
@@ -807,13 +815,13 @@
             openReminderDialog(row);
           },
         },
-        {
-          name: "娣诲姞娲借皥杩涘害",
-          type: "text",
-          clickFun: row => {
-            openNegotiationDialog(row);
-          },
-        },
+				{
+					name: "璇︽儏",
+					type: "text",
+					clickFun: row => {
+						openDetailDialog(row);
+					},
+				},
       ],
     },
   ]);
@@ -844,6 +852,7 @@
     searchForm: {
       customerName: "",
       customerType: "",
+      type: 0
     },
     form: {
       customerName: "",
@@ -858,6 +867,7 @@
       bankAccount: "",
       bankCode: "",
       customerType: "",
+      type: 0
     },
     rules: {
       customerName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
@@ -889,6 +899,9 @@
     headers: { Authorization: "Bearer " + getToken() },
     // 涓婁紶鐨勫湴鍧�
     url: import.meta.env.VITE_APP_BASE_API + "/basic/customer/importData",
+    data: {
+      type: 0
+    },
     // 鏂囦欢涓婁紶鍓嶇殑鍥炶皟
     beforeUpload: file => {
       console.log("鏂囦欢鍗冲皢涓婁紶", file);
@@ -961,8 +974,8 @@
     tableLoading.value = true;
     listCustomer({ ...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;
     });
   };
   // 琛ㄦ牸閫夋嫨鏁版嵁
@@ -994,6 +1007,7 @@
         contactPhone: "",
       },
     ];
+    form.value.type = 0;
     form.value.maintenanceTime = getCurrentDate();
     userListNoPage().then(res => {
       userList.value = res.data;
@@ -1069,7 +1083,7 @@
       type: "warning",
     })
       .then(() => {
-        proxy.download("/basic/customer/export", {}, "瀹㈡埛妗f.xlsx");
+        proxy.download("/basic/customer/export", {type: 0}, "瀹㈡埛妗f.xlsx");
       })
       .catch(() => {
         proxy.$modal.msg("宸插彇娑�");
@@ -1079,12 +1093,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);
@@ -1100,7 +1113,7 @@
       .then(() => {
         tableLoading.value = true;
         delCustomer(ids)
-          .then(res => {
+          .then(() => {
             proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
             getList();
           })
@@ -1153,7 +1166,7 @@
         if (reminderForm.id) {
           submitvalue.value = {
             id: reminderForm.id,
-            customerId: currentCustomerId.value,
+						customerId: currentCustomerId.value,
             isEnabled: reminderForm.reminderSwitch ? 1 : 0,
             content: reminderForm.reminderContent,
             reminderTime: reminderForm.reminderTime,
@@ -1168,8 +1181,6 @@
             remindUserId: userStore.id,
           };
         }
-
-        console.log("鎻愪氦鍥炶鎻愰啋鏁版嵁:", submitvalue.value);
 
         // 璋冪敤鎺ュ彛
         addReturnVisit(submitvalue.value)
@@ -1198,14 +1209,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;
   };
 
@@ -1227,23 +1230,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 => {
@@ -1278,7 +1264,6 @@
 
   // 鎵撳紑璇︽儏寮圭獥
   const openDetailDialog = row => {
-    // 璋冪敤getCustomer鎺ュ彛鑾峰彇瀹㈡埛璇︽儏
     getCustomer(row.id).then(res => {
       // 濉厖瀹㈡埛鍩烘湰淇℃伅
       Object.assign(detailForm, res.data);
@@ -1300,7 +1285,7 @@
     // 灏嗗綋鍓嶈褰曟暟鎹~鍏呭埌琛ㄥ崟
     Object.assign(negotiationForm, {
       customerName: row.customerName,
-      customerId: row.customerId,
+			customerId: row.customerId,
       followUpMethod: row.followUpMethod,
       followUpLevel: row.followUpLevel,
       followUpTime: row.followUpTime,

--
Gitblit v1.9.3