From 2cb71b3a0e63aae9d9beb13863c69b4c10397025 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期一, 25 五月 2026 13:37:25 +0800
Subject: [PATCH] feat(customer): 使用字典数据优化客户类型选择功能

---
 src/views/basicData/customerFile/index.vue         |   27 ++++++++++++++++++---------
 src/views/salesManagement/salesQuotation/index.vue |    2 +-
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/src/views/basicData/customerFile/index.vue b/src/views/basicData/customerFile/index.vue
index 6b1c06e..aa99bf6 100644
--- a/src/views/basicData/customerFile/index.vue
+++ b/src/views/basicData/customerFile/index.vue
@@ -15,10 +15,10 @@
                    style="width: 240px"
                    clearable
                    @change="handleQuery">
-          <el-option label="闆跺敭瀹㈡埛"
-                     value="闆跺敭瀹㈡埛"/>
-          <el-option label="杩涢攢鍟嗗鎴�"
-                     value="杩涢攢鍟嗗鎴�"/>
+          <el-option v-for="dict in customerTypeOptions"
+                     :key="dict.value"
+                     :label="dict.label"
+                     :value="dict.value"/>
         </el-select>
         <el-button type="primary"
                    @click="handleQuery"
@@ -130,10 +130,10 @@
               <el-select v-model="form.customerType"
                          placeholder="璇烽�夋嫨"
                          clearable>
-                <el-option label="闆跺敭瀹㈡埛"
-                           value="闆跺敭瀹㈡埛"/>
-                <el-option label="杩涢攢鍟嗗鎴�"
-                           value="杩涢攢鍟嗗鎴�"/>
+                <el-option v-for="dict in customerTypeOptions"
+                           :key="dict.value"
+                           :label="dict.label"
+                           :value="dict.value"/>
               </el-select>
             </el-form-item>
           </el-col>
@@ -425,7 +425,7 @@
             <el-col :span="12">
               <div class="info-item">
                 <span class="info-label">瀹㈡埛鍒嗙被锛�</span>
-                <span class="info-value">{{ detailForm.customerType }}</span>
+                <span class="info-value">{{ getCustomerTypeLabel(detailForm.customerType) }}</span>
               </div>
             </el-col>
           </el-row>
@@ -671,6 +671,7 @@
 import {getToken} from "@/utils/auth.js";
 
 const {proxy} = getCurrentInstance();
+const { customer_type: customerTypeOptions } = proxy.useDict("customer_type");
 const userStore = useUserStore();
 
 // 鍥炶鎻愰啋鐩稿叧
@@ -762,11 +763,19 @@
       : baseUrl;
 };
 
+const getCustomerTypeLabel = (value) => {
+  const match = (customerTypeOptions.value || []).find(
+      (item) => String(item.value) === String(value)
+  );
+  return match?.label ?? value ?? "";
+};
+
 const tableColumn = ref([
   {
     label: "瀹㈡埛鍒嗙被",
     prop: "customerType",
     width: 120,
+    formatData: getCustomerTypeLabel,
   },
   {
     label: "瀹㈡埛鍚嶇О",
diff --git a/src/views/salesManagement/salesQuotation/index.vue b/src/views/salesManagement/salesQuotation/index.vue
index 23b68be..2a094a8 100644
--- a/src/views/salesManagement/salesQuotation/index.vue
+++ b/src/views/salesManagement/salesQuotation/index.vue
@@ -77,7 +77,7 @@
         <el-table-column label="鎿嶄綔" width="250" fixed="right" align="center">
           <template #default="scope">
             <el-button link type="primary" @click="handleEdit(scope.row)"
-                       :disabled="!['寰呭鎵�','鎷掔粷'].includes(scope.row.status)">缂栬緫
+                       >缂栬緫
             </el-button>
             <el-button link type="primary" @click="handleView(scope.row)" style="color: #67C23A">鏌ョ湅</el-button>
             <el-button link type="danger" @click="handleDelete(scope.row)">鍒犻櫎</el-button>

--
Gitblit v1.9.3