From 5956b34b1bd9198a787a1e0ea290b2cd99d898f2 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 22 九月 2026 09:47:52 +0800
Subject: [PATCH] 新疆-融邦环保 1.大屏展示数据修改 2.销售台账展示字段修改

---
 src/views/basicData/customerFile/index.vue |   79 ++++++++++++++++++++++++++++++++-------
 1 files changed, 64 insertions(+), 15 deletions(-)

diff --git a/src/views/basicData/customerFile/index.vue b/src/views/basicData/customerFile/index.vue
index 562720d..2773c55 100644
--- a/src/views/basicData/customerFile/index.vue
+++ b/src/views/basicData/customerFile/index.vue
@@ -9,17 +9,6 @@
                   @change="handleQuery"
                   clearable
                   :prefix-icon="Search" />
-        <span class="search_title">瀹㈡埛鍒嗙被锛�</span>
-        <el-select v-model="searchForm.customerType"
-                   placeholder="璇烽�夋嫨"
-                   style="width: 240px"
-                   clearable
-                   @change="handleQuery">
-          <el-option v-for="dict in customer_type"
-                     :key="dict.value"
-                     :label="dict.label"
-                     :value="dict.value" />
-        </el-select>
         <el-button type="primary"
                    @click="handleQuery"
                    style="margin-left: 10px">鎼滅储</el-button>
@@ -40,6 +29,17 @@
                    @click="handleDelete">鍒犻櫎</el-button>
       </div>
     </div>
+    <!-- 鎸夈�屽鎴峰垎绫汇�嶆媶椤电锛涖�屽叏閮ㄣ�嶄笉甯﹀垎绫绘煡璇紝淇濊瘉杩樻病琛ュ垎绫荤殑鑰佹暟鎹篃鑳界湅鍒� -->
+    <el-tabs v-model="activeTab"
+             @tab-change="handleTabChange"
+             class="customer-tabs">
+      <el-tab-pane label="鍏ㄩ儴"
+                   name="鍏ㄩ儴" />
+      <el-tab-pane label="閿�鍞鎴�"
+                   name="閿�鍞鎴�" />
+      <el-tab-pane label="浠e偍瀹㈡埛"
+                   name="浠e偍瀹㈡埛" />
+    </el-tabs>
     <div class="table_list">
       <PIMTable rowKey="id"
                 :column="tableColumn"
@@ -661,7 +661,14 @@
 </template>
 
 <script setup>
-  import { onMounted, ref, reactive, getCurrentInstance, toRefs } from "vue";
+  import {
+    onMounted,
+    ref,
+    reactive,
+    getCurrentInstance,
+    toRefs,
+    watch,
+  } from "vue";
   import { Search, Paperclip, Upload } from "@element-plus/icons-vue";
   import {
     addCustomerFollow,
@@ -933,7 +940,6 @@
   const data = reactive({
     searchForm: {
       customerName: "",
-      customerType: "",
       type: 0
     },
     form: {
@@ -1054,14 +1060,37 @@
     page.size = obj.limit;
     getList();
   };
+  // 鍏ㄩ儴 / 閿�鍞鎴� / 浠e偍瀹㈡埛涓変釜椤电锛屽悇鑷甫瀹㈡埛鍒嗙被鏌ュ悓涓�涓垪琛ㄦ帴鍙�
+  const activeTab = ref("鍏ㄩ儴");
+  // 銆屽叏閮ㄣ�嶄笉浼犲垎绫伙紙undefined 浼氳 axios 涓㈡帀锛夛紝閿�鍞�/浠e偍鎸夊瓧鍏稿�肩瓫锛�
+  // 瀛楀吀鐨� value 鏈繀灏辨槸涓枃鏍囩锛屾寜 label 鍙嶆煡鐪熷疄鍙栧�煎啀浼犳帴鍙�
+  const activeCustomerType = () => {
+    if (activeTab.value === "鍏ㄩ儴") {
+      return undefined;
+    }
+    const list = customer_type.value || [];
+    const hit = list.find(item => item.label === activeTab.value);
+    return hit ? hit.value : activeTab.value;
+  };
+  // 椤电鍒囨崲锛氭崲瀹㈡埛鍒嗙被閲嶆柊鏌ュ垪琛�
+  const handleTabChange = () => {
+    page.current = 1;
+    getList();
+  };
   const getList = () => {
     tableLoading.value = true;
-    listCustomer({ ...searchForm.value, ...page }).then(res => {
+    listCustomer({
+      ...searchForm.value,
+      ...page,
+      customerType: activeCustomerType(),
+    }).then(res => {
       tableLoading.value = false;
       tableData.value = res.data.records;
       page.total = res.data.total;
     });
   };
+  // 瀛楀吀鏄紓姝ユ媺鐨勶紝鍒拌揪鍚庢寜鐪熷疄瀛楀吀鍊奸噸鏌ヤ竴娆★紝閬垮厤棣栧睆鐢ㄤ腑鏂囨爣绛剧瓫涓嶅埌鏁版嵁
+  watch(customer_type, () => getList());
   // 琛ㄦ牸閫夋嫨鏁版嵁
   const handleSelectionChange = selection => {
     selectedRows.value = selection;
@@ -1096,6 +1125,8 @@
       },
     ];
     form.value.type = 0;
+    // 瀹㈡埛鍒嗙被榛樿璺熼殢褰撳墠椤电
+    form.value.customerType = activeCustomerType();
     form.value.maintenanceTime = getCurrentDate();
     userListNoPage().then(res => {
       userList.value = res.data;
@@ -1177,7 +1208,12 @@
       type: "warning",
     })
       .then(() => {
-        proxy.download("/basic/customer/export", {type: 0}, "瀹㈡埛妗f.xlsx");
+        // 瀵煎嚭璺熼殢褰撳墠椤电鐨勫鎴峰垎绫�
+        proxy.download(
+          "/basic/customer/export",
+          { type: 0, customerType: activeCustomerType() },
+          "瀹㈡埛妗f.xlsx"
+        );
       })
       .catch(() => {
         proxy.$modal.msg("宸插彇娑�");
@@ -1604,6 +1640,19 @@
 </script>
 
 <style scoped lang="scss">
+  /* 閿�鍞鎴� / 浠e偍瀹㈡埛椤电锛氬彧瑕佹爣绛炬爮锛屽唴瀹圭敱涓嬫柟鍒楄〃灞曠ず */
+  .customer-tabs {
+    margin-bottom: 8px;
+
+    :deep(.el-tabs__header) {
+      margin-bottom: 0;
+    }
+
+    :deep(.el-tabs__content) {
+      display: none;
+    }
+  }
+
   .detail-section {
     margin-bottom: 20px;
     padding: 15px;

--
Gitblit v1.9.3