From 0af5e35af8338cc8a2e38c19ab79efbb9eff0b2c Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期三, 16 九月 2026 17:02:52 +0800
Subject: [PATCH] feat(crm): 信用评级评定人改为下拉选择并默认当前账号

---
 src/views/crm/credit-rating/data.ts |   31 ++++++++++++++++++++++++++++---
 1 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/src/views/crm/credit-rating/data.ts b/src/views/crm/credit-rating/data.ts
index e8e59c2..d961a1a 100644
--- a/src/views/crm/credit-rating/data.ts
+++ b/src/views/crm/credit-rating/data.ts
@@ -7,13 +7,16 @@
 
 import { DICT_TYPE } from '@vben/constants';
 import { getDictOptions } from '@vben/hooks';
+import { useUserStore } from '@vben/stores';
 
+import { getSimpleUserList } from '#/api/system/user';
 import CrmCustomerSelect from '#/components/crm-customer-select.vue';
 
 /** 鏂板/淇敼淇$敤璇勭骇 */
 export function useFormSchema(
   formApi?: VbenFormApi,
 ): VbenFormSchema[] {
+  const userStore = useUserStore();
   return [
     {
       fieldName: 'id',
@@ -112,12 +115,34 @@
       },
     },
     {
-      fieldName: 'operatorName',
+      fieldName: 'operatorId',
       label: '璇勫畾浜�',
-      component: 'Input',
+      component: 'ApiSelect',
       componentProps: {
-        placeholder: '璇疯緭鍏ヨ瘎瀹氫汉濮撳悕',
+        api: getSimpleUserList,
+        labelField: 'nickname',
+        valueField: 'id',
+        allowClear: true,
+        showSearch: true,
+        optionFilterProp: 'label',
+        placeholder: '璇烽�夋嫨璇勫畾浜�',
+        onChange: (
+          _value?: number,
+          option?: { nickname?: string },
+        ) => {
+          formApi?.setFieldValue('operatorName', option?.nickname);
+        },
       },
+      defaultValue: userStore.userInfo?.id,
+    },
+    {
+      fieldName: 'operatorName',
+      component: 'Input',
+      dependencies: {
+        triggerFields: [''],
+        show: () => false,
+      },
+      defaultValue: userStore.userInfo?.nickname,
     },
     {
       fieldName: 'remark',

--
Gitblit v1.9.3