diff --git a/apps/web-antd/src/views/crm/business/data.ts b/apps/web-antd/src/views/crm/business/data.ts index 9505414f8..f2e5fa0e5 100644 --- a/apps/web-antd/src/views/crm/business/data.ts +++ b/apps/web-antd/src/views/crm/business/data.ts @@ -1,13 +1,10 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; -import type { DescriptionItemSchema } from '#/components/description'; - -import { formatDateTime } from '@vben/utils'; import { getBusinessStatusTypeSimpleList } from '#/api/crm/business/status'; import { getCustomerSimpleList } from '#/api/crm/customer'; import { getSimpleUserList } from '#/api/system/user'; -import { erpPriceInputFormatter, erpPriceMultiply } from '#/utils'; +import { erpPriceMultiply } from '#/utils'; /** 新增/修改的表单 */ export function useFormSchema(): VbenFormSchema[] { @@ -225,123 +222,3 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { }, ]; } - -/** 详情页的字段 */ -export function useDetailSchema(): DescriptionItemSchema[] { - return [ - { - field: 'customerName', - label: '客户名称', - }, - { - field: 'totalPrice', - label: '商机金额(元)', - content: (data) => erpPriceInputFormatter(data.totalPrice), - }, - { - field: 'statusTypeName', - label: '商机组', - }, - { - field: 'ownerUserName', - label: '负责人', - }, - { - field: 'createTime', - label: '创建时间', - content: (data) => formatDateTime(data?.createTime) as string, - }, - ]; -} - -/** 详情页的基础字段 */ -export function useDetailBaseSchema(): DescriptionItemSchema[] { - return [ - { - field: 'name', - label: '商机名称', - }, - { - field: 'customerName', - label: '客户名称', - }, - { - field: 'totalPrice', - label: '商机金额(元)', - content: (data) => erpPriceInputFormatter(data.totalPrice), - }, - { - field: 'dealTime', - label: '预计成交日期', - content: (data) => formatDateTime(data?.dealTime) as string, - }, - { - field: 'contactNextTime', - label: '下次联系时间', - content: (data) => formatDateTime(data?.contactNextTime) as string, - }, - { - field: 'statusTypeName', - label: '商机状态组', - }, - { - field: 'statusName', - label: '商机阶段', - }, - { - field: 'remark', - label: '备注', - }, - ]; -} - -/** 详情列表的字段 */ -export function useDetailListColumns(): VxeTableGridOptions['columns'] { - return [ - { - type: 'checkbox', - width: 50, - fixed: 'left', - }, - { - field: 'name', - title: '商机名称', - fixed: 'left', - slots: { default: 'name' }, - }, - { - field: 'customerName', - title: '客户名称', - fixed: 'left', - slots: { default: 'customerName' }, - }, - { - field: 'totalPrice', - title: '商机金额(元)', - formatter: 'formatNumber', - }, - { - field: 'dealTime', - title: '预计成交日期', - formatter: 'formatDate', - }, - { - field: 'ownerUserName', - title: '负责人', - }, - { - field: 'ownerUserDeptName', - title: '所属部门', - }, - { - field: 'statusTypeName', - title: '商机状态组', - fixed: 'right', - }, - { - field: 'statusName', - title: '商机阶段', - fixed: 'right', - }, - ]; -} diff --git a/apps/web-antd/src/views/crm/business/modules/detail-data.ts b/apps/web-antd/src/views/crm/business/modules/detail-data.ts new file mode 100644 index 000000000..cab0f65be --- /dev/null +++ b/apps/web-antd/src/views/crm/business/modules/detail-data.ts @@ -0,0 +1,126 @@ +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { DescriptionItemSchema } from '#/components/description'; + +import { formatDateTime } from '@vben/utils'; + +import { erpPriceInputFormatter } from '#/utils'; + +/** 详情页的字段 */ +export function useDetailSchema(): DescriptionItemSchema[] { + return [ + { + field: 'customerName', + label: '客户名称', + }, + { + field: 'totalPrice', + label: '商机金额(元)', + content: (data) => erpPriceInputFormatter(data.totalPrice), + }, + { + field: 'statusTypeName', + label: '商机组', + }, + { + field: 'ownerUserName', + label: '负责人', + }, + { + field: 'createTime', + label: '创建时间', + content: (data) => formatDateTime(data?.createTime) as string, + }, + ]; +} + +/** 详情页的基础字段 */ +export function useDetailBaseSchema(): DescriptionItemSchema[] { + return [ + { + field: 'name', + label: '商机名称', + }, + { + field: 'customerName', + label: '客户名称', + }, + { + field: 'totalPrice', + label: '商机金额(元)', + content: (data) => erpPriceInputFormatter(data.totalPrice), + }, + { + field: 'dealTime', + label: '预计成交日期', + content: (data) => formatDateTime(data?.dealTime) as string, + }, + { + field: 'contactNextTime', + label: '下次联系时间', + content: (data) => formatDateTime(data?.contactNextTime) as string, + }, + { + field: 'statusTypeName', + label: '商机状态组', + }, + { + field: 'statusName', + label: '商机阶段', + }, + { + field: 'remark', + label: '备注', + }, + ]; +} + +/** 详情列表的字段 */ +export function useDetailListColumns(): VxeTableGridOptions['columns'] { + return [ + { + type: 'checkbox', + width: 50, + fixed: 'left', + }, + { + field: 'name', + title: '商机名称', + fixed: 'left', + slots: { default: 'name' }, + }, + { + field: 'customerName', + title: '客户名称', + fixed: 'left', + slots: { default: 'customerName' }, + }, + { + field: 'totalPrice', + title: '商机金额(元)', + formatter: 'formatNumber', + }, + { + field: 'dealTime', + title: '预计成交日期', + formatter: 'formatDate', + }, + { + field: 'ownerUserName', + title: '负责人', + }, + { + field: 'ownerUserDeptName', + title: '所属部门', + }, + { + field: 'statusTypeName', + title: '商机状态组', + fixed: 'right', + }, + { + field: 'statusName', + title: '商机阶段', + fixed: 'right', + }, + ]; +} diff --git a/apps/web-antd/src/views/crm/business/modules/detail-info.vue b/apps/web-antd/src/views/crm/business/modules/detail-info.vue index 2728d32c3..64e4a9fe7 100644 --- a/apps/web-antd/src/views/crm/business/modules/detail-info.vue +++ b/apps/web-antd/src/views/crm/business/modules/detail-info.vue @@ -6,7 +6,7 @@ import { Divider } from 'ant-design-vue'; import { useDescription } from '#/components/description'; import { useFollowUpDetailSchema } from '#/views/crm/followup/data'; -import { useDetailBaseSchema } from '../data'; +import { useDetailBaseSchema } from './detail-data'; defineProps<{ business: CrmBusinessApi.Business; // 商机信息 diff --git a/apps/web-antd/src/views/crm/business/modules/detail-list-modal.vue b/apps/web-antd/src/views/crm/business/modules/detail-list-modal.vue index 61f21b893..902065437 100644 --- a/apps/web-antd/src/views/crm/business/modules/detail-list-modal.vue +++ b/apps/web-antd/src/views/crm/business/modules/detail-list-modal.vue @@ -13,7 +13,7 @@ import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; import { getBusinessPageByCustomer } from '#/api/crm/business'; import { $t } from '#/locales'; -import { useDetailListColumns } from '../data'; +import { useDetailListColumns } from './detail-data'; import Form from './form.vue'; const props = defineProps<{ diff --git a/apps/web-antd/src/views/crm/business/modules/detail-list.vue b/apps/web-antd/src/views/crm/business/modules/detail-list.vue index c4f41745d..81cbaa1ea 100644 --- a/apps/web-antd/src/views/crm/business/modules/detail-list.vue +++ b/apps/web-antd/src/views/crm/business/modules/detail-list.vue @@ -19,7 +19,7 @@ import { createContactBusinessList } from '#/api/crm/contact'; import { BizTypeEnum } from '#/api/crm/permission'; import { $t } from '#/locales'; -import { useDetailListColumns } from '../data'; +import { useDetailListColumns } from './detail-data'; import ListModal from './detail-list-modal.vue'; import Form from './form.vue'; diff --git a/apps/web-antd/src/views/crm/business/modules/detail.vue b/apps/web-antd/src/views/crm/business/modules/detail.vue index aecb77e03..418d80467 100644 --- a/apps/web-antd/src/views/crm/business/modules/detail.vue +++ b/apps/web-antd/src/views/crm/business/modules/detail.vue @@ -15,7 +15,7 @@ import { getOperateLogPage } from '#/api/crm/operateLog'; import { BizTypeEnum } from '#/api/crm/permission'; import { useDescription } from '#/components/description'; -import { useDetailSchema } from '../data'; +import { useDetailSchema } from './detail-data'; const BusinessDetailsInfo = defineAsyncComponent( () => import('./detail-info.vue'), diff --git a/apps/web-antd/src/views/crm/clue/data.ts b/apps/web-antd/src/views/crm/clue/data.ts index bd2924aad..ef35115ba 100644 --- a/apps/web-antd/src/views/crm/clue/data.ts +++ b/apps/web-antd/src/views/crm/clue/data.ts @@ -1,14 +1,8 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; -import type { DescriptionItemSchema } from '#/components/description'; - -import { h } from 'vue'; - -import { formatDateTime } from '@vben/utils'; import { getAreaTree } from '#/api/system/area'; import { getSimpleUserList } from '#/api/system/user'; -import { DictTag } from '#/components/dict-tag'; import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils'; /** 新增/修改的表单 */ @@ -254,102 +248,3 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { }, ]; } - -/** 详情头部的配置 */ -export function useDetailSchema(): DescriptionItemSchema[] { - return [ - { - field: 'source', - label: '线索来源', - content: (data) => - h(DictTag, { - type: DICT_TYPE.CRM_CUSTOMER_SOURCE, - value: data?.source, - }), - }, - { - field: 'mobile', - label: '手机', - }, - { - field: 'ownerUserName', - label: '负责人', - }, - { - field: 'createTime', - label: '创建时间', - content: (data) => formatDateTime(data?.createTime) as string, - }, - ]; -} - -/** 详情基本信息的配置 */ -export function useDetailBaseSchema(): DescriptionItemSchema[] { - return [ - { - field: 'name', - label: '线索名称', - }, - { - field: 'source', - label: '客户来源', - content: (data) => - h(DictTag, { - type: DICT_TYPE.CRM_CUSTOMER_SOURCE, - value: data?.source, - }), - }, - { - field: 'mobile', - label: '手机', - }, - { - field: 'telephone', - label: '电话', - }, - { - field: 'email', - label: '邮箱', - }, - { - field: 'areaName', - label: '地址', - content: (data) => data?.areaName + data?.detailAddress, - }, - { - field: 'qq', - label: 'QQ', - }, - { - field: 'wechat', - label: '微信', - }, - { - field: 'industryId', - label: '客户行业', - content: (data) => - h(DictTag, { - type: DICT_TYPE.CRM_CUSTOMER_INDUSTRY, - value: data?.industryId, - }), - }, - { - field: 'level', - label: '客户级别', - content: (data) => - h(DictTag, { - type: DICT_TYPE.CRM_CUSTOMER_LEVEL, - value: data?.level, - }), - }, - { - field: 'contactNextTime', - label: '下次联系时间', - content: (data) => formatDateTime(data?.contactNextTime) as string, - }, - { - field: 'remark', - label: '备注', - }, - ]; -} diff --git a/apps/web-antd/src/views/crm/clue/modules/detail-data.ts b/apps/web-antd/src/views/crm/clue/modules/detail-data.ts new file mode 100644 index 000000000..73102e9b1 --- /dev/null +++ b/apps/web-antd/src/views/crm/clue/modules/detail-data.ts @@ -0,0 +1,107 @@ +import type { DescriptionItemSchema } from '#/components/description'; + +import { h } from 'vue'; + +import { formatDateTime } from '@vben/utils'; + +import { DictTag } from '#/components/dict-tag'; +import { DICT_TYPE } from '#/utils'; + +/** 详情头部的配置 */ +export function useDetailSchema(): DescriptionItemSchema[] { + return [ + { + field: 'source', + label: '线索来源', + content: (data) => + h(DictTag, { + type: DICT_TYPE.CRM_CUSTOMER_SOURCE, + value: data?.source, + }), + }, + { + field: 'mobile', + label: '手机', + }, + { + field: 'ownerUserName', + label: '负责人', + }, + { + field: 'createTime', + label: '创建时间', + content: (data) => formatDateTime(data?.createTime) as string, + }, + ]; +} + +/** 详情基本信息的配置 */ +export function useDetailBaseSchema(): DescriptionItemSchema[] { + return [ + { + field: 'name', + label: '线索名称', + }, + { + field: 'source', + label: '客户来源', + content: (data) => + h(DictTag, { + type: DICT_TYPE.CRM_CUSTOMER_SOURCE, + value: data?.source, + }), + }, + { + field: 'mobile', + label: '手机', + }, + { + field: 'telephone', + label: '电话', + }, + { + field: 'email', + label: '邮箱', + }, + { + field: 'areaName', + label: '地址', + content: (data) => data?.areaName + data?.detailAddress, + }, + { + field: 'qq', + label: 'QQ', + }, + { + field: 'wechat', + label: '微信', + }, + { + field: 'industryId', + label: '客户行业', + content: (data) => + h(DictTag, { + type: DICT_TYPE.CRM_CUSTOMER_INDUSTRY, + value: data?.industryId, + }), + }, + { + field: 'level', + label: '客户级别', + content: (data) => + h(DictTag, { + type: DICT_TYPE.CRM_CUSTOMER_LEVEL, + value: data?.level, + }), + }, + { + field: 'contactNextTime', + label: '下次联系时间', + content: (data) => formatDateTime(data?.contactNextTime) as string, + }, + { + field: 'remark', + label: '备注', + }, + ]; +} diff --git a/apps/web-antd/src/views/crm/clue/modules/detail-info.vue b/apps/web-antd/src/views/crm/clue/modules/detail-info.vue index 2e9c68c00..fc9dbe3b4 100644 --- a/apps/web-antd/src/views/crm/clue/modules/detail-info.vue +++ b/apps/web-antd/src/views/crm/clue/modules/detail-info.vue @@ -6,7 +6,7 @@ import { Divider } from 'ant-design-vue'; import { useDescription } from '#/components/description'; import { useFollowUpDetailSchema } from '#/views/crm/followup/data'; -import { useDetailBaseSchema } from '../data'; +import { useDetailBaseSchema } from './detail-data'; defineProps<{ clue: CrmClueApi.Clue; // 线索信息 diff --git a/apps/web-antd/src/views/crm/clue/modules/detail.vue b/apps/web-antd/src/views/crm/clue/modules/detail.vue index 012c97254..486da4c74 100644 --- a/apps/web-antd/src/views/crm/clue/modules/detail.vue +++ b/apps/web-antd/src/views/crm/clue/modules/detail.vue @@ -16,7 +16,7 @@ import { getOperateLogPage } from '#/api/crm/operateLog'; import { BizTypeEnum } from '#/api/crm/permission'; import { useDescription } from '#/components/description'; -import { useDetailSchema } from '../data'; +import { useDetailSchema } from './detail-data'; import ClueForm from './form.vue'; const FollowUp = defineAsyncComponent( diff --git a/apps/web-antd/src/views/crm/contact/data.ts b/apps/web-antd/src/views/crm/contact/data.ts index d6d9eaec8..31dee6a36 100644 --- a/apps/web-antd/src/views/crm/contact/data.ts +++ b/apps/web-antd/src/views/crm/contact/data.ts @@ -1,16 +1,10 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; -import type { DescriptionItemSchema } from '#/components/description'; - -import { h } from 'vue'; - -import { formatDateTime } from '@vben/utils'; import { getSimpleContactList } from '#/api/crm/contact'; import { getCustomerSimpleList } from '#/api/crm/customer'; import { getAreaTree } from '#/api/system/area'; import { getSimpleUserList } from '#/api/system/user'; -import { DictTag } from '#/components/dict-tag'; import { DICT_TYPE, getDictOptions } from '#/utils'; /** 新增/修改的表单 */ @@ -278,159 +272,3 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { }, ]; } - -/** 详情页的基础字段 */ -export function useDetailSchema(): DescriptionItemSchema[] { - return [ - { - field: 'name', - label: '客户名称', - }, - { - field: 'post', - label: '职务', - }, - { - field: 'mobile', - label: '手机', - }, - { - field: 'createTime', - label: '下次联系时间', - content: (data) => formatDateTime(data?.createTime) as string, - }, - ]; -} - -/** 详情页的基础字段 */ -export function useDetailBaseSchema(): DescriptionItemSchema[] { - return [ - { - field: 'name', - label: '姓名', - }, - { - field: 'customerName', - label: '客户名称', - }, - { - field: 'mobile', - label: '手机', - }, - { - field: 'telephone', - label: '电话', - }, - { - field: 'email', - label: '邮箱', - }, - { - field: 'qq', - label: 'QQ', - }, - { - field: 'wechat', - label: '微信', - }, - { - field: 'areaName', - label: '地址', - }, - { - field: 'detailAddress', - label: '详细地址', - }, - { - field: 'post', - label: '职务', - }, - { - field: 'parentName', - label: '直属上级', - }, - { - field: 'master', - label: '关键决策人', - content: (data) => - h(DictTag, { - type: DICT_TYPE.INFRA_BOOLEAN_STRING, - value: data?.master, - }), - }, - { - field: 'sex', - label: '性别', - content: (data) => - h(DictTag, { type: DICT_TYPE.SYSTEM_USER_SEX, value: data?.sex }), - }, - { - field: 'contactNextTime', - label: '下次联系时间', - content: (data) => formatDateTime(data?.contactNextTime) as string, - }, - { - field: 'remark', - label: '备注', - }, - ]; -} - -/** 详情列表的字段 */ -export function useDetailListColumns(): VxeTableGridOptions['columns'] { - return [ - { - type: 'checkbox', - width: 50, - fixed: 'left', - }, - { - field: 'name', - title: '姓名', - fixed: 'left', - slots: { default: 'name' }, - }, - { - field: 'customerName', - title: '客户名称', - fixed: 'left', - slots: { default: 'customerName' }, - }, - { - field: 'sex', - title: '性别', - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.SYSTEM_USER_SEX }, - }, - }, - { - field: 'mobile', - title: '手机', - }, - { - field: 'telephone', - title: '电话', - }, - { - field: 'email', - title: '邮箱', - }, - { - field: 'post', - title: '职位', - }, - { - field: 'detailAddress', - title: '地址', - }, - { - field: 'master', - title: '关键决策人', - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.INFRA_BOOLEAN_STRING }, - }, - }, - ]; -} diff --git a/apps/web-antd/src/views/crm/contact/modules/detail-data.ts b/apps/web-antd/src/views/crm/contact/modules/detail-data.ts new file mode 100644 index 000000000..e4de3e2ff --- /dev/null +++ b/apps/web-antd/src/views/crm/contact/modules/detail-data.ts @@ -0,0 +1,165 @@ +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { DescriptionItemSchema } from '#/components/description'; + +import { h } from 'vue'; + +import { formatDateTime } from '@vben/utils'; + +import { DictTag } from '#/components/dict-tag'; +import { DICT_TYPE } from '#/utils'; + +/** 详情页的基础字段 */ +export function useDetailSchema(): DescriptionItemSchema[] { + return [ + { + field: 'name', + label: '客户名称', + }, + { + field: 'post', + label: '职务', + }, + { + field: 'mobile', + label: '手机', + }, + { + field: 'createTime', + label: '下次联系时间', + content: (data) => formatDateTime(data?.createTime) as string, + }, + ]; +} + +/** 详情页的基础字段 */ +export function useDetailBaseSchema(): DescriptionItemSchema[] { + return [ + { + field: 'name', + label: '姓名', + }, + { + field: 'customerName', + label: '客户名称', + }, + { + field: 'mobile', + label: '手机', + }, + { + field: 'telephone', + label: '电话', + }, + { + field: 'email', + label: '邮箱', + }, + { + field: 'qq', + label: 'QQ', + }, + { + field: 'wechat', + label: '微信', + }, + { + field: 'areaName', + label: '地址', + }, + { + field: 'detailAddress', + label: '详细地址', + }, + { + field: 'post', + label: '职务', + }, + { + field: 'parentName', + label: '直属上级', + }, + { + field: 'master', + label: '关键决策人', + content: (data) => + h(DictTag, { + type: DICT_TYPE.INFRA_BOOLEAN_STRING, + value: data?.master, + }), + }, + { + field: 'sex', + label: '性别', + content: (data) => + h(DictTag, { type: DICT_TYPE.SYSTEM_USER_SEX, value: data?.sex }), + }, + { + field: 'contactNextTime', + label: '下次联系时间', + content: (data) => formatDateTime(data?.contactNextTime) as string, + }, + { + field: 'remark', + label: '备注', + }, + ]; +} + +/** 详情列表的字段 */ +export function useDetailListColumns(): VxeTableGridOptions['columns'] { + return [ + { + type: 'checkbox', + width: 50, + fixed: 'left', + }, + { + field: 'name', + title: '姓名', + fixed: 'left', + slots: { default: 'name' }, + }, + { + field: 'customerName', + title: '客户名称', + fixed: 'left', + slots: { default: 'customerName' }, + }, + { + field: 'sex', + title: '性别', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.SYSTEM_USER_SEX }, + }, + }, + { + field: 'mobile', + title: '手机', + }, + { + field: 'telephone', + title: '电话', + }, + { + field: 'email', + title: '邮箱', + }, + { + field: 'post', + title: '职位', + }, + { + field: 'detailAddress', + title: '地址', + }, + { + field: 'master', + title: '关键决策人', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.INFRA_BOOLEAN_STRING }, + }, + }, + ]; +} diff --git a/apps/web-antd/src/views/crm/contact/modules/detail-info.vue b/apps/web-antd/src/views/crm/contact/modules/detail-info.vue index 9ca08aaa7..9e71bd593 100644 --- a/apps/web-antd/src/views/crm/contact/modules/detail-info.vue +++ b/apps/web-antd/src/views/crm/contact/modules/detail-info.vue @@ -6,7 +6,7 @@ import { Divider } from 'ant-design-vue'; import { useDescription } from '#/components/description'; import { useFollowUpDetailSchema } from '#/views/crm/followup/data'; -import { useDetailBaseSchema } from '../data'; +import { useDetailBaseSchema } from './detail-data'; defineProps<{ contact: CrmContactApi.Contact; // 联系人信息 diff --git a/apps/web-antd/src/views/crm/contact/modules/detail-list-modal.vue b/apps/web-antd/src/views/crm/contact/modules/detail-list-modal.vue index f816d64a4..8fc58057f 100644 --- a/apps/web-antd/src/views/crm/contact/modules/detail-list-modal.vue +++ b/apps/web-antd/src/views/crm/contact/modules/detail-list-modal.vue @@ -13,7 +13,7 @@ import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; import { getContactPageByCustomer } from '#/api/crm/contact'; import { $t } from '#/locales'; -import { useDetailListColumns } from '../data'; +import { useDetailListColumns } from './detail-data'; import Form from './form.vue'; const props = defineProps<{ diff --git a/apps/web-antd/src/views/crm/contact/modules/detail-list.vue b/apps/web-antd/src/views/crm/contact/modules/detail-list.vue index a68a7129d..2ad66d514 100644 --- a/apps/web-antd/src/views/crm/contact/modules/detail-list.vue +++ b/apps/web-antd/src/views/crm/contact/modules/detail-list.vue @@ -19,7 +19,7 @@ import { import { BizTypeEnum } from '#/api/crm/permission'; import { $t } from '#/locales'; -import { useDetailListColumns } from '../data'; +import { useDetailListColumns } from './detail-data'; import ListModal from './detail-list-modal.vue'; import Form from './form.vue'; diff --git a/apps/web-antd/src/views/crm/contact/modules/detail.vue b/apps/web-antd/src/views/crm/contact/modules/detail.vue index b7c6e0498..4f20a5607 100644 --- a/apps/web-antd/src/views/crm/contact/modules/detail.vue +++ b/apps/web-antd/src/views/crm/contact/modules/detail.vue @@ -15,7 +15,7 @@ import { getOperateLogPage } from '#/api/crm/operateLog'; import { BizTypeEnum } from '#/api/crm/permission'; import { useDescription } from '#/components/description'; -import { useDetailSchema } from '../data'; +import { useDetailSchema } from './detail-data'; const ContactDetailsInfo = defineAsyncComponent( () => import('./detail-info.vue'), diff --git a/apps/web-antd/src/views/crm/contract/data.ts b/apps/web-antd/src/views/crm/contract/data.ts index 626ae073e..79118dd3f 100644 --- a/apps/web-antd/src/views/crm/contract/data.ts +++ b/apps/web-antd/src/views/crm/contract/data.ts @@ -1,16 +1,10 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; -import type { DescriptionItemSchema } from '#/components/description'; - -import { h } from 'vue'; - -import { formatDateTime } from '@vben/utils'; import { getSimpleBusinessList } from '#/api/crm/business'; import { getSimpleContactList } from '#/api/crm/contact'; import { getCustomerSimpleList } from '#/api/crm/customer'; -import { DictTag } from '#/components/dict-tag'; -import { erpPriceInputFormatter, floatToFixed2 } from '#/utils'; +import { floatToFixed2 } from '#/utils'; import { DICT_TYPE } from '#/utils/dict'; /** 新增/修改的表单 */ @@ -280,182 +274,3 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { }, ]; } - -/** 详情头部的配置 */ -export function useDetailSchema(): DescriptionItemSchema[] { - return [ - { - field: 'customerName', - label: '客户名称', - }, - { - field: 'totalPrice', - label: '合同金额(元)', - content: (data) => erpPriceInputFormatter(data?.totalPrice) as string, - }, - { - field: 'orderDate', - label: '下单时间', - content: (data) => formatDateTime(data?.orderDate) as string, - }, - { - field: 'totalReceivablePrice', - label: '回款金额(元)', - content: (data) => - erpPriceInputFormatter(data?.totalReceivablePrice) as string, - }, - { - field: 'ownerUserName', - label: '负责人', - }, - ]; -} - -/** 详情基本信息的配置 */ -export function useDetailBaseSchema(): DescriptionItemSchema[] { - return [ - { - field: 'no', - label: '合同编号', - }, - { - field: 'name', - label: '合同名称', - }, - { - field: 'customerName', - label: '客户名称', - }, - { - field: 'businessName', - label: '商机名称', - }, - { - field: 'totalPrice', - label: '合同金额(元)', - content: (data) => erpPriceInputFormatter(data?.totalPrice) as string, - }, - { - field: 'orderDate', - label: '下单时间', - content: (data) => formatDateTime(data?.orderDate) as string, - }, - { - field: 'startTime', - label: '合同开始时间', - content: (data) => formatDateTime(data?.startTime) as string, - }, - { - field: 'endTime', - label: '合同结束时间', - content: (data) => formatDateTime(data?.endTime) as string, - }, - { - field: 'signContactName', - label: '客户签约人', - }, - { - field: 'signUserName', - label: '公司签约人', - }, - { - field: 'remark', - label: '备注', - }, - { - field: 'auditStatus', - label: '合同状态', - content: (data) => - h(DictTag, { - type: DICT_TYPE.CRM_AUDIT_STATUS, - value: data?.auditStatus, - }), - }, - ]; -} - -export function useDetailListColumns(): VxeTableGridOptions['columns'] { - return [ - { - title: '合同编号', - field: 'no', - minWidth: 150, - fixed: 'left', - }, - { - title: '合同名称', - field: 'name', - minWidth: 150, - fixed: 'left', - slots: { default: 'name' }, - }, - { - title: '合同金额(元)', - field: 'totalPrice', - minWidth: 150, - formatter: 'formatNumber', - }, - { - title: '合同开始时间', - field: 'startTime', - minWidth: 150, - formatter: 'formatDateTime', - }, - { - title: '合同结束时间', - field: 'endTime', - minWidth: 150, - formatter: 'formatDateTime', - }, - { - title: '已回款金额(元)', - field: 'totalReceivablePrice', - minWidth: 150, - formatter: 'formatNumber', - }, - { - title: '未回款金额(元)', - field: 'unpaidPrice', - minWidth: 150, - formatter: ({ row }) => { - return floatToFixed2(row.totalPrice - row.totalReceivablePrice); - }, - }, - { - title: '负责人', - field: 'ownerUserName', - minWidth: 150, - }, - { - title: '所属部门', - field: 'ownerUserDeptName', - minWidth: 150, - }, - { - title: '创建时间', - field: 'createTime', - minWidth: 150, - formatter: 'formatDateTime', - }, - { - title: '创建人', - field: 'creatorName', - minWidth: 150, - }, - { - title: '备注', - field: 'remark', - minWidth: 150, - }, - { - title: '合同状态', - field: 'auditStatus', - fixed: 'right', - minWidth: 100, - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.CRM_AUDIT_STATUS }, - }, - }, - ]; -} diff --git a/apps/web-antd/src/views/crm/contract/modules/detail-data.ts b/apps/web-antd/src/views/crm/contract/modules/detail-data.ts new file mode 100644 index 000000000..cffb31427 --- /dev/null +++ b/apps/web-antd/src/views/crm/contract/modules/detail-data.ts @@ -0,0 +1,188 @@ +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { DescriptionItemSchema } from '#/components/description'; + +import { h } from 'vue'; + +import { formatDateTime } from '@vben/utils'; + +import { DictTag } from '#/components/dict-tag'; +import { DICT_TYPE, erpPriceInputFormatter, floatToFixed2 } from '#/utils'; + +/** 详情头部的配置 */ +export function useDetailSchema(): DescriptionItemSchema[] { + return [ + { + field: 'customerName', + label: '客户名称', + }, + { + field: 'totalPrice', + label: '合同金额(元)', + content: (data) => erpPriceInputFormatter(data?.totalPrice) as string, + }, + { + field: 'orderDate', + label: '下单时间', + content: (data) => formatDateTime(data?.orderDate) as string, + }, + { + field: 'totalReceivablePrice', + label: '回款金额(元)', + content: (data) => + erpPriceInputFormatter(data?.totalReceivablePrice) as string, + }, + { + field: 'ownerUserName', + label: '负责人', + }, + ]; +} + +/** 详情基本信息的配置 */ +export function useDetailBaseSchema(): DescriptionItemSchema[] { + return [ + { + field: 'no', + label: '合同编号', + }, + { + field: 'name', + label: '合同名称', + }, + { + field: 'customerName', + label: '客户名称', + }, + { + field: 'businessName', + label: '商机名称', + }, + { + field: 'totalPrice', + label: '合同金额(元)', + content: (data) => erpPriceInputFormatter(data?.totalPrice) as string, + }, + { + field: 'orderDate', + label: '下单时间', + content: (data) => formatDateTime(data?.orderDate) as string, + }, + { + field: 'startTime', + label: '合同开始时间', + content: (data) => formatDateTime(data?.startTime) as string, + }, + { + field: 'endTime', + label: '合同结束时间', + content: (data) => formatDateTime(data?.endTime) as string, + }, + { + field: 'signContactName', + label: '客户签约人', + }, + { + field: 'signUserName', + label: '公司签约人', + }, + { + field: 'remark', + label: '备注', + }, + { + field: 'auditStatus', + label: '合同状态', + content: (data) => + h(DictTag, { + type: DICT_TYPE.CRM_AUDIT_STATUS, + value: data?.auditStatus, + }), + }, + ]; +} + +export function useDetailListColumns(): VxeTableGridOptions['columns'] { + return [ + { + title: '合同编号', + field: 'no', + minWidth: 150, + fixed: 'left', + }, + { + title: '合同名称', + field: 'name', + minWidth: 150, + fixed: 'left', + slots: { default: 'name' }, + }, + { + title: '合同金额(元)', + field: 'totalPrice', + minWidth: 150, + formatter: 'formatNumber', + }, + { + title: '合同开始时间', + field: 'startTime', + minWidth: 150, + formatter: 'formatDateTime', + }, + { + title: '合同结束时间', + field: 'endTime', + minWidth: 150, + formatter: 'formatDateTime', + }, + { + title: '已回款金额(元)', + field: 'totalReceivablePrice', + minWidth: 150, + formatter: 'formatNumber', + }, + { + title: '未回款金额(元)', + field: 'unpaidPrice', + minWidth: 150, + formatter: ({ row }) => { + return floatToFixed2(row.totalPrice - row.totalReceivablePrice); + }, + }, + { + title: '负责人', + field: 'ownerUserName', + minWidth: 150, + }, + { + title: '所属部门', + field: 'ownerUserDeptName', + minWidth: 150, + }, + { + title: '创建时间', + field: 'createTime', + minWidth: 150, + formatter: 'formatDateTime', + }, + { + title: '创建人', + field: 'creatorName', + minWidth: 150, + }, + { + title: '备注', + field: 'remark', + minWidth: 150, + }, + { + title: '合同状态', + field: 'auditStatus', + fixed: 'right', + minWidth: 100, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.CRM_AUDIT_STATUS }, + }, + }, + ]; +} diff --git a/apps/web-antd/src/views/crm/contract/modules/detail-info.vue b/apps/web-antd/src/views/crm/contract/modules/detail-info.vue index f3b879888..7968e6dad 100644 --- a/apps/web-antd/src/views/crm/contract/modules/detail-info.vue +++ b/apps/web-antd/src/views/crm/contract/modules/detail-info.vue @@ -6,7 +6,7 @@ import { Divider } from 'ant-design-vue'; import { useDescription } from '#/components/description'; import { useFollowUpDetailSchema } from '#/views/crm/followup/data'; -import { useDetailBaseSchema } from '../data'; +import { useDetailBaseSchema } from './detail-data'; defineProps<{ contract: CrmContractApi.Contract; // 合同信息 diff --git a/apps/web-antd/src/views/crm/contract/modules/detail-list.vue b/apps/web-antd/src/views/crm/contract/modules/detail-list.vue index ee8637eb5..d6ceee285 100644 --- a/apps/web-antd/src/views/crm/contract/modules/detail-list.vue +++ b/apps/web-antd/src/views/crm/contract/modules/detail-list.vue @@ -18,7 +18,7 @@ import { import { BizTypeEnum } from '#/api/crm/permission'; import { $t } from '#/locales'; -import { useDetailListColumns } from '../data'; +import { useDetailListColumns } from './detail-data'; import Form from './form.vue'; const props = defineProps<{ diff --git a/apps/web-antd/src/views/crm/contract/modules/detail.vue b/apps/web-antd/src/views/crm/contract/modules/detail.vue index 384400703..301cb4d0c 100644 --- a/apps/web-antd/src/views/crm/contract/modules/detail.vue +++ b/apps/web-antd/src/views/crm/contract/modules/detail.vue @@ -16,7 +16,7 @@ import { getOperateLogPage } from '#/api/crm/operateLog'; import { BizTypeEnum } from '#/api/crm/permission'; import { useDescription } from '#/components/description'; -import { useDetailSchema } from '../data'; +import { useDetailSchema } from './detail-data'; import ClueForm from './form.vue'; const FollowUp = defineAsyncComponent( diff --git a/apps/web-antd/src/views/crm/customer/data.ts b/apps/web-antd/src/views/crm/customer/data.ts index 840d56636..61731e20b 100644 --- a/apps/web-antd/src/views/crm/customer/data.ts +++ b/apps/web-antd/src/views/crm/customer/data.ts @@ -1,14 +1,8 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; -import type { DescriptionItemSchema } from '#/components/description'; - -import { h } from 'vue'; - -import { formatDateTime } from '@vben/utils'; import { getAreaTree } from '#/api/system/area'; import { getSimpleUserList } from '#/api/system/user'; -import { DictTag } from '#/components/dict-tag'; import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils'; /** 新增/修改的表单 */ @@ -240,96 +234,3 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { }, ]; } - -/** 详情页的字段 */ -export function useDetailSchema(): DescriptionItemSchema[] { - return [ - { - field: 'level', - label: '客户级别', - content: (data) => - h(DictTag, { type: DICT_TYPE.CRM_CUSTOMER_LEVEL, value: data?.level }), - }, - { - field: 'dealStatus', - label: '成交状态', - content: (data) => (data.dealStatus ? '已成交' : '未成交'), - }, - { - field: 'createTime', - label: '创建时间', - content: (data) => formatDateTime(data?.createTime) as string, - }, - ]; -} - -/** 详情页的基础字段 */ -export function useDetailBaseSchema(): DescriptionItemSchema[] { - return [ - { - field: 'name', - label: '客户名称', - }, - { - field: 'source', - label: '客户来源', - content: (data) => - h(DictTag, { - type: DICT_TYPE.CRM_CUSTOMER_SOURCE, - value: data?.source, - }), - }, - { - field: 'mobile', - label: '手机', - }, - { - field: 'telephone', - label: '电话', - }, - { - field: 'email', - label: '邮箱', - }, - { - field: 'areaName', - label: '地址', - }, - { - field: 'detailAddress', - label: '详细地址', - }, - { - field: 'qq', - label: 'QQ', - }, - { - field: 'wechat', - label: '微信', - }, - { - field: 'industryId', - label: '客户行业', - content: (data) => - h(DictTag, { - type: DICT_TYPE.CRM_CUSTOMER_INDUSTRY, - value: data?.industryId, - }), - }, - { - field: 'level', - label: '客户级别', - content: (data) => - h(DictTag, { type: DICT_TYPE.CRM_CUSTOMER_LEVEL, value: data?.level }), - }, - { - field: 'contactNextTime', - label: '下次联系时间', - content: (data) => formatDateTime(data?.contactNextTime) as string, - }, - { - field: 'remark', - label: '备注', - }, - ]; -} diff --git a/apps/web-antd/src/views/crm/customer/modules/detail-data.ts b/apps/web-antd/src/views/crm/customer/modules/detail-data.ts new file mode 100644 index 000000000..75a71b01d --- /dev/null +++ b/apps/web-antd/src/views/crm/customer/modules/detail-data.ts @@ -0,0 +1,101 @@ +import type { DescriptionItemSchema } from '#/components/description'; + +import { h } from 'vue'; + +import { formatDateTime } from '@vben/utils'; + +import { DictTag } from '#/components/dict-tag'; +import { DICT_TYPE } from '#/utils'; + +/** 详情页的字段 */ +export function useDetailSchema(): DescriptionItemSchema[] { + return [ + { + field: 'level', + label: '客户级别', + content: (data) => + h(DictTag, { type: DICT_TYPE.CRM_CUSTOMER_LEVEL, value: data?.level }), + }, + { + field: 'dealStatus', + label: '成交状态', + content: (data) => (data.dealStatus ? '已成交' : '未成交'), + }, + { + field: 'createTime', + label: '创建时间', + content: (data) => formatDateTime(data?.createTime) as string, + }, + ]; +} + +/** 详情页的基础字段 */ +export function useDetailBaseSchema(): DescriptionItemSchema[] { + return [ + { + field: 'name', + label: '客户名称', + }, + { + field: 'source', + label: '客户来源', + content: (data) => + h(DictTag, { + type: DICT_TYPE.CRM_CUSTOMER_SOURCE, + value: data?.source, + }), + }, + { + field: 'mobile', + label: '手机', + }, + { + field: 'telephone', + label: '电话', + }, + { + field: 'email', + label: '邮箱', + }, + { + field: 'areaName', + label: '地址', + }, + { + field: 'detailAddress', + label: '详细地址', + }, + { + field: 'qq', + label: 'QQ', + }, + { + field: 'wechat', + label: '微信', + }, + { + field: 'industryId', + label: '客户行业', + content: (data) => + h(DictTag, { + type: DICT_TYPE.CRM_CUSTOMER_INDUSTRY, + value: data?.industryId, + }), + }, + { + field: 'level', + label: '客户级别', + content: (data) => + h(DictTag, { type: DICT_TYPE.CRM_CUSTOMER_LEVEL, value: data?.level }), + }, + { + field: 'contactNextTime', + label: '下次联系时间', + content: (data) => formatDateTime(data?.contactNextTime) as string, + }, + { + field: 'remark', + label: '备注', + }, + ]; +} diff --git a/apps/web-antd/src/views/crm/product/data.ts b/apps/web-antd/src/views/crm/product/data.ts index ff5b0903d..348afb372 100644 --- a/apps/web-antd/src/views/crm/product/data.ts +++ b/apps/web-antd/src/views/crm/product/data.ts @@ -1,20 +1,11 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; -import type { DescriptionItemSchema } from '#/components/description'; - -import { h } from 'vue'; import { handleTree } from '@vben/utils'; import { z } from '#/adapter/form'; import { getProductCategoryList } from '#/api/crm/product/category'; -import { DictTag } from '#/components/dict-tag'; -import { - CommonStatusEnum, - DICT_TYPE, - erpPriceInputFormatter, - getDictOptions, -} from '#/utils'; +import { CommonStatusEnum, DICT_TYPE, getDictOptions } from '#/utils'; /** 新增/修改的表单 */ export function useFormSchema(): VbenFormSchema[] { @@ -183,112 +174,3 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { }, ]; } - -/** 详情页的字段 */ -export function useDetailSchema(): DescriptionItemSchema[] { - return [ - { - field: 'categoryName', - label: '产品类别', - }, - { - field: 'unit', - label: '产品单位', - content: (data) => - h(DictTag, { type: DICT_TYPE.CRM_PRODUCT_UNIT, value: data?.unit }), - }, - { - field: 'price', - label: '产品价格', - content: (data) => erpPriceInputFormatter(data.price), - }, - { - field: 'no', - label: '产品编码', - }, - ]; -} - -/** 详情页的基础字段 */ -export function useDetailBaseSchema(): DescriptionItemSchema[] { - return [ - { - field: 'name', - label: '产品名称', - }, - { - field: 'no', - label: '产品编码', - }, - { - field: 'price', - label: '价格(元)', - content: (data) => erpPriceInputFormatter(data.price), - }, - { - field: 'description', - label: '产品描述', - }, - { - field: 'categoryName', - label: '产品类型', - }, - { - field: 'status', - label: '是否上下架', - content: (data) => - h(DictTag, { type: DICT_TYPE.CRM_PRODUCT_STATUS, value: data?.status }), - }, - { - field: 'unit', - label: '产品单位', - content: (data) => - h(DictTag, { type: DICT_TYPE.CRM_PRODUCT_UNIT, value: data?.unit }), - }, - ]; -} - -/** 详情列表的字段 */ -export function useDetailListColumns( - showBussinePrice: boolean, -): VxeTableGridOptions['columns'] { - return [ - { - field: 'productName', - title: '产品名称', - }, - { - field: 'productNo', - title: '产品条码', - }, - { - field: 'productUnit', - title: '产品单位', - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.CRM_PRODUCT_UNIT }, - }, - }, - { - field: 'productPrice', - title: '产品价格(元)', - formatter: 'formatNumber', - }, - { - field: 'businessPrice', - title: '商机价格(元)', - formatter: 'formatNumber', - visible: showBussinePrice, - }, - { - field: 'count', - title: '数量', - formatter: 'formatNumber', - }, - { - field: 'totalPrice', - title: '合计金额(元)', - formatter: 'formatNumber', - }, - ]; -} diff --git a/apps/web-antd/src/views/crm/product/modules/detail-data.ts b/apps/web-antd/src/views/crm/product/modules/detail-data.ts new file mode 100644 index 000000000..a8c0a10e1 --- /dev/null +++ b/apps/web-antd/src/views/crm/product/modules/detail-data.ts @@ -0,0 +1,116 @@ +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { DescriptionItemSchema } from '#/components/description'; + +import { h } from 'vue'; + +import { DictTag } from '#/components/dict-tag'; +import { DICT_TYPE, erpPriceInputFormatter } from '#/utils'; + +/** 详情页的字段 */ +export function useDetailSchema(): DescriptionItemSchema[] { + return [ + { + field: 'categoryName', + label: '产品类别', + }, + { + field: 'unit', + label: '产品单位', + content: (data) => + h(DictTag, { type: DICT_TYPE.CRM_PRODUCT_UNIT, value: data?.unit }), + }, + { + field: 'price', + label: '产品价格', + content: (data) => erpPriceInputFormatter(data.price), + }, + { + field: 'no', + label: '产品编码', + }, + ]; +} + +/** 详情页的基础字段 */ +export function useDetailBaseSchema(): DescriptionItemSchema[] { + return [ + { + field: 'name', + label: '产品名称', + }, + { + field: 'no', + label: '产品编码', + }, + { + field: 'price', + label: '价格(元)', + content: (data) => erpPriceInputFormatter(data.price), + }, + { + field: 'description', + label: '产品描述', + }, + { + field: 'categoryName', + label: '产品类型', + }, + { + field: 'status', + label: '是否上下架', + content: (data) => + h(DictTag, { type: DICT_TYPE.CRM_PRODUCT_STATUS, value: data?.status }), + }, + { + field: 'unit', + label: '产品单位', + content: (data) => + h(DictTag, { type: DICT_TYPE.CRM_PRODUCT_UNIT, value: data?.unit }), + }, + ]; +} + +/** 详情列表的字段 */ +export function useDetailListColumns( + showBussinePrice: boolean, +): VxeTableGridOptions['columns'] { + return [ + { + field: 'productName', + title: '产品名称', + }, + { + field: 'productNo', + title: '产品条码', + }, + { + field: 'productUnit', + title: '产品单位', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.CRM_PRODUCT_UNIT }, + }, + }, + { + field: 'productPrice', + title: '产品价格(元)', + formatter: 'formatNumber', + }, + { + field: 'businessPrice', + title: '商机价格(元)', + formatter: 'formatNumber', + visible: showBussinePrice, + }, + { + field: 'count', + title: '数量', + formatter: 'formatNumber', + }, + { + field: 'totalPrice', + title: '合计金额(元)', + formatter: 'formatNumber', + }, + ]; +} diff --git a/apps/web-antd/src/views/crm/product/modules/detail-info.vue b/apps/web-antd/src/views/crm/product/modules/detail-info.vue index 2d902c41f..a7868f05d 100644 --- a/apps/web-antd/src/views/crm/product/modules/detail-info.vue +++ b/apps/web-antd/src/views/crm/product/modules/detail-info.vue @@ -3,7 +3,7 @@ import type { CrmProductApi } from '#/api/crm/product'; import { useDescription } from '#/components/description'; -import { useDetailBaseSchema } from '../data'; +import { useDetailBaseSchema } from './detail-data'; defineProps<{ product: CrmProductApi.Product; // 产品信息 diff --git a/apps/web-antd/src/views/crm/product/modules/detail-list.vue b/apps/web-antd/src/views/crm/product/modules/detail-list.vue index a2fac8d21..9dfb52ed6 100644 --- a/apps/web-antd/src/views/crm/product/modules/detail-list.vue +++ b/apps/web-antd/src/views/crm/product/modules/detail-list.vue @@ -10,7 +10,7 @@ import { getContract } from '#/api/crm/contract'; import { BizTypeEnum } from '#/api/crm/permission'; import { erpPriceInputFormatter } from '#/utils'; -import { useDetailListColumns } from '../data'; +import { useDetailListColumns } from './detail-data'; const props = defineProps<{ bizId: number; diff --git a/apps/web-antd/src/views/crm/product/modules/detail.vue b/apps/web-antd/src/views/crm/product/modules/detail.vue index ffe2f79e9..71f756098 100644 --- a/apps/web-antd/src/views/crm/product/modules/detail.vue +++ b/apps/web-antd/src/views/crm/product/modules/detail.vue @@ -15,7 +15,7 @@ import { BizTypeEnum } from '#/api/crm/permission'; import { getProduct } from '#/api/crm/product'; import { useDescription } from '#/components/description'; -import { useDetailSchema } from '../data'; +import { useDetailSchema } from './detail-data'; const ProductDetailsInfo = defineAsyncComponent( () => import('./detail-info.vue'), diff --git a/apps/web-antd/src/views/crm/receivable/data.ts b/apps/web-antd/src/views/crm/receivable/data.ts index d6132faf1..1c33d1aec 100644 --- a/apps/web-antd/src/views/crm/receivable/data.ts +++ b/apps/web-antd/src/views/crm/receivable/data.ts @@ -1,17 +1,10 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; -import type { DescriptionItemSchema } from '#/components/description'; - -import { h } from 'vue'; - -import { formatDateTime } from '@vben/utils'; import { getContractSimpleList } from '#/api/crm/contract'; import { getCustomerSimpleList } from '#/api/crm/customer'; import { getReceivablePlanSimpleList } from '#/api/crm/receivable/plan'; import { getSimpleUserList } from '#/api/system/user'; -import { DictTag } from '#/components/dict-tag'; -import { erpPriceInputFormatter } from '#/utils'; import { DICT_TYPE, getDictOptions } from '#/utils/dict'; /** 新增/修改的表单 */ @@ -274,144 +267,3 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { }, ]; } - -/** 详情页的字段 */ -export function useDetailSchema(): DescriptionItemSchema[] { - return [ - { - field: 'customerName', - label: '客户名称', - }, - { - field: 'totalPrice', - label: '合同金额', - content: (data) => erpPriceInputFormatter(data.totalPrice), - }, - { - field: 'returnTime', - label: '回款日期', - content: (data) => formatDateTime(data?.returnTime) as string, - }, - { - field: 'price', - label: '回款金额', - content: (data) => erpPriceInputFormatter(data.price), - }, - { - field: 'ownerUserName', - label: '负责人', - }, - ]; -} - -/** 详情页的基础字段 */ -export function useDetailBaseSchema(): DescriptionItemSchema[] { - return [ - { - field: 'no', - label: '回款编号', - }, - { - field: 'customerName', - label: '客户名称', - }, - { - field: 'contract', - label: '合同编号', - content: (data) => data?.contract?.no, - }, - { - field: 'returnTime', - label: '回款日期', - content: (data) => formatDateTime(data?.returnTime) as string, - }, - { - field: 'price', - label: '回款金额', - content: (data) => erpPriceInputFormatter(data.price), - }, - { - field: 'returnType', - label: '回款方式', - content: (data) => - h(DictTag, { - type: DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE, - value: data?.returnType, - }), - }, - { - field: 'remark', - label: '备注', - }, - ]; -} - -/** 详情列表的字段 */ -export function useDetailListColumns(): VxeTableGridOptions['columns'] { - return [ - { - title: '回款编号', - field: 'no', - minWidth: 150, - fixed: 'left', - }, - { - title: '客户名称', - field: 'customerName', - minWidth: 150, - }, - { - title: '合同编号', - field: 'contract.no', - minWidth: 150, - }, - { - title: '回款日期', - field: 'returnTime', - minWidth: 150, - formatter: 'formatDateTime', - }, - { - title: '回款金额(元)', - field: 'price', - minWidth: 150, - formatter: 'formatNumber', - }, - { - title: '回款方式', - field: 'returnType', - minWidth: 150, - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE }, - }, - }, - { - title: '负责人', - field: 'ownerUserName', - minWidth: 150, - }, - { - title: '备注', - field: 'remark', - minWidth: 150, - }, - { - title: '回款状态', - field: 'auditStatus', - minWidth: 100, - fixed: 'right', - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.CRM_AUDIT_STATUS }, - }, - }, - { - title: '操作', - field: 'actions', - width: 130, - fixed: 'right', - slots: { default: 'actions' }, - }, - ]; -} diff --git a/apps/web-antd/src/views/crm/receivable/modules/detail-data.ts b/apps/web-antd/src/views/crm/receivable/modules/detail-data.ts new file mode 100644 index 000000000..744a74e0b --- /dev/null +++ b/apps/web-antd/src/views/crm/receivable/modules/detail-data.ts @@ -0,0 +1,150 @@ +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { DescriptionItemSchema } from '#/components/description'; + +import { h } from 'vue'; + +import { formatDateTime } from '@vben/utils'; + +import { DictTag } from '#/components/dict-tag'; +import { DICT_TYPE, erpPriceInputFormatter } from '#/utils'; + +/** 详情页的字段 */ +export function useDetailSchema(): DescriptionItemSchema[] { + return [ + { + field: 'customerName', + label: '客户名称', + }, + { + field: 'totalPrice', + label: '合同金额', + content: (data) => erpPriceInputFormatter(data.totalPrice), + }, + { + field: 'returnTime', + label: '回款日期', + content: (data) => formatDateTime(data?.returnTime) as string, + }, + { + field: 'price', + label: '回款金额', + content: (data) => erpPriceInputFormatter(data.price), + }, + { + field: 'ownerUserName', + label: '负责人', + }, + ]; +} + +/** 详情页的基础字段 */ +export function useDetailBaseSchema(): DescriptionItemSchema[] { + return [ + { + field: 'no', + label: '回款编号', + }, + { + field: 'customerName', + label: '客户名称', + }, + { + field: 'contract', + label: '合同编号', + content: (data) => data?.contract?.no, + }, + { + field: 'returnTime', + label: '回款日期', + content: (data) => formatDateTime(data?.returnTime) as string, + }, + { + field: 'price', + label: '回款金额', + content: (data) => erpPriceInputFormatter(data.price), + }, + { + field: 'returnType', + label: '回款方式', + content: (data) => + h(DictTag, { + type: DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE, + value: data?.returnType, + }), + }, + { + field: 'remark', + label: '备注', + }, + ]; +} + +/** 详情列表的字段 */ +export function useDetailListColumns(): VxeTableGridOptions['columns'] { + return [ + { + title: '回款编号', + field: 'no', + minWidth: 150, + fixed: 'left', + }, + { + title: '客户名称', + field: 'customerName', + minWidth: 150, + }, + { + title: '合同编号', + field: 'contract.no', + minWidth: 150, + }, + { + title: '回款日期', + field: 'returnTime', + minWidth: 150, + formatter: 'formatDateTime', + }, + { + title: '回款金额(元)', + field: 'price', + minWidth: 150, + formatter: 'formatNumber', + }, + { + title: '回款方式', + field: 'returnType', + minWidth: 150, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE }, + }, + }, + { + title: '负责人', + field: 'ownerUserName', + minWidth: 150, + }, + { + title: '备注', + field: 'remark', + minWidth: 150, + }, + { + title: '回款状态', + field: 'auditStatus', + minWidth: 100, + fixed: 'right', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.CRM_AUDIT_STATUS }, + }, + }, + { + title: '操作', + field: 'actions', + width: 130, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-antd/src/views/crm/receivable/modules/detail-info.vue b/apps/web-antd/src/views/crm/receivable/modules/detail-info.vue index b22365cbc..884a1ce49 100644 --- a/apps/web-antd/src/views/crm/receivable/modules/detail-info.vue +++ b/apps/web-antd/src/views/crm/receivable/modules/detail-info.vue @@ -6,7 +6,7 @@ import { Divider } from 'ant-design-vue'; import { useDescription } from '#/components/description'; import { useFollowUpDetailSchema } from '#/views/crm/followup/data'; -import { useDetailBaseSchema } from '../data'; +import { useDetailBaseSchema } from './detail-data'; defineProps<{ receivable: CrmReceivableApi.Receivable; // 收款信息 diff --git a/apps/web-antd/src/views/crm/receivable/modules/detail-list.vue b/apps/web-antd/src/views/crm/receivable/modules/detail-list.vue index 9b0679e99..a892185cb 100644 --- a/apps/web-antd/src/views/crm/receivable/modules/detail-list.vue +++ b/apps/web-antd/src/views/crm/receivable/modules/detail-list.vue @@ -13,7 +13,7 @@ import { } from '#/api/crm/receivable'; import { $t } from '#/locales'; -import { useDetailListColumns } from '../data'; +import { useDetailListColumns } from './detail-data'; import Form from './form.vue'; const props = defineProps<{ diff --git a/apps/web-antd/src/views/crm/receivable/modules/detail.vue b/apps/web-antd/src/views/crm/receivable/modules/detail.vue index 24f95b16e..b249fb332 100644 --- a/apps/web-antd/src/views/crm/receivable/modules/detail.vue +++ b/apps/web-antd/src/views/crm/receivable/modules/detail.vue @@ -16,7 +16,7 @@ import { BizTypeEnum } from '#/api/crm/permission'; import { getReceivable } from '#/api/crm/receivable'; import { useDescription } from '#/components/description'; -import { useDetailSchema } from '../data'; +import { useDetailSchema } from './detail-data'; import ReceivableForm from './form.vue'; const PermissionList = defineAsyncComponent( diff --git a/apps/web-antd/src/views/crm/receivable/plan/data.ts b/apps/web-antd/src/views/crm/receivable/plan/data.ts index 26453cb39..519c41f13 100644 --- a/apps/web-antd/src/views/crm/receivable/plan/data.ts +++ b/apps/web-antd/src/views/crm/receivable/plan/data.ts @@ -1,14 +1,7 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; -import type { DescriptionItemSchema } from '#/components/description'; - -import { h } from 'vue'; - -import { formatDateTime } from '@vben/utils'; import { getCustomerSimpleList } from '#/api/crm/customer'; -import { DictTag } from '#/components/dict-tag'; -import { erpPriceInputFormatter } from '#/utils'; import { DICT_TYPE, getDictOptions } from '#/utils/dict'; /** 新增/修改的表单 */ @@ -235,135 +228,3 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { }, ]; } - -/** 详情页的字段 */ -export function useDetailSchema(): DescriptionItemSchema[] { - return [ - { - field: 'customerName', - label: '客户名称', - }, - { - field: 'totalPrice', - label: '合同金额', - content: (data) => erpPriceInputFormatter(data.totalPrice), - }, - { - field: 'returnTime', - label: '回款日期', - content: (data) => formatDateTime(data?.returnTime) as string, - }, - { - field: 'price', - label: '回款金额', - content: (data) => erpPriceInputFormatter(data.price), - }, - { - field: 'ownerUserName', - label: '负责人', - }, - ]; -} - -/** 详情页的基础字段 */ -export function useDetailBaseSchema(): DescriptionItemSchema[] { - return [ - { - field: 'no', - label: '回款编号', - }, - { - field: 'customerName', - label: '客户名称', - }, - { - field: 'contract', - label: '合同编号', - content: (data) => data?.contract?.no, - }, - { - field: 'returnTime', - label: '回款日期', - content: (data) => formatDateTime(data?.returnTime) as string, - }, - { - field: 'price', - label: '回款金额', - content: (data) => erpPriceInputFormatter(data.price), - }, - { - field: 'returnType', - label: '回款方式', - content: (data) => - h(DictTag, { - type: DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE, - value: data?.returnType, - }), - }, - { - field: 'remark', - label: '备注', - }, - ]; -} - -/** 详情列表的字段 */ -export function useDetailListColumns(): VxeTableGridOptions['columns'] { - return [ - { - title: '客户名称', - field: 'customerName', - minWidth: 150, - }, - { - title: '合同编号', - field: 'contractNo', - minWidth: 150, - }, - { - title: '期数', - field: 'period', - minWidth: 150, - }, - { - title: '计划回款(元)', - field: 'price', - minWidth: 150, - formatter: 'formatNumber', - }, - { - title: '计划回款日期', - field: 'returnTime', - minWidth: 150, - formatter: 'formatDateTime', - }, - { - title: '提前几天提醒', - field: 'remindDays', - minWidth: 150, - }, - { - title: '提醒日期', - field: 'remindTime', - minWidth: 150, - formatter: 'formatDateTime', - }, - { - title: '负责人', - field: 'ownerUserName', - minWidth: 150, - }, - { - title: '备注', - field: 'remark', - minWidth: 150, - }, - { - title: '操作', - field: 'actions', - width: 240, - fixed: 'right', - slots: { default: 'actions' }, - }, - ]; -} diff --git a/apps/web-antd/src/views/crm/receivable/plan/modules/detail-data.ts b/apps/web-antd/src/views/crm/receivable/plan/modules/detail-data.ts new file mode 100644 index 000000000..8947dcef0 --- /dev/null +++ b/apps/web-antd/src/views/crm/receivable/plan/modules/detail-data.ts @@ -0,0 +1,141 @@ +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { DescriptionItemSchema } from '#/components/description'; + +import { h } from 'vue'; + +import { formatDateTime } from '@vben/utils'; + +import { DictTag } from '#/components/dict-tag'; +import { DICT_TYPE, erpPriceInputFormatter } from '#/utils'; + +/** 详情页的字段 */ +export function useDetailSchema(): DescriptionItemSchema[] { + return [ + { + field: 'customerName', + label: '客户名称', + }, + { + field: 'totalPrice', + label: '合同金额', + content: (data) => erpPriceInputFormatter(data.totalPrice), + }, + { + field: 'returnTime', + label: '回款日期', + content: (data) => formatDateTime(data?.returnTime) as string, + }, + { + field: 'price', + label: '回款金额', + content: (data) => erpPriceInputFormatter(data.price), + }, + { + field: 'ownerUserName', + label: '负责人', + }, + ]; +} + +/** 详情页的基础字段 */ +export function useDetailBaseSchema(): DescriptionItemSchema[] { + return [ + { + field: 'no', + label: '回款编号', + }, + { + field: 'customerName', + label: '客户名称', + }, + { + field: 'contract', + label: '合同编号', + content: (data) => data?.contract?.no, + }, + { + field: 'returnTime', + label: '回款日期', + content: (data) => formatDateTime(data?.returnTime) as string, + }, + { + field: 'price', + label: '回款金额', + content: (data) => erpPriceInputFormatter(data.price), + }, + { + field: 'returnType', + label: '回款方式', + content: (data) => + h(DictTag, { + type: DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE, + value: data?.returnType, + }), + }, + { + field: 'remark', + label: '备注', + }, + ]; +} + +/** 详情列表的字段 */ +export function useDetailListColumns(): VxeTableGridOptions['columns'] { + return [ + { + title: '客户名称', + field: 'customerName', + minWidth: 150, + }, + { + title: '合同编号', + field: 'contractNo', + minWidth: 150, + }, + { + title: '期数', + field: 'period', + minWidth: 150, + }, + { + title: '计划回款(元)', + field: 'price', + minWidth: 150, + formatter: 'formatNumber', + }, + { + title: '计划回款日期', + field: 'returnTime', + minWidth: 150, + formatter: 'formatDateTime', + }, + { + title: '提前几天提醒', + field: 'remindDays', + minWidth: 150, + }, + { + title: '提醒日期', + field: 'remindTime', + minWidth: 150, + formatter: 'formatDateTime', + }, + { + title: '负责人', + field: 'ownerUserName', + minWidth: 150, + }, + { + title: '备注', + field: 'remark', + minWidth: 150, + }, + { + title: '操作', + field: 'actions', + width: 240, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-antd/src/views/crm/receivable/plan/modules/detail-info.vue b/apps/web-antd/src/views/crm/receivable/plan/modules/detail-info.vue index b22c59016..530b4e1a6 100644 --- a/apps/web-antd/src/views/crm/receivable/plan/modules/detail-info.vue +++ b/apps/web-antd/src/views/crm/receivable/plan/modules/detail-info.vue @@ -6,7 +6,7 @@ import { Divider } from 'ant-design-vue'; import { useDescription } from '#/components/description'; import { useFollowUpDetailSchema } from '#/views/crm/followup/data'; -import { useDetailBaseSchema } from '../data'; +import { useDetailBaseSchema } from './detail-data'; defineProps<{ receivablePlan: CrmReceivablePlanApi.Plan; // 收款计划信息 diff --git a/apps/web-antd/src/views/crm/receivable/plan/modules/detail-list.vue b/apps/web-antd/src/views/crm/receivable/plan/modules/detail-list.vue index 06cae9bd2..8929bb491 100644 --- a/apps/web-antd/src/views/crm/receivable/plan/modules/detail-list.vue +++ b/apps/web-antd/src/views/crm/receivable/plan/modules/detail-list.vue @@ -15,7 +15,7 @@ import { import { $t } from '#/locales'; import ReceivableForm from '../../modules/form.vue'; -import { useDetailListColumns } from '../data'; +import { useDetailListColumns } from './detail-data'; import Form from './form.vue'; const props = defineProps<{ diff --git a/apps/web-antd/src/views/crm/receivable/plan/modules/detail.vue b/apps/web-antd/src/views/crm/receivable/plan/modules/detail.vue index edc8eefdb..04be42a3e 100644 --- a/apps/web-antd/src/views/crm/receivable/plan/modules/detail.vue +++ b/apps/web-antd/src/views/crm/receivable/plan/modules/detail.vue @@ -16,7 +16,7 @@ import { BizTypeEnum } from '#/api/crm/permission'; import { getReceivablePlan } from '#/api/crm/receivable/plan'; import { useDescription } from '#/components/description'; -import { useDetailSchema } from '../data'; +import { useDetailSchema } from './detail-data'; import ReceivablePlanForm from './form.vue'; const PermissionList = defineAsyncComponent(