From 967ca126479ea5ca51726cdad1e6275571d4d3bc Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期六, 18 四月 2026 10:38:58 +0800
Subject: [PATCH] Merge branch 'dev_河南_鹤壁天沐玻璃厂' of http://114.132.189.42:9002/r/product-inventory-management into dev_河南_鹤壁天沐玻璃厂

---
 src/views/basicData/customerFile/index.vue |  157 ++++++++++++++++++++++++++++++++--------------------
 1 files changed, 97 insertions(+), 60 deletions(-)

diff --git a/src/views/basicData/customerFile/index.vue b/src/views/basicData/customerFile/index.vue
index 6f4a159..db8bad8 100644
--- a/src/views/basicData/customerFile/index.vue
+++ b/src/views/basicData/customerFile/index.vue
@@ -16,14 +16,12 @@
                        @click="handleDeleteRegion">鍒犻櫎</el-button>
           </div>
         </div>
-
         <div class="left-search">
           <el-input v-model="regionKeyword"
                     placeholder="鏌ヨ鍦板尯"
                     clearable
                     :prefix-icon="Search" />
         </div>
-
         <div class="left-list">
           <el-skeleton v-if="regionsLoading"
                        :rows="8"
@@ -46,46 +44,45 @@
           </template>
         </div>
       </div>
-
       <div class="right-panel">
         <div class="toolbar-card">
           <div class="search_form right-search-form">
-          <div class="search-fields">
-            <span class="search_title">瀹㈡埛鍚嶇О锛�</span>
-            <el-input v-model="searchForm.customerName"
-                      style="width: 240px;margin-right: 10px"
-                      placeholder="璇疯緭鍏�"
-                      @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 label="闆跺敭瀹㈡埛"
-                         value="闆跺敭瀹㈡埛" />
-              <el-option label="杩涢攢鍟嗗鎴�"
-                         value="杩涢攢鍟嗗鎴�" />
-            </el-select>
-            <el-button type="primary"
-                       @click="handleQuery"
-                       style="margin-left: 10px">鎼滅储</el-button>
-          </div>
-          <div class="toolbar-divider"></div>
-          <div class="action-buttons">
-            <el-button type="primary"
-                       @click="openForm('add')">鏂板瀹㈡埛</el-button>
-            <el-button @click="handleOut">瀵煎嚭</el-button>
-            <el-button type="info"
-                       plain
-                       icon="Upload"
-                       @click="handleImport">瀵煎叆</el-button>
-            <el-button type="danger"
-                       plain
-                       @click="handleDelete">鍒犻櫎</el-button>
-          </div>
+            <div class="search-fields">
+              <span class="search_title">瀹㈡埛鍚嶇О锛�</span>
+              <el-input v-model="searchForm.customerName"
+                        style="width: 240px;margin-right: 10px"
+                        placeholder="璇疯緭鍏�"
+                        @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 label="闆跺敭瀹㈡埛"
+                           value="闆跺敭瀹㈡埛" />
+                <el-option label="杩涢攢鍟嗗鎴�"
+                           value="杩涢攢鍟嗗鎴�" />
+              </el-select>
+              <el-button type="primary"
+                         @click="handleQuery"
+                         style="margin-left: 10px">鎼滅储</el-button>
+            </div>
+            <div class="toolbar-divider"></div>
+            <div class="action-buttons">
+              <el-button type="primary"
+                         @click="openForm('add')">鏂板瀹㈡埛</el-button>
+              <el-button @click="handleOut">瀵煎嚭</el-button>
+              <el-button type="info"
+                         plain
+                         icon="Upload"
+                         @click="handleImport">瀵煎叆</el-button>
+              <el-button type="danger"
+                         plain
+                         @click="handleDelete">鍒犻櫎</el-button>
+            </div>
           </div>
         </div>
         <div class="table_list table-card">
@@ -100,7 +97,6 @@
         </div>
       </div>
     </div>
-
     <el-dialog v-model="addRegionDialogVisible"
                title="鏂板鍦板尯"
                width="420px"
@@ -115,7 +111,8 @@
                        filterable
                        placeholder="涓嶉�夊垯涓洪《绾у湴鍖�" />
         </el-form-item>
-        <el-form-item label="鍦板尯鍚嶇О" required>
+        <el-form-item label="鍦板尯鍚嶇О"
+                      required>
           <el-input v-model="addRegionForm.regionsName"
                     placeholder="璇疯緭鍏�"
                     clearable />
@@ -326,6 +323,7 @@
     <!-- 鐢ㄦ埛瀵煎叆瀵硅瘽妗� -->
     <el-dialog :title="upload.title"
                v-model="upload.open"
+               @close="onClose"
                width="400px"
                append-to-body>
       <el-upload ref="uploadRef"
@@ -458,7 +456,7 @@
               </div>
             </el-col>
           </el-row>
-          <el-row :gutter="20"> 
+          <el-row :gutter="20">
             <el-col :span="12">
               <div class="info-item">
                 <span class="info-label">缁存姢鏃堕棿锛�</span>
@@ -483,7 +481,15 @@
 </template>
 
 <script setup>
-  import { onMounted, ref, reactive, getCurrentInstance, toRefs, computed, watch } from "vue";
+  import {
+    onMounted,
+    ref,
+    reactive,
+    getCurrentInstance,
+    toRefs,
+    computed,
+    watch,
+  } from "vue";
   import { Search } from "@element-plus/icons-vue";
   import {
     addCustomer,
@@ -676,13 +682,13 @@
         //     openReminderDialog(row);
         //   },
         // },
-				{
-					name: "璇︽儏",
-					type: "text",
-					clickFun: row => {
-						openDetailDialog(row);
-					},
-				},
+        {
+          name: "璇︽儏",
+          type: "text",
+          clickFun: row => {
+            openDetailDialog(row);
+          },
+        },
       ],
     },
   ]);
@@ -812,7 +818,11 @@
   const addRegionDialogVisible = ref(false);
   const editRegionDialogVisible = ref(false);
   const addRegionForm = reactive({ parentPath: [], regionsName: "" });
-  const editRegionForm = reactive({ id: undefined, parentId: 0, regionsName: "" });
+  const editRegionForm = reactive({
+    id: undefined,
+    parentId: 0,
+    regionsName: "",
+  });
   const regionTreeProps = { label: "label", children: "children" };
   const regionCascaderProps = {
     value: "id",
@@ -844,6 +854,10 @@
       regionsName: item.regionsName || item.label || "",
       children: normalizeRegionTree(item.children || []),
     }));
+  };
+  const onClose = () => {
+    upload.open = false;
+    proxy.$refs["uploadRef"].clearFiles();
   };
 
   const fetchRegions = async () => {
@@ -908,7 +922,9 @@
     editRegionForm.id = selectedRegionNode.value.id;
     editRegionForm.parentId = selectedRegionNode.value.parentId || 0;
     editRegionForm.regionsName =
-      selectedRegionNode.value.regionsName || selectedRegionNode.value.label || "";
+      selectedRegionNode.value.regionsName ||
+      selectedRegionNode.value.label ||
+      "";
     editRegionDialogVisible.value = true;
   };
   const closeEditRegionDialog = () => {
@@ -966,7 +982,11 @@
       if ((item.regionsName || item.label) === targetName) {
         return currentPath;
       }
-      const childResult = findRegionPathByName(item.children || [], targetName, currentPath);
+      const childResult = findRegionPathByName(
+        item.children || [],
+        targetName,
+        currentPath
+      );
       if (childResult.length) return childResult;
     }
     return [];
@@ -978,7 +998,11 @@
       if (String(item.id) === String(targetId)) {
         return currentPath;
       }
-      const childResult = findRegionPathById(item.children || [], targetId, currentPath);
+      const childResult = findRegionPathById(
+        item.children || [],
+        targetId,
+        currentPath
+      );
       if (childResult.length) return childResult;
     }
     return [];
@@ -1054,7 +1078,10 @@
       getCustomer(row.id).then(res => {
         form.value = { ...res.data };
         const regionIdForEdit = form.value.regionsId || form.value.regionsld;
-        formRegionPath.value = findRegionPathById(regionTreeData.value, regionIdForEdit);
+        formRegionPath.value = findRegionPathById(
+          regionTreeData.value,
+          regionIdForEdit
+        );
         if (!formRegionPath.value.length) {
           formRegionPath.value = findRegionPathByName(
             regionTreeData.value,
@@ -1066,10 +1093,12 @@
             ? formRegionPath.value[formRegionPath.value.length - 1]
             : "";
         if (selectedRegionId && !form.value.regions) {
-          form.value.regions = regionNodeMap.value.get(selectedRegionId)?.regionsName || "";
+          form.value.regions =
+            regionNodeMap.value.get(selectedRegionId)?.regionsName || "";
         }
         form.value.regionsId = form.value.regionsId || selectedRegionId;
-        form.value.regionsld = form.value.regionsld || form.value.regionsId || selectedRegionId;
+        form.value.regionsld =
+          form.value.regionsld || form.value.regionsId || selectedRegionId;
         formYYs.value.contactList = res.data.contactPerson
           .split(",")
           .map((item, index) => {
@@ -1106,7 +1135,8 @@
       .map(item => item.contactPhone)
       .join(",");
     if (!form.value.regionsId && formRegionPath.value.length) {
-      form.value.regionsId = formRegionPath.value[formRegionPath.value.length - 1];
+      form.value.regionsId =
+        formRegionPath.value[formRegionPath.value.length - 1];
     }
     form.value.regionsld = form.value.regionsId || "";
     addCustomer(form.value).then(res => {
@@ -1124,7 +1154,8 @@
       .map(item => item.contactPhone)
       .join(",");
     if (!form.value.regionsId && formRegionPath.value.length) {
-      form.value.regionsId = formRegionPath.value[formRegionPath.value.length - 1];
+      form.value.regionsId =
+        formRegionPath.value[formRegionPath.value.length - 1];
     }
     form.value.regionsld = form.value.regionsId || "";
     updateCustomer(form.value).then(res => {
@@ -1300,7 +1331,13 @@
   .toolbar-divider {
     width: 1px;
     align-self: stretch;
-    background: linear-gradient(to bottom, transparent, #e4e7ed 15%, #e4e7ed 85%, transparent);
+    background: linear-gradient(
+      to bottom,
+      transparent,
+      #e4e7ed 15%,
+      #e4e7ed 85%,
+      transparent
+    );
   }
 
   .action-buttons {

--
Gitblit v1.9.3