From c5db127ed8bd5e9960afe8e2df0b5cd361b2dfc1 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 17 七月 2026 15:31:55 +0800
Subject: [PATCH] 银川 1.客户管理选择框复用组件应用
---
src/views/crm/business/data.ts | 9 ++--
src/views/crm/saleQuotation/data.ts | 14 ++----
src/views/crm/receivable/data.ts | 14 ++----
src/views/crm/receivable/plan/data.ts | 14 ++----
src/views/erp/sale/order/data.ts | 16 ++-----
src/views/crm/contact/data.ts | 12 +----
src/views/crm/contract/data.ts | 14 ++----
7 files changed, 32 insertions(+), 61 deletions(-)
diff --git a/src/views/crm/business/data.ts b/src/views/crm/business/data.ts
index 818f1a0..5dd221d 100644
--- a/src/views/crm/business/data.ts
+++ b/src/views/crm/business/data.ts
@@ -6,8 +6,10 @@
import { z } from '#/adapter/form';
import { getBusinessStatusTypeSimpleList } from '#/api/crm/business/status';
-import { getCustomerSimpleList } from '#/api/crm/customer';
import { getSimpleUserList } from '#/api/system/user';
+import CrmCustomerSelect from '#/components/crm-customer-select.vue';
+
+import { markRaw } from 'vue';
/** 鏂板/淇敼鐨勮〃鍗� */
export function useFormSchema(): VbenFormSchema[] {
@@ -52,11 +54,8 @@
{
fieldName: 'customerId',
label: '瀹㈡埛鍚嶇О',
- component: 'ApiSelect',
+ component: markRaw(CrmCustomerSelect),
componentProps: {
- api: getCustomerSimpleList,
- labelField: 'name',
- valueField: 'id',
placeholder: '璇烽�夋嫨瀹㈡埛',
allowClear: true,
},
diff --git a/src/views/crm/contact/data.ts b/src/views/crm/contact/data.ts
index b798a12..a95a655 100644
--- a/src/views/crm/contact/data.ts
+++ b/src/views/crm/contact/data.ts
@@ -8,9 +8,9 @@
import { useUserStore } from '@vben/stores';
import { getSimpleContactList } from '#/api/crm/contact';
-import { getCustomerSimpleList } from '#/api/crm/customer';
import { getSimpleUserList } from '#/api/system/user';
import { AreaCascader } from '#/components/area';
+import CrmCustomerSelect from '#/components/crm-customer-select.vue';
/** 鏂板/淇敼鐨勮〃鍗� */
export function useFormSchema(): VbenFormSchema[] {
@@ -53,12 +53,9 @@
{
fieldName: 'customerId',
label: '瀹㈡埛鍚嶇О',
- component: 'ApiSelect',
+ component: markRaw(CrmCustomerSelect),
rules: 'required',
componentProps: {
- api: getCustomerSimpleList,
- labelField: 'name',
- valueField: 'id',
placeholder: '璇烽�夋嫨瀹㈡埛',
},
},
@@ -189,11 +186,8 @@
{
fieldName: 'customerId',
label: '瀹㈡埛',
- component: 'ApiSelect',
+ component: markRaw(CrmCustomerSelect),
componentProps: {
- api: getCustomerSimpleList,
- labelField: 'name',
- valueField: 'id',
placeholder: '璇烽�夋嫨瀹㈡埛',
},
},
diff --git a/src/views/crm/contract/data.ts b/src/views/crm/contract/data.ts
index cc5afc9..de4629d 100644
--- a/src/views/crm/contract/data.ts
+++ b/src/views/crm/contract/data.ts
@@ -7,8 +7,10 @@
import { z } from '#/adapter/form';
import { getSimpleBusinessList } from '#/api/crm/business';
import { getSimpleContactList } from '#/api/crm/contact';
-import { getCustomerSimpleList } from '#/api/crm/customer';
import { getSimpleUserList } from '#/api/system/user';
+import CrmCustomerSelect from '#/components/crm-customer-select.vue';
+
+import { markRaw } from 'vue';
/** 鏂板/淇敼鐨勮〃鍗� */
export function useFormSchema(): VbenFormSchema[] {
@@ -59,12 +61,9 @@
{
fieldName: 'customerId',
label: '瀹㈡埛鍚嶇О',
- component: 'ApiSelect',
+ component: markRaw(CrmCustomerSelect),
rules: 'required',
componentProps: {
- api: getCustomerSimpleList,
- labelField: 'name',
- valueField: 'id',
placeholder: '璇烽�夋嫨瀹㈡埛',
},
},
@@ -280,11 +279,8 @@
{
fieldName: 'customerId',
label: '瀹㈡埛',
- component: 'ApiSelect',
+ component: markRaw(CrmCustomerSelect),
componentProps: {
- api: getCustomerSimpleList,
- labelField: 'name',
- valueField: 'id',
placeholder: '璇烽�夋嫨瀹㈡埛',
allowClear: true,
},
diff --git a/src/views/crm/receivable/data.ts b/src/views/crm/receivable/data.ts
index b85771d..e1e0255 100644
--- a/src/views/crm/receivable/data.ts
+++ b/src/views/crm/receivable/data.ts
@@ -6,12 +6,14 @@
import { useUserStore } from '@vben/stores';
import { getContractSimpleList } from '#/api/crm/contract';
-import { getCustomerSimpleList } from '#/api/crm/customer';
import {
getReceivablePlan,
getReceivablePlanSimpleList,
} from '#/api/crm/receivable/plan';
import { getSimpleUserList } from '#/api/system/user';
+import CrmCustomerSelect from '#/components/crm-customer-select.vue';
+
+import { markRaw } from 'vue';
/** 鏂板/淇敼鐨勮〃鍗� */
export function useFormSchema(): VbenFormSchema[] {
@@ -55,12 +57,9 @@
{
fieldName: 'customerId',
label: '瀹㈡埛鍚嶇О',
- component: 'ApiSelect',
+ component: markRaw(CrmCustomerSelect),
rules: 'required',
componentProps: (_values, form) => ({
- api: getCustomerSimpleList,
- labelField: 'name',
- valueField: 'id',
placeholder: '璇烽�夋嫨瀹㈡埛',
onChange: () => {
form.setFieldValue('contractId', undefined);
@@ -216,11 +215,8 @@
{
fieldName: 'customerId',
label: '瀹㈡埛',
- component: 'ApiSelect',
+ component: markRaw(CrmCustomerSelect),
componentProps: {
- api: getCustomerSimpleList,
- labelField: 'name',
- valueField: 'id',
placeholder: '璇烽�夋嫨瀹㈡埛',
allowClear: true,
},
diff --git a/src/views/crm/receivable/plan/data.ts b/src/views/crm/receivable/plan/data.ts
index bd5ef22..6527ce2 100644
--- a/src/views/crm/receivable/plan/data.ts
+++ b/src/views/crm/receivable/plan/data.ts
@@ -7,8 +7,10 @@
import { erpPriceInputFormatter } from '@vben/utils';
import { getContractSimpleList } from '#/api/crm/contract';
-import { getCustomerSimpleList } from '#/api/crm/customer';
import { getSimpleUserList } from '#/api/system/user';
+import CrmCustomerSelect from '#/components/crm-customer-select.vue';
+
+import { markRaw } from 'vue';
/** 鏂板/淇敼鐨勮〃鍗� */
export function useFormSchema(): VbenFormSchema[] {
@@ -42,12 +44,9 @@
{
fieldName: 'customerId',
label: '瀹㈡埛',
- component: 'ApiSelect',
+ component: markRaw(CrmCustomerSelect),
rules: 'required',
componentProps: {
- api: getCustomerSimpleList,
- labelField: 'name',
- valueField: 'id',
placeholder: '璇烽�夋嫨瀹㈡埛',
allowClear: true,
},
@@ -153,11 +152,8 @@
{
fieldName: 'customerId',
label: '瀹㈡埛',
- component: 'ApiSelect',
+ component: markRaw(CrmCustomerSelect),
componentProps: {
- api: getCustomerSimpleList,
- labelField: 'name',
- valueField: 'id',
placeholder: '璇烽�夋嫨瀹㈡埛',
allowClear: true,
},
diff --git a/src/views/crm/saleQuotation/data.ts b/src/views/crm/saleQuotation/data.ts
index ca86211..09cf646 100644
--- a/src/views/crm/saleQuotation/data.ts
+++ b/src/views/crm/saleQuotation/data.ts
@@ -6,10 +6,12 @@
import { z } from '#/adapter/form';
import { getSimpleBusinessList } from '#/api/crm/business';
import { getSimpleContactList } from '#/api/crm/contact';
-import { getCustomerSimpleList } from '#/api/crm/customer';
import { getItemPage } from '#/api/mdm/item';
import { getSimpleUserList } from '#/api/system/user';
import { useUserStore } from '#/packages/stores/src';
+import CrmCustomerSelect from '#/components/crm-customer-select.vue';
+
+import { markRaw } from 'vue';
/** 鎶ヤ环鍗曠姸鎬� */
export const QUOTATION_STATUS = {
@@ -62,12 +64,9 @@
{
fieldName: 'customerId',
label: '瀹㈡埛鍚嶇О',
- component: 'ApiSelect',
+ component: markRaw(CrmCustomerSelect),
rules: 'required',
componentProps: {
- api: getCustomerSimpleList,
- labelField: 'name',
- valueField: 'id',
placeholder: '璇烽�夋嫨瀹㈡埛',
},
},
@@ -240,11 +239,8 @@
{
fieldName: 'customerId',
label: '瀹㈡埛',
- component: 'ApiSelect',
+ component: markRaw(CrmCustomerSelect),
componentProps: {
- api: getCustomerSimpleList,
- labelField: 'name',
- valueField: 'id',
placeholder: '璇烽�夋嫨瀹㈡埛',
allowClear: true,
},
diff --git a/src/views/erp/sale/order/data.ts b/src/views/erp/sale/order/data.ts
index d23fc18..0cf418a 100644
--- a/src/views/erp/sale/order/data.ts
+++ b/src/views/erp/sale/order/data.ts
@@ -6,9 +6,11 @@
import { z } from '#/adapter/form';
import { getAccountSimpleList } from '#/api/erp/finance/account';
import { getItemPage } from '#/api/mdm/item';
-import { getCustomerSimpleList as getCrmCustomerSimpleList } from '#/api/crm/customer';
import { getSimpleUserList } from '#/api/system/user';
import { getRangePickerDefaultProps } from '#/utils';
+import CrmCustomerSelect from '#/components/crm-customer-select.vue';
+
+import { markRaw } from 'vue';
/** 琛ㄥ崟绫诲瀷 */
export type FormType = 'create' | 'detail' | 'edit';
@@ -48,14 +50,10 @@
{
label: '瀹㈡埛',
fieldName: 'customerId',
- component: 'ApiSelect',
+ component: markRaw(CrmCustomerSelect),
componentProps: {
placeholder: '璇烽�夋嫨瀹㈡埛',
allowClear: true,
- showSearch: true,
- api: getCrmCustomerSimpleList,
- labelField: 'name',
- valueField: 'id',
},
rules: 'required',
},
@@ -324,14 +322,10 @@
{
fieldName: 'supplierId',
label: '瀹㈡埛',
- component: 'ApiSelect',
+ component: markRaw(CrmCustomerSelect),
componentProps: {
placeholder: '璇烽�夋嫨瀹㈡埛',
allowClear: true,
- showSearch: true,
- api: getCrmCustomerSimpleList,
- labelField: 'name',
- valueField: 'id',
},
},
{
--
Gitblit v1.9.3