From f4a4737d69746268f3648effcf66e1c1c83e64e1 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 29 四月 2026 14:03:23 +0800
Subject: [PATCH] 公司7004 1.标书台账页面开发与联调 2.客户管理添加客户类型字段

---
 src/views/salesManagement/opportunityManagement/index.vue |   37 ++++++++++++++++++++++++-------------
 1 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/src/views/salesManagement/opportunityManagement/index.vue b/src/views/salesManagement/opportunityManagement/index.vue
index 8547ffb..900f5ec 100644
--- a/src/views/salesManagement/opportunityManagement/index.vue
+++ b/src/views/salesManagement/opportunityManagement/index.vue
@@ -456,7 +456,9 @@
 const userList = ref([])
 const customerOption = ref([])
 const DEFAULT_USER_QUERY = { postCode: 'Market_Sales' }
+const DEFAULT_CUSTOMER_QUERY = { customerType: 2 }
 let userListPromise = null
+let customerListPromise = null
 
 const loadUserList = async (query = DEFAULT_USER_QUERY) => {
   if (userListPromise) return userListPromise
@@ -473,6 +475,23 @@
     }
   })()
   return userListPromise
+}
+
+const loadCustomerList = async (query = DEFAULT_CUSTOMER_QUERY) => {
+  if (customerListPromise) return customerListPromise
+  customerListPromise = (async () => {
+    try {
+      const res = await customerList(query)
+      customerOption.value = res || []
+      return customerOption.value
+    } catch (err) {
+      console.error('鑾峰彇瀹㈡埛鍒楄〃澶辫触:', err)
+      customerOption.value = []
+      customerListPromise = null
+      throw err
+    }
+  })()
+  return customerListPromise
 }
 
 // 鍒嗛〉閰嶇疆
@@ -703,9 +722,7 @@
   
   // 鍔犺浇鐢ㄦ埛鍒楄〃鍜屽鎴峰垪琛�
   await loadUserList()
-  customerList().then((res) => {
-    customerOption.value = res
-  })
+  await loadCustomerList()
 	getProvinceList().then(res => {
 		provinceOptions.value = res.data
 	})
@@ -724,9 +741,7 @@
   
   // 鍔犺浇鐢ㄦ埛鍒楄〃鍜屽鎴峰垪琛�
   await loadUserList()
-  customerList().then((res) => {
-    customerOption.value = res
-  })
+  await loadCustomerList()
   
   // 浣跨敤褰撳墠琛屾暟鎹綔涓哄熀纭�锛屼絾鍙兘淇敼鐘舵�佸拰鎷滆璁板綍锛涗粯娆炬弿杩般�佹敼閫犲唴瀹圭瓑淇濈暀鍙嶆樉
   Object.assign(form, row, {
@@ -745,9 +760,7 @@
   
   // 鍔犺浇鐢ㄦ埛鍒楄〃鍜屽鎴峰垪琛�
   await loadUserList()
-  customerList().then((res) => {
-    customerOption.value = res
-  })
+  await loadCustomerList()
   
   // 浣跨敤updateTime浣滀负褰曞叆鏃堕棿鍙嶆樉
   Object.assign(form, row, {
@@ -787,9 +800,7 @@
   
   // 鍔犺浇鐢ㄦ埛鍒楄〃鍜屽鎴峰垪琛�
   await loadUserList()
-  customerList().then((res) => {
-    customerOption.value = res
-  })
+  await loadCustomerList()
   
   // 鍔犺浇鐪佷唤鍒楄〃
   await getProvinceList().then(res => {
@@ -1162,4 +1173,4 @@
     }
   }
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.3