gaoluyang
5 天以前 c5db127ed8bd5e9960afe8e2df0b5cd361b2dfc1
银川
1.客户管理选择框复用组件应用
已修改7个文件
93 ■■■■■ 文件已修改
src/views/crm/business/data.ts 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/crm/contact/data.ts 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/crm/contract/data.ts 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/crm/receivable/data.ts 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/crm/receivable/plan/data.ts 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/crm/saleQuotation/data.ts 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/erp/sale/order/data.ts 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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,
      },
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: '请选择客户',
      },
    },
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,
      },
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,
      },
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,
      },
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,
      },
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',
      },
    },
    {