From dacc95761cf7090c628fc37a5d4f8bb825ccbbb0 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期六, 16 五月 2026 15:41:45 +0800
Subject: [PATCH] 企业新闻和通知公告

---
 src/views/salesManagement/salesQuotation/index.vue |   33 ++++++++++++++++++++-------------
 1 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/src/views/salesManagement/salesQuotation/index.vue b/src/views/salesManagement/salesQuotation/index.vue
index 687b6d1..2237b72 100644
--- a/src/views/salesManagement/salesQuotation/index.vue
+++ b/src/views/salesManagement/salesQuotation/index.vue
@@ -16,8 +16,8 @@
           </el-input>
         </el-col>
         <el-col :span="8">
-          <el-select v-model="searchForm.customer" placeholder="璇烽�夋嫨瀹㈡埛" clearable>
-						<el-option v-for="item in customerOption" :key="item.id" :label="item.customerName" :value="item.customerName">
+          <el-select v-model="searchForm.customerId" placeholder="璇烽�夋嫨瀹㈡埛" clearable>
+						<el-option v-for="item in customerOption" :key="item.id" :label="item.customerName" :value="item.id">
 							{{
 								item.customerName + "鈥斺��" + item.taxpayerIdentificationNumber
 							}}
@@ -102,8 +102,8 @@
           <div class="form-content">
             <el-row :gutter="24">
               <el-col :span="12">
-                <el-form-item label="瀹㈡埛鍚嶇О" prop="customer">
-                  <el-select v-model="form.customer" placeholder="璇烽�夋嫨瀹㈡埛" style="width: 100%" clearable filterable>
+                <el-form-item label="瀹㈡埛鍚嶇О" prop="customerId">
+                  <el-select v-model="form.customerId" placeholder="璇烽�夋嫨瀹㈡埛" style="width: 100%" clearable filterable>
                     <el-option v-for="item in customerOption" :key="item.id" :label="item.customerName" :value="item.id"></el-option>
                   </el-select>
                 </el-form-item>
@@ -301,14 +301,14 @@
 import FormDialog from '@/components/Dialog/FormDialog.vue'
 import {getQuotationList,addQuotation,updateQuotation,deleteQuotation} from '@/api/salesManagement/salesQuotation.js'
 import {modelList, productTreeList} from "@/api/basicData/product.js";
-import {listCustomerPrivatePool} from "@/api/basicData/customerFile.js";
+import {listCustomer} from "@/api/basicData/customer.js";
 import { userListNoPage } from "@/api/system/user.js";
 
 // 鍝嶅簲寮忔暟鎹�
 const loading = ref(false)
 const searchForm = reactive({
   quotationNo: '',
-  customer: '',
+  customerId: '',
   status: ''
 })
 
@@ -327,6 +327,7 @@
 const dialogTitle = ref('鏂板鎶ヤ环')
 const form = reactive({
   quotationNo: '',
+  customerId: undefined,
   customer: '',
   salesperson: '',
   quotationDate: '',
@@ -400,18 +401,20 @@
   handleSearch()
 }
 
-const loadCustomerOptions = async () => {
-  const res = await listCustomerPrivatePool({ current: -1, size: -1 });
-  customerOption.value = res?.data?.records || [];
-}
-
 const handleAdd = async () => {
   dialogTitle.value = '鏂板鎶ヤ环'
   isEdit.value = false
   resetForm()
   dialogVisible.value = true
   getProductOptions();
-  loadCustomerOptions();
+  fetchCustomerOptions()
+}
+
+const fetchCustomerOptions = () => {
+  if (customerOption.value.length > 0) return
+  listCustomer({current: -1,size:-1, type: 0}).then((res) => {
+    customerOption.value = res.data.records;
+  });
 }
 const getProductOptions = () => {
 	// 杩斿洖 Promise锛屼究浜庣紪杈戞椂 await 纭繚鑳藉弽鏄�
@@ -539,10 +542,12 @@
   form.id = row.id || form.id || null
   // 鍏堝姞杞戒骇鍝佹爲鏁版嵁锛屽惁鍒� el-tree-select 鏃犳硶鍙嶆樉浜у搧鍚嶇О
   await getProductOptions()
+  await fetchCustomerOptions()
 
   // 鍙鍒堕渶瑕佺殑瀛楁锛岄伩鍏嶅皢缁勪欢寮曠敤鏀惧叆鍝嶅簲寮忓璞�
   form.quotationNo = row.quotationNo || ''
   form.customer = row.customer || ''
+  form.customerId = row.customerId || undefined
   form.salesperson = row.salesperson || ''
   form.quotationDate = row.quotationDate || ''
   form.validDate = row.validDate || ''
@@ -688,6 +693,7 @@
         return sum + price
       }, 0)
 
+      form.customer = customerOption.value.find(item => item.id === form.customerId)?.customerName || ''
       if (isEdit.value) {
         // 缂栬緫
         const index = quotationList.value.findIndex(item => item.id === editId.value)
@@ -737,6 +743,7 @@
         id: item.id,
         quotationNo: item.quotationNo || '',
         customer: item.customer || '',
+        customerId: item.customerId || undefined,
         salesperson: item.salesperson || '',
         quotationDate: item.quotationDate || '',
         validDate: item.validDate || '',
@@ -782,8 +789,8 @@
 
 onMounted(()=>{
   getUserList()
-  loadCustomerOptions()
   handleSearch()
+  fetchCustomerOptions()
 })
 </script>
 

--
Gitblit v1.9.3