From a043e4a746acbc2bb9ec8faaf85ad2c8ae7fb130 Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Thu, 29 May 2025 23:27:57 +0800 Subject: [PATCH 1/3] feat: crm backlog --- apps/web-antd/src/views/crm/backlog/data.ts | 670 ------------------ apps/web-antd/src/views/crm/backlog/index.vue | 31 +- .../modules/ReceivablePlanRemindList.vue | 90 --- .../crm/backlog/modules/clue-follow-list.vue | 26 +- .../backlog/modules/contract-audit-list.vue | 23 +- ...emindList.vue => contract-remind-list.vue} | 73 +- ...ollowList.vue => customer-follow-list.vue} | 30 +- ....vue => customer-put-pool-remind-list.vue} | 30 +- ...st.vue => customer-today-contact-list.vue} | 40 +- ...uditList.vue => receivable-audit-list.vue} | 57 +- .../modules/receivable-plan-remind-list.vue | 101 +++ 11 files changed, 304 insertions(+), 867 deletions(-) delete mode 100644 apps/web-antd/src/views/crm/backlog/modules/ReceivablePlanRemindList.vue rename apps/web-antd/src/views/crm/backlog/modules/{ContractRemindList.vue => contract-remind-list.vue} (52%) rename apps/web-antd/src/views/crm/backlog/modules/{CustomerFollowList.vue => customer-follow-list.vue} (57%) rename apps/web-antd/src/views/crm/backlog/modules/{CustomerPutPoolRemindList.vue => customer-put-pool-remind-list.vue} (59%) rename apps/web-antd/src/views/crm/backlog/modules/{CustomerTodayContactList.vue => customer-today-contact-list.vue} (51%) rename apps/web-antd/src/views/crm/backlog/modules/{ReceivableAuditList.vue => receivable-audit-list.vue} (59%) create mode 100644 apps/web-antd/src/views/crm/backlog/modules/receivable-plan-remind-list.vue diff --git a/apps/web-antd/src/views/crm/backlog/data.ts b/apps/web-antd/src/views/crm/backlog/data.ts index ef6047d0e..4bd325004 100644 --- a/apps/web-antd/src/views/crm/backlog/data.ts +++ b/apps/web-antd/src/views/crm/backlog/data.ts @@ -1,15 +1,5 @@ import type { Ref } from 'vue'; -import type { VbenFormSchema } from '#/adapter/form'; -import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table'; -import type { CrmReceivableApi } from '#/api/crm/receivable'; - -import { useAccess } from '@vben/access'; - -import { DICT_TYPE } from '#/utils'; - -const { hasAccessByCodes } = useAccess(); - export interface LeftSideItem { name: string; menu: string; @@ -109,663 +99,3 @@ export const useLeftSides = ( }, ]; }; - -/** 分配给我的线索 列表的搜索表单 */ -export function useClueFollowFormSchema(): VbenFormSchema[] { - return [ - { - fieldName: 'followUpStatus', - label: '状态', - component: 'Select', - componentProps: { - allowClear: true, - options: FOLLOWUP_STATUS, - }, - defaultValue: false, - }, - ]; -} - -/** 分配给我的线索 列表的字段 */ -export function useClueFollowColumns(): VxeTableGridOptions['columns'] { - return [ - { - field: 'name', - title: '线索名称', - fixed: 'left', - slots: { default: 'name' }, - }, - { - field: 'source', - title: '线索来源', - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.CRM_CUSTOMER_SOURCE }, - }, - }, - { - field: 'mobile', - title: '手机', - }, - { - field: 'telephone', - title: '电话', - }, - { - field: 'email', - title: '邮箱', - }, - { - field: 'detailAddress', - title: '地址', - }, - { - field: 'industryId', - title: '客户行业', - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.CRM_CUSTOMER_INDUSTRY }, - }, - }, - { - field: 'level', - title: '客户级别', - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.CRM_CUSTOMER_LEVEL }, - }, - }, - { - field: 'contactNextTime', - title: '下次联系时间', - formatter: 'formatDateTime', - }, - { - field: 'remark', - title: '备注', - }, - { - field: 'contactLastTime', - title: '最后跟进时间', - formatter: 'formatDateTime', - }, - { - field: 'contactLastContent', - title: '最后跟进记录', - }, - { - field: 'ownerUserName', - title: '负责人', - }, - { - field: 'ownerUserDeptName', - title: '所属部门', - }, - { - field: 'updateTime', - title: '更新时间', - formatter: 'formatDateTime', - }, - { - field: 'createTime', - title: '创建时间', - formatter: 'formatDateTime', - }, - { - field: 'creatorName', - title: '创建人', - }, - ]; -} - -/** 合同审核列表的搜索表单 */ -export function useContractAuditFormSchema(): VbenFormSchema[] { - return [ - { - fieldName: 'auditStatus', - label: '合同状态', - component: 'Select', - componentProps: { - allowClear: true, - options: AUDIT_STATUS, - }, - defaultValue: 10, - }, - ]; -} - -/** 合同提醒列表的搜索表单 */ -export function useContractRemindFormSchema(): VbenFormSchema[] { - return [ - { - fieldName: 'expiryType', - label: '到期状态', - component: 'Select', - componentProps: { - allowClear: true, - options: CONTRACT_EXPIRY_TYPE, - }, - defaultValue: 1, - }, - ]; -} - -/** 合同审核列表的字段 */ -export function useContractColumns(): VxeTableGridOptions['columns'] { - return [ - { - field: 'no', - title: '合同编号', - fixed: 'left', - }, - { - field: 'name', - title: '合同名称', - slots: { default: 'name' }, - }, - { - field: 'customerName', - title: '客户名称', - slots: { default: 'customerName' }, - }, - { - field: 'businessName', - title: '商机名称', - slots: { default: 'businessName' }, - }, - { - field: 'price', - title: '合同金额(元)', - formatter: 'formatNumber', - }, - { - field: 'orderDate', - title: '下单时间', - formatter: 'formatDateTime', - }, - { - field: 'startTime', - title: '合同开始时间', - formatter: 'formatDateTime', - }, - { - field: 'endTime', - title: '合同结束时间', - formatter: 'formatDateTime', - }, - { - field: 'contactName', - title: '客户签约人', - slots: { default: 'contactName' }, - }, - { - field: 'signUserName', - title: '公司签约人', - }, - { - field: 'remark', - title: '备注', - }, - { - field: 'totalReceivablePrice', - title: '已回款金额(元)', - formatter: 'formatNumber', - }, - { - field: 'noReceivablePrice', - title: '未回款金额(元)', - formatter: 'formatNumber', - }, - { - field: 'contactLastTime', - title: '最后跟进时间', - formatter: 'formatDateTime', - }, - { - field: 'ownerUserName', - title: '负责人', - }, - { - field: 'ownerUserDeptName', - title: '所属部门', - }, - { - field: 'updateTime', - title: '更新时间', - formatter: 'formatDateTime', - }, - { - field: 'createTime', - title: '创建时间', - formatter: 'formatDateTime', - }, - { - field: 'creatorName', - title: '创建人', - }, - { - field: 'auditStatus', - title: '合同状态', - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.CRM_AUDIT_STATUS }, - }, - }, - { - title: '操作', - width: 80, - fixed: 'right', - slots: { default: 'actions' }, - }, - ]; -} - -/** 客户跟进列表的搜索表单 */ -export function useCustomerFollowFormSchema(): VbenFormSchema[] { - return [ - { - fieldName: 'followUpStatus', - label: '状态', - component: 'Select', - componentProps: { - allowClear: true, - options: FOLLOWUP_STATUS, - }, - defaultValue: false, - }, - ]; -} - -/** 待进入公海客户列表的搜索表单 */ -export function useCustomerPutPoolFormSchema(): VbenFormSchema[] { - return [ - { - fieldName: 'sceneType', - label: '归属', - component: 'Select', - componentProps: { - allowClear: true, - options: SCENE_TYPES, - }, - defaultValue: 1, - }, - ]; -} - -/** 今日需联系客户列表的搜索表单 */ -export function useCustomerTodayContactFormSchema(): VbenFormSchema[] { - return [ - { - fieldName: 'contactStatus', - label: '状态', - component: 'Select', - componentProps: { - allowClear: true, - options: CONTACT_STATUS, - }, - defaultValue: 1, - }, - { - fieldName: 'sceneType', - label: '归属', - component: 'Select', - componentProps: { - allowClear: true, - options: SCENE_TYPES, - }, - defaultValue: 1, - }, - ]; -} - -/** 客户列表的字段 */ -export function useCustomerColumns(): VxeTableGridOptions['columns'] { - return [ - { - field: 'name', - title: '客户名称', - slots: { default: 'name' }, - }, - { - field: 'source', - title: '客户来源', - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.CRM_CUSTOMER_SOURCE }, - }, - }, - { - field: 'mobile', - title: '手机', - }, - { - field: 'telephone', - title: '电话', - }, - { - field: 'email', - title: '邮箱', - }, - { - field: 'level', - title: '客户级别', - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.CRM_CUSTOMER_LEVEL }, - }, - }, - { - field: 'industryId', - title: '客户行业', - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.CRM_CUSTOMER_INDUSTRY }, - }, - }, - { - field: 'contactNextTime', - title: '下次联系时间', - formatter: 'formatDateTime', - }, - { - field: 'remark', - title: '备注', - }, - { - field: 'lockStatus', - title: '锁定状态', - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.INFRA_BOOLEAN_STRING }, - }, - }, - { - field: 'dealStatus', - title: '成交状态', - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.INFRA_BOOLEAN_STRING }, - }, - }, - { - field: 'contactLastTime', - title: '最后跟进时间', - formatter: 'formatDateTime', - }, - { - field: 'contactLastContent', - title: '最后跟进记录', - }, - { - field: 'detailAddress', - title: '地址', - }, - { - field: 'poolDay', - title: '距离进入公海天数', - }, - { - field: 'ownerUserName', - title: '负责人', - }, - { - field: 'ownerUserDeptName', - title: '所属部门', - }, - { - field: 'updateTime', - title: '更新时间', - formatter: 'formatDateTime', - }, - { - field: 'createTime', - title: '创建时间', - formatter: 'formatDateTime', - }, - { - field: 'creatorName', - title: '创建人', - }, - ]; -} - -/** 回款审核列表的搜索表单 */ -export function useReceivableAuditFormSchema(): VbenFormSchema[] { - return [ - { - fieldName: 'auditStatus', - label: '合同状态', - component: 'Select', - componentProps: { - allowClear: true, - options: AUDIT_STATUS, - }, - defaultValue: 10, - }, - ]; -} - -/** 回款审核列表的字段 */ -export function useReceivableAuditColumns( - onActionClick: OnActionClickFn, -): VxeTableGridOptions['columns'] { - return [ - { - field: 'no', - title: '回款编号', - fixed: 'left', - slots: { default: 'no' }, - }, - { - field: 'customerName', - title: '客户名称', - slots: { default: 'customerName' }, - }, - { - field: 'contractNo', - title: '合同编号', - slots: { default: 'contractNo' }, - }, - { - field: 'returnTime', - title: '回款日期', - formatter: 'formatDateTime', - }, - { - field: 'price', - title: '回款金额(元)', - formatter: 'formatNumber', - }, - { - field: 'returnType', - title: '回款方式', - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE }, - }, - }, - { - field: 'remark', - title: '备注', - }, - { - field: 'contract.totalPrice', - title: '合同金额(元)', - formatter: 'formatNumber', - }, - { - field: 'ownerUserName', - title: '负责人', - }, - { - field: 'ownerUserDeptName', - title: '所属部门', - }, - { - field: 'updateTime', - title: '更新时间', - formatter: 'formatDateTime', - }, - { - field: 'createTime', - title: '创建时间', - formatter: 'formatDateTime', - }, - { - field: 'creatorName', - title: '创建人', - }, - { - field: 'auditStatus', - title: '回款状态', - fixed: 'right', - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.CRM_AUDIT_STATUS }, - }, - }, - { - field: 'operation', - title: '操作', - width: 140, - fixed: 'right', - align: 'center', - cellRender: { - attrs: { - nameField: 'name', - nameTitle: '角色', - onClick: onActionClick, - }, - name: 'CellOperation', - options: [ - { - code: 'processDetail', - text: '查看审批', - show: hasAccessByCodes(['crm:receivable:update']), - }, - ], - }, - }, - ]; -} - -/** 回款计划提醒列表的搜索表单 */ -export function useReceivablePlanRemindFormSchema(): VbenFormSchema[] { - return [ - { - fieldName: 'remindType', - label: '合同状态', - component: 'Select', - componentProps: { - allowClear: true, - options: RECEIVABLE_REMIND_TYPE, - }, - defaultValue: 1, - }, - ]; -} - -/** 回款计划提醒列表的字段 */ -export function useReceivablePlanRemindColumns( - onActionClick: OnActionClickFn, -): VxeTableGridOptions['columns'] { - return [ - { - field: 'customerName', - title: '客户名称', - fixed: 'left', - slots: { default: 'customerName' }, - }, - { - field: 'contractNo', - title: '合同编号', - }, - { - field: 'period', - title: '期数', - slots: { default: 'period' }, - }, - { - field: 'price', - title: '计划回款金额(元)', - formatter: 'formatNumber', - }, - { - field: 'returnTime', - title: '计划回款日期', - formatter: 'formatDateTime', - }, - { - field: 'remindDays', - title: '提前几天提醒', - }, - { - field: 'remindTime', - title: '提醒日期', - formatter: 'formatDateTime', - }, - { - field: 'returnType', - title: '回款方式', - fixed: 'right', - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE }, - }, - }, - { - field: 'remark', - title: '备注', - }, - { - field: 'ownerUserName', - title: '负责人', - }, - { - field: 'receivable.price', - title: '实际回款金额(元)', - formatter: 'formatNumber', - }, - { - field: 'receivable.returnTime', - title: '实际回款日期', - formatter: 'formatDateTime', - }, - { - field: 'updateTime', - title: '更新时间', - formatter: 'formatDateTime', - }, - { - field: 'createTime', - title: '创建时间', - formatter: 'formatDateTime', - }, - { - field: 'creatorName', - title: '创建人', - }, - { - field: 'operation', - title: '操作', - width: 140, - fixed: 'right', - align: 'center', - cellRender: { - attrs: { - nameField: 'customerName', - nameTitle: '客户名称', - onClick: onActionClick, - }, - name: 'CellOperation', - options: [ - { - code: 'receivableForm', - text: '创建回款', - show: hasAccessByCodes(['crm:receivable:create']), - }, - ], - }, - }, - ]; -} diff --git a/apps/web-antd/src/views/crm/backlog/index.vue b/apps/web-antd/src/views/crm/backlog/index.vue index 1f8b7a62a..1173703e7 100644 --- a/apps/web-antd/src/views/crm/backlog/index.vue +++ b/apps/web-antd/src/views/crm/backlog/index.vue @@ -10,17 +10,16 @@ import * as ContractApi from '#/api/crm/contract'; import * as CustomerApi from '#/api/crm/customer'; import * as ReceivableApi from '#/api/crm/receivable'; import * as ReceivablePlanApi from '#/api/crm/receivable/plan'; -import { DocAlert } from '#/components/doc-alert'; import { useLeftSides } from './data'; import ClueFollowList from './modules/clue-follow-list.vue'; import ContractAuditList from './modules/contract-audit-list.vue'; -import ContractRemindList from './modules/ContractRemindList.vue'; -import CustomerFollowList from './modules/CustomerFollowList.vue'; -import CustomerPutPoolRemindList from './modules/CustomerPutPoolRemindList.vue'; -import CustomerTodayContactList from './modules/CustomerTodayContactList.vue'; -import ReceivableAuditList from './modules/ReceivableAuditList.vue'; -import ReceivablePlanRemindList from './modules/ReceivablePlanRemindList.vue'; +import ContractRemindList from './modules/contract-remind-list.vue'; +import CustomerFollowList from './modules/customer-follow-list.vue'; +import CustomerPutPoolRemindList from './modules/customer-put-pool-remind-list.vue'; +import CustomerTodayContactList from './modules/customer-today-contact-list.vue'; +import ReceivableAuditList from './modules/receivable-audit-list.vue'; +import ReceivablePlanRemindList from './modules/receivable-plan-remind-list.vue'; defineOptions({ name: 'CrmBacklog' }); @@ -92,12 +91,6 @@ onMounted(async () => {