diff --git a/src/api/crm/backlog/index.ts b/src/api/crm/backlog/index.ts index 614b0ef2..7ea01990 100644 --- a/src/api/crm/backlog/index.ts +++ b/src/api/crm/backlog/index.ts @@ -1,11 +1,6 @@ import request from '@/config/axios' // TODO 芋艿:融合下 -// 3. 获得分配给我的客户数量 -export const getFollowCustomerCount = async () => { - return await request.get({ url: '/crm/customer/follow-customer-count' }) -} - // 5. 获得待审核合同数量 export const getCheckContractCount = async () => { return await request.get({ url: '/crm/contract/check-contract-count' }) diff --git a/src/api/crm/business/index.ts b/src/api/crm/business/index.ts index 37304f5a..b6661765 100644 --- a/src/api/crm/business/index.ts +++ b/src/api/crm/business/index.ts @@ -4,22 +4,42 @@ import { TransferReqVO } from '@/api/crm/customer' export interface BusinessVO { id: number name: string - statusTypeId: number - statusId: number - contactNextTime: Date customerId: number - dealTime: Date - price: number - discountPercent: number - productPrice: number - remark: string + customerName?: string + followUpStatus: boolean + contactLastTime: Date + contactNextTime: Date ownerUserId: number - roUserIds: string - rwUserIds: string + ownerUserName?: string // 负责人的用户名称 + ownerUserDept?: string // 负责人的部门名称 + statusTypeId: number + statusTypeName?: string + statusId: number + statusName?: string endStatus: number endRemark: string - contactLastTime: Date - followUpStatus: number + dealTime: Date + totalProductPrice: number + totalPrice: number + discountPercent: number + remark: string + creator: string // 创建人 + creatorName?: string // 创建人名称 + createTime: Date // 创建时间 + updateTime: Date // 更新时间 + products?: [ + { + id: number + productId: number + productName: string + productNo: string + productUnit: number + productPrice: number + businessPrice: number + count: number + totalPrice: number + } + ] } // 查询 CRM 商机列表 @@ -52,6 +72,11 @@ export const updateBusiness = async (data: BusinessVO) => { return await request.put({ url: `/crm/business/update`, data }) } +// 修改 CRM 商机状态 +export const updateBusinessStatus = async (data: BusinessVO) => { + return await request.put({ url: `/crm/business/update-status`, data }) +} + // 删除 CRM 商机 export const deleteBusiness = async (id: number) => { return await request.delete({ url: `/crm/business/delete?id=` + id }) @@ -67,11 +92,6 @@ export const getBusinessPageByContact = async (params) => { return await request.get({ url: `/crm/business/page-by-contact`, params }) } -// 获得 CRM 商机列表 -export const getBusinessListByIds = async (val: number[]) => { - return await request.get({ url: '/crm/business/list-by-ids', params: { ids: val.join(',') } }) -} - // 商机转移 export const transferBusiness = async (data: TransferReqVO) => { return await request.put({ url: '/crm/business/transfer', data }) diff --git a/src/api/crm/business/status/index.ts b/src/api/crm/business/status/index.ts new file mode 100644 index 00000000..cddaa5a2 --- /dev/null +++ b/src/api/crm/business/status/index.ts @@ -0,0 +1,68 @@ +import request from '@/config/axios' + +export interface BusinessStatusTypeVO { + id: number + name: string + deptIds: number[] + statuses?: { + id: number + name: string + percent: number + } +} + +export const DEFAULT_STATUSES = [ + { + endStatus: 1, + key: '结束', + name: '赢单', + percent: 100 + }, + { + endStatus: 2, + key: '结束', + name: '输单', + percent: 0 + }, + { + endStatus: 3, + key: '结束', + name: '无效', + percent: 0 + } +] + +// 查询商机状态组列表 +export const getBusinessStatusPage = async (params: any) => { + return await request.get({ url: `/crm/business-status/page`, params }) +} + +// 新增商机状态组 +export const createBusinessStatus = async (data: BusinessStatusTypeVO) => { + return await request.post({ url: `/crm/business-status/create`, data }) +} + +// 修改商机状态组 +export const updateBusinessStatus = async (data: BusinessStatusTypeVO) => { + return await request.put({ url: `/crm/business-status/update`, data }) +} + +// 查询商机状态类型详情 +export const getBusinessStatus = async (id: number) => { + return await request.get({ url: `/crm/business-status/get?id=` + id }) +} + +// 删除商机状态 +export const deleteBusinessStatus = async (id: number) => { + return await request.delete({ url: `/crm/business-status/delete?id=` + id }) +} + +// 获得商机状态组列表 +export const getBusinessStatusTypeSimpleList = async () => { + return await request.get({ url: `/crm/business-status/type-simple-list` }) +} + +// 获得商机阶段列表 +export const getBusinessStatusSimpleList = async (typeId: number) => { + return await request.get({ url: `/crm/business-status/status-simple-list`, params: { typeId } }) +} diff --git a/src/api/crm/businessStatusType/index.ts b/src/api/crm/businessStatusType/index.ts deleted file mode 100644 index cc4b46aa..00000000 --- a/src/api/crm/businessStatusType/index.ts +++ /dev/null @@ -1,48 +0,0 @@ -import request from '@/config/axios' - -export interface BusinessStatusTypeVO { - id: number - name: string - deptIds: number[] - status: boolean -} - -// 查询商机状态类型列表 -export const getBusinessStatusTypePage = async (params) => { - return await request.get({ url: `/crm/business-status-type/page`, params }) -} - -// 查询商机状态类型详情 -export const getBusinessStatusType = async (id: number) => { - return await request.get({ url: `/crm/business-status-type/get?id=` + id }) -} - -// 新增商机状态类型 -export const createBusinessStatusType = async (data: BusinessStatusTypeVO) => { - return await request.post({ url: `/crm/business-status-type/create`, data }) -} - -// 修改商机状态类型 -export const updateBusinessStatusType = async (data: BusinessStatusTypeVO) => { - return await request.put({ url: `/crm/business-status-type/update`, data }) -} - -// 删除商机状态类型 -export const deleteBusinessStatusType = async (id: number) => { - return await request.delete({ url: `/crm/business-status-type/delete?id=` + id }) -} - -// 导出商机状态类型 Excel -export const exportBusinessStatusType = async (params) => { - return await request.download({ url: `/crm/business-status-type/export-excel`, params }) -} - -// 获取商机状态类型信息列表 -export const getBusinessStatusTypeList = async () => { - return await request.get({ url: `/crm/business-status-type/get-simple-list` }) -} - -// 根据类型ID获取商机状态信息列表 -export const getBusinessStatusListByTypeId = async (typeId: number) => { - return await request.get({ url: `/crm/business-status-type/get-status-list?typeId=` + typeId }) -} diff --git a/src/api/crm/contact/index.ts b/src/api/crm/contact/index.ts index 2dab70bc..67036194 100644 --- a/src/api/crm/contact/index.ts +++ b/src/api/crm/contact/index.ts @@ -2,29 +2,34 @@ import request from '@/config/axios' import { TransferReqVO } from '@/api/crm/customer' export interface ContactVO { - name: string - nextTime: Date - mobile: string - telephone: string - email: string - post: string - customerId: number - detailAddress: string - remark: string - ownerUserId: string - lastTime: Date - id: number - parentId: number - qq: number - wechat: string - sex: number - master: boolean - creatorName: string - updateTime?: Date - createTime?: Date - customerName: string - areaName: string - ownerUserName: string + id: number // 编号 + name: string // 联系人名称 + customerId: number // 客户编号 + customerName?: string // 客户名称 + contactLastTime: Date // 最后跟进时间 + contactLastContent: string // 最后跟进内容 + contactNextTime: Date // 下次联系时间 + ownerUserId: number // 负责人的用户编号 + ownerUserName?: string // 负责人的用户名称 + ownerUserDept?: string // 负责人的部门名称 + mobile: string // 手机号 + telephone: string // 电话 + qq: string // QQ + wechat: string // wechat + email: string // email + areaId: number // 所在地 + areaName?: string // 所在地名称 + detailAddress: string // 详细地址 + sex: number // 性别 + master: boolean // 是否主联系人 + post: string // 职务 + parentId: number // 上级联系人编号 + parentName?: string // 上级联系人名称 + remark: string // 备注 + creator: string // 创建人 + creatorName?: string // 创建人名称 + createTime: Date // 创建时间 + updateTime: Date // 更新时间 } export interface ContactBusinessReqVO { @@ -32,6 +37,11 @@ export interface ContactBusinessReqVO { businessIds: number[] } +export interface ContactBusiness2ReqVO { + businessId: number + contactIds: number[] +} + // 查询 CRM 联系人列表 export const getContactPage = async (params) => { return await request.get({ url: `/crm/contact/page`, params }) @@ -42,6 +52,11 @@ export const getContactPageByCustomer = async (params: any) => { return await request.get({ url: `/crm/contact/page-by-customer`, params }) } +// 查询 CRM 联系人列表,基于指定商机 +export const getContactPageByBusiness = async (params: any) => { + return await request.get({ url: `/crm/contact/page-by-business`, params }) +} + // 查询 CRM 联系人详情 export const getContact = async (id: number) => { return await request.get({ url: `/crm/contact/get?id=` + id }) @@ -72,21 +87,26 @@ export const getSimpleContactList = async () => { return await request.get({ url: `/crm/contact/simple-all-list` }) } -// 获得 CRM 联系人列表 -export const getContactListByIds = async (val: number[]) => { - return await request.get({ url: '/crm/contact/list-by-ids', params: { ids: val.join(',') } }) -} - // 批量新增联系人商机关联 export const createContactBusinessList = async (data: ContactBusinessReqVO) => { return await request.post({ url: `/crm/contact/create-business-list`, data }) } +// 批量新增联系人商机关联 +export const createContactBusinessList2 = async (data: ContactBusiness2ReqVO) => { + return await request.post({ url: `/crm/contact/create-business-list2`, data }) +} + // 解除联系人商机关联 export const deleteContactBusinessList = async (data: ContactBusinessReqVO) => { return await request.delete({ url: `/crm/contact/delete-business-list`, data }) } +// 解除联系人商机关联 +export const deleteContactBusinessList2 = async (data: ContactBusiness2ReqVO) => { + return await request.delete({ url: `/crm/contact/delete-business-list2`, data }) +} + // 联系人转移 export const transferContact = async (data: TransferReqVO) => { return await request.put({ url: '/crm/contact/transfer', data }) diff --git a/src/api/crm/contract/config/index.ts b/src/api/crm/contract/config/index.ts new file mode 100644 index 00000000..0c7ad20c --- /dev/null +++ b/src/api/crm/contract/config/index.ts @@ -0,0 +1,16 @@ +import request from '@/config/axios' + +export interface ContractConfigVO { + notifyEnabled?: boolean + notifyDays?: number +} + +// 获取合同配置 +export const getContractConfig = async () => { + return await request.get({ url: `/crm/contract-config/get` }) +} + +// 更新合同配置 +export const saveContractConfig = async (data: ContractConfigVO) => { + return await request.put({ url: `/crm/contract-config/save`, data }) +} diff --git a/src/api/crm/contract/index.ts b/src/api/crm/contract/index.ts index 9d718c23..faee9495 100644 --- a/src/api/crm/contract/index.ts +++ b/src/api/crm/contract/index.ts @@ -1,35 +1,49 @@ import request from '@/config/axios' -import { ProductExpandVO } from '@/api/crm/product' import { TransferReqVO } from '@/api/crm/customer' export interface ContractVO { id: number name: string + no: string customerId: number + customerName?: string businessId: number businessName: string - processInstanceId: number - orderDate: Date + contactLastTime: Date ownerUserId: number - no: string + ownerUserName?: string + ownerUserDeptName?: string + processInstanceId: number + auditStatus: number + orderDate: Date startTime: Date endTime: Date - price: number + totalProductPrice: number discountPercent: number - productPrice: number - contactId: number + totalPrice: number + totalReceivablePrice: number + signContactId: number + signContactName?: string signUserId: number signUserName: string - contactLastTime: Date - auditStatus: number remark: string - productItems: ProductExpandVO[] + createTime?: Date + creator: string creatorName: string updateTime?: Date - createTime?: Date - customerName: string - contactName: string - ownerUserName: string + products?: [ + { + id: number + productId: number + productName: string + productNo: string + productUnit: number + productPrice: number + contractPrice: number + count: number + totalPrice: number + } + ] } // 查询 CRM 合同列表 @@ -42,11 +56,23 @@ export const getContractPageByCustomer = async (params: any) => { return await request.get({ url: `/crm/contract/page-by-customer`, params }) } +// 查询 CRM 联系人列表,基于指定商机 +export const getContractPageByBusiness = async (params: any) => { + return await request.get({ url: `/crm/contract/page-by-business`, params }) +} + // 查询 CRM 合同详情 export const getContract = async (id: number) => { return await request.get({ url: `/crm/contract/get?id=` + id }) } +// 查询 CRM 合同下拉列表 +export const getContractSimpleList = async (customerId: number) => { + return await request.get({ + url: `/crm/contract/simple-list?customerId=${customerId}` + }) +} + // 新增 CRM 合同 export const createContract = async (data: ContractVO) => { return await request.post({ url: `/crm/contract/create`, data }) @@ -76,3 +102,13 @@ export const submitContract = async (id: number) => { export const transferContract = async (data: TransferReqVO) => { return await request.put({ url: '/crm/contract/transfer', data }) } + +// 获得待审核合同数量 +export const getAuditContractCount = async () => { + return await request.get({ url: '/crm/contract/audit-count' }) +} + +// 获得即将到期(提醒)的合同数量 +export const getRemindContractCount = async () => { + return await request.get({ url: '/crm/contract/remind-count' }) +} diff --git a/src/api/crm/customer/index.ts b/src/api/crm/customer/index.ts index cc15eb5e..c684e98d 100644 --- a/src/api/crm/customer/index.ts +++ b/src/api/crm/customer/index.ts @@ -90,6 +90,11 @@ export const importCustomerTemplate = () => { return request.download({ url: '/crm/customer/get-import-template' }) } +// 导入客户 +export const handleImport = async (formData) => { + return await request.upload({ url: `/crm/customer/import`, data: formData }) +} + // 客户列表 export const getCustomerSimpleList = async () => { return await request.get({ url: `/crm/customer/simple-list` }) diff --git a/src/api/crm/followup/index.ts b/src/api/crm/followup/index.ts index 504879d3..414f3f71 100644 --- a/src/api/crm/followup/index.ts +++ b/src/api/crm/followup/index.ts @@ -11,7 +11,17 @@ export interface FollowUpRecordVO { fileUrls: string[] // 附件 nextTime: Date // 下次联系时间 businessIds: number[] // 关联的商机编号数组 + businesses: { + id: number + name: string + }[] // 关联的商机数组 contactIds: number[] // 关联的联系人编号数组 + contacts: { + id: number + name: string + }[] // 关联的联系人数组 + creator: string + creatorName?: string } // 跟进记录 API @@ -21,28 +31,13 @@ export const FollowUpRecordApi = { return await request.get({ url: `/crm/follow-up-record/page`, params }) }, - // 查询跟进记录详情 - getFollowUpRecord: async (id: number) => { - return await request.get({ url: `/crm/follow-up-record/get?id=` + id }) - }, - // 新增跟进记录 createFollowUpRecord: async (data: FollowUpRecordVO) => { return await request.post({ url: `/crm/follow-up-record/create`, data }) }, - // 修改跟进记录 - updateFollowUpRecord: async (data: FollowUpRecordVO) => { - return await request.put({ url: `/crm/follow-up-record/update`, data }) - }, - // 删除跟进记录 deleteFollowUpRecord: async (id: number) => { return await request.delete({ url: `/crm/follow-up-record/delete?id=` + id }) - }, - - // 导出跟进记录 Excel - exportFollowUpRecord: async (params) => { - return await request.download({ url: `/crm/follow-up-record/export-excel`, params }) } } diff --git a/src/api/crm/product/productCategory/index.ts b/src/api/crm/product/category/index.ts similarity index 100% rename from src/api/crm/product/productCategory/index.ts rename to src/api/crm/product/category/index.ts diff --git a/src/api/crm/product/index.ts b/src/api/crm/product/index.ts index e6508fb4..f0c23289 100644 --- a/src/api/crm/product/index.ts +++ b/src/api/crm/product/index.ts @@ -8,21 +8,21 @@ export interface ProductVO { price: number status: number categoryId: number + categoryName?: string description: string ownerUserId: number } -export interface ProductExpandVO extends ProductVO { - count: number - discountPercent: number - totalPrice: number -} - // 查询产品列表 export const getProductPage = async (params) => { return await request.get({ url: `/crm/product/page`, params }) } +// 获得产品精简列表 +export const getProductSimpleList = async () => { + return await request.get({ url: `/crm/product/simple-list` }) +} + // 查询产品详情 export const getProduct = async (id: number) => { return await request.get({ url: `/crm/product/get?id=` + id }) diff --git a/src/api/crm/receivable/index.ts b/src/api/crm/receivable/index.ts index a9812a76..1c184925 100644 --- a/src/api/crm/receivable/index.ts +++ b/src/api/crm/receivable/index.ts @@ -5,15 +5,24 @@ export interface ReceivableVO { no: string planId: number customerId: number + customerName?: string contractId: number + contract?: { + no: string + totalPrice: number + } auditStatus: number processInstanceId: number returnTime: Date returnType: string price: number ownerUserId: number - sort: number + ownerUserName?: string remark: string + creator: string // 创建人 + creatorName?: string // 创建人名称 + createTime: Date // 创建时间 + updateTime: Date // 更新时间 } // 查询回款列表 @@ -50,3 +59,8 @@ export const deleteReceivable = async (id: number) => { export const exportReceivable = async (params) => { return await request.download({ url: `/crm/receivable/export-excel`, params }) } + +// 提交审核 +export const submitReceivable = async (id: number) => { + return await request.put({ url: `/crm/receivable/submit?id=${id}` }) +} diff --git a/src/api/crm/receivable/plan/index.ts b/src/api/crm/receivable/plan/index.ts index 3ddbd7db..ce379beb 100644 --- a/src/api/crm/receivable/plan/index.ts +++ b/src/api/crm/receivable/plan/index.ts @@ -4,18 +4,26 @@ export interface ReceivablePlanVO { id: number period: number receivableId: number - status: number - checkStatus: string - processInstanceId: number price: number returnTime: Date remindDays: number + returnType: number remindTime: Date customerId: number + customerName?: string contractId: number + contractNo?: string ownerUserId: number - sort: number + ownerUserName?: string remark: string + creator: string // 创建人 + creatorName?: string // 创建人名称 + createTime: Date // 创建时间 + updateTime: Date // 更新时间 + receivable?: { + price: number + returnTime: Date + } } // 查询回款计划列表 @@ -33,6 +41,13 @@ export const getReceivablePlan = async (id: number) => { return await request.get({ url: `/crm/receivable-plan/get?id=` + id }) } +// 查询回款计划下拉数据 +export const getReceivablePlanSimpleList = async (customerId: number, contractId: number) => { + return await request.get({ + url: `/crm/receivable-plan/simple-list?customerId=${customerId}&contractId=${contractId}` + }) +} + // 新增回款计划 export const createReceivablePlan = async (data: ReceivablePlanVO) => { return await request.post({ url: `/crm/receivable-plan/create`, data }) diff --git a/src/api/crm/bi/rank.ts b/src/api/crm/statistics/rank.ts similarity index 65% rename from src/api/crm/bi/rank.ts rename to src/api/crm/statistics/rank.ts index 13ceb7ef..a9b355e0 100644 --- a/src/api/crm/bi/rank.ts +++ b/src/api/crm/statistics/rank.ts @@ -1,66 +1,66 @@ import request from '@/config/axios' -export interface BiRankRespVO { +export interface StatisticsRankRespVO { count: number nickname: string deptName: string } // 排行 API -export const RankApi = { +export const StatisticsRankApi = { // 获得合同排行榜 getContractPriceRank: (params: any) => { return request.get({ - url: '/crm/bi-rank/get-contract-price-rank', + url: '/crm/statistics-rank/get-contract-price-rank', params }) }, // 获得回款排行榜 getReceivablePriceRank: (params: any) => { return request.get({ - url: '/crm/bi-rank/get-receivable-price-rank', + url: '/crm/statistics-rank/get-receivable-price-rank', params }) }, // 签约合同排行 getContractCountRank: (params: any) => { return request.get({ - url: '/crm/bi-rank/get-contract-count-rank', + url: '/crm/statistics-rank/get-contract-count-rank', params }) }, // 产品销量排行 getProductSalesRank: (params: any) => { return request.get({ - url: '/crm/bi-rank/get-product-sales-rank', + url: '/crm/statistics-rank/get-product-sales-rank', params }) }, // 新增客户数排行 getCustomerCountRank: (params: any) => { return request.get({ - url: '/crm/bi-rank/get-customer-count-rank', + url: '/crm/statistics-rank/get-customer-count-rank', params }) }, // 新增联系人数排行 getContactsCountRank: (params: any) => { return request.get({ - url: '/crm/bi-rank/get-contacts-count-rank', + url: '/crm/statistics-rank/get-contacts-count-rank', params }) }, // 跟进次数排行 getFollowCountRank: (params: any) => { return request.get({ - url: '/crm/bi-rank/get-follow-count-rank', + url: '/crm/statistics-rank/get-follow-count-rank', params }) }, // 跟进客户数排行 getFollowCustomerCountRank: (params: any) => { return request.get({ - url: '/crm/bi-rank/get-follow-customer-count-rank', + url: '/crm/statistics-rank/get-follow-customer-count-rank', params }) } diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 4f845d0d..f63bee6e 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -104,7 +104,6 @@ const remainingRouter: AppRouteRecordRaw[] = [ } ] }, - { path: '/dict', component: Layout, @@ -518,6 +517,17 @@ const remainingRouter: AppRouteRecordRaw[] = [ }, component: () => import('@/views/crm/customer/detail/index.vue') }, + { + path: 'business/detail/:id', + name: 'CrmBusinessDetail', + meta: { + title: '商机详情', + noCache: true, + hidden: true, + activeMenu: '/crm/business' + }, + component: () => import('@/views/crm/business/detail/index.vue') + }, { path: 'contract/detail/:id', name: 'CrmContractDetail', @@ -529,6 +539,28 @@ const remainingRouter: AppRouteRecordRaw[] = [ }, component: () => import('@/views/crm/contract/detail/index.vue') }, + { + path: 'receivable-plan/detail/:id', + name: 'CrmReceivablePlanDetail', + meta: { + title: '回款计划详情', + noCache: true, + hidden: true, + activeMenu: '/crm/receivable-plan' + }, + component: () => import('@/views/crm/receivable/plan/detail/index.vue') + }, + { + path: 'receivable/detail/:id', + name: 'CrmReceivableDetail', + meta: { + title: '回款详情', + noCache: true, + hidden: true, + activeMenu: '/crm/receivable' + }, + component: () => import('@/views/crm/receivable/detail/index.vue') + }, { path: 'contact/detail/:id', name: 'CrmContactDetail', diff --git a/src/views/bpm/processInstance/detail/index.vue b/src/views/bpm/processInstance/detail/index.vue index ba6c1298..074d1329 100644 --- a/src/views/bpm/processInstance/detail/index.vue +++ b/src/views/bpm/processInstance/detail/index.vue @@ -234,6 +234,7 @@ const getProcessInstance = async () => { fApi.value?.fapi?.disabled(true) }) } else { + // 注意:data.processDefinition.formCustomViewPath 是组件的全路径,例如说:/crm/contract/detail/index.vue BusinessFormComponent.value = registerComponent(data.processDefinition.formCustomViewPath) } diff --git a/src/views/crm/backlog/tables/CheckContract.vue b/src/views/crm/backlog/components/ContractAuditList.vue similarity index 61% rename from src/views/crm/backlog/tables/CheckContract.vue rename to src/views/crm/backlog/components/ContractAuditList.vue index ad4782e0..9c13237c 100644 --- a/src/views/crm/backlog/tables/CheckContract.vue +++ b/src/views/crm/backlog/components/ContractAuditList.vue @@ -30,8 +30,14 @@ - - + + + + - - + + + + - - {{ scope.row.contactName }} + {{ scope.row.signContactName }} - - + + + + + + - + + + + + import { dateFormatter, dateFormatter2 } from '@/utils/formatTime' import * as ContractApi from '@/api/crm/contract' -import { fenToYuanFormat } from '@/utils/formatter' import { DICT_TYPE } from '@/utils/dict' import { AUDIT_STATUS } from './common' +import { erpPriceInputFormatter, erpPriceTableColumnFormatter } from '@/utils' const loading = ref(true) // 列表的加载中 const total = ref(0) // 列表的总页数 @@ -132,7 +184,8 @@ const list = ref([]) // 列表的数据 const queryParams = reactive({ pageNo: 1, pageSize: 10, - auditStatus: 20 + sceneType: 1, // 我负责的 + auditStatus: 10 }) const queryFormRef = ref() // 搜索的表单 @@ -154,8 +207,18 @@ const handleQuery = () => { getList() } +/** 查看审批 */ +const handleProcessDetail = (row: ContractApi.ContractVO) => { + push({ name: 'BpmProcessInstanceDetail', query: { id: row.processInstanceId } }) +} + +/** 打开合同详情 */ +const { push } = useRouter() +const openDetail = (id: number) => { + push({ name: 'CrmContractDetail', params: { id } }) +} + /** 打开客户详情 */ -const { push } = useRouter() // 路由 const openCustomerDetail = (id: number) => { push({ name: 'CrmCustomerDetail', params: { id } }) } @@ -165,6 +228,16 @@ const openContactDetail = (id: number) => { push({ name: 'CrmContactDetail', params: { id } }) } +/** 打开商机详情 */ +const openBusinessDetail = (id: number) => { + push({ name: 'CrmBusinessDetail', params: { id } }) +} + +/** 激活时 */ +onActivated(async () => { + await getList() +}) + /** 初始化 **/ onMounted(() => { getList() diff --git a/src/views/crm/backlog/tables/EndContract.vue b/src/views/crm/backlog/components/ContractRemindList.vue similarity index 62% rename from src/views/crm/backlog/tables/EndContract.vue rename to src/views/crm/backlog/components/ContractRemindList.vue index f31bb524..0cacf359 100644 --- a/src/views/crm/backlog/tables/EndContract.vue +++ b/src/views/crm/backlog/components/ContractRemindList.vue @@ -30,8 +30,14 @@ - - + + + + - - + + + + - - {{ scope.row.contactName }} + {{ scope.row.signContactName }} - - + + + + + + - + + + + + { getList() } +/** 查看审批 */ +const handleProcessDetail = (row: ContractApi.ContractVO) => { + push({ name: 'BpmProcessInstanceDetail', query: { id: row.processInstanceId } }) +} + +/** 打开合同详情 */ +const { push } = useRouter() +const openDetail = (id: number) => { + push({ name: 'CrmContractDetail', params: { id } }) +} + /** 打开客户详情 */ const openCustomerDetail = (id: number) => { push({ name: 'CrmCustomerDetail', params: { id } }) @@ -166,10 +229,18 @@ const openContactDetail = (id: number) => { push({ name: 'CrmContactDetail', params: { id } }) } +/** 打开商机详情 */ +const openBusinessDetail = (id: number) => { + push({ name: 'CrmBusinessDetail', params: { id } }) +} + +/** 激活时 */ +onActivated(async () => { + await getList() +}) + /** 初始化 **/ onMounted(() => { getList() }) - - diff --git a/src/views/crm/backlog/components/CustomerFollowList.vue b/src/views/crm/backlog/components/CustomerFollowList.vue index 8e1017a3..0f367a3f 100644 --- a/src/views/crm/backlog/components/CustomerFollowList.vue +++ b/src/views/crm/backlog/components/CustomerFollowList.vue @@ -130,8 +130,8 @@ const list = ref([]) // 列表的数据 const queryParams = ref({ pageNo: 1, pageSize: 10, - followUpStatus: false, - sceneType: 1 + sceneType: 1, + followUpStatus: false }) const queryFormRef = ref() // 搜索的表单 @@ -158,10 +158,13 @@ const openDetail = (id: number) => { push({ name: 'CrmCustomerDetail', params: { id } }) } +/** 激活时 */ +onActivated(async () => { + await getList() +}) + /** 初始化 **/ onMounted(() => { getList() }) - - diff --git a/src/views/crm/backlog/components/CustomerPutPoolRemindList.vue b/src/views/crm/backlog/components/CustomerPutPoolRemindList.vue index 2f650847..17f8df6b 100644 --- a/src/views/crm/backlog/components/CustomerPutPoolRemindList.vue +++ b/src/views/crm/backlog/components/CustomerPutPoolRemindList.vue @@ -29,32 +29,31 @@ - - + - - - - - - + + + + - + + + + + + - + + + + + + + @@ -90,8 +100,6 @@ prop="createTime" width="180px" /> - - diff --git a/src/views/crm/backlog/components/common.ts b/src/views/crm/backlog/components/common.ts index d18763aa..9ff6bfc3 100644 --- a/src/views/crm/backlog/components/common.ts +++ b/src/views/crm/backlog/components/common.ts @@ -20,8 +20,9 @@ export const CONTACT_STATUS = [ /** 审批状态 */ export const AUDIT_STATUS = [ - { label: '已审批', value: 20 }, - { label: '待审批', value: 10 } + { label: '待审批', value: 10 }, + { label: '审核通过', value: 20 }, + { label: '审核不通过', value: 30 } ] /** 回款提醒类型 */ diff --git a/src/views/crm/backlog/index.vue b/src/views/crm/backlog/index.vue index b1351a2d..b5c3a9a4 100644 --- a/src/views/crm/backlog/index.vue +++ b/src/views/crm/backlog/index.vue @@ -17,9 +17,9 @@ - + - + @@ -33,25 +33,26 @@ import CustomerFollowList from './components/CustomerFollowList.vue' import CustomerTodayContactList from './components/CustomerTodayContactList.vue' import CustomerPutPoolRemindList from './components/CustomerPutPoolRemindList.vue' import ClueFollowList from './components/ClueFollowList.vue' -import CheckContract from './tables/CheckContract.vue' -import CheckReceivables from './tables/CheckReceivables.vue' -import EndContract from './tables/EndContract.vue' +import ContractAuditList from './components/ContractAuditList.vue' +import ContractRemindList from './components/ContractRemindList.vue' import RemindReceivables from './tables/RemindReceivables.vue' +import CheckReceivables from './tables/CheckReceivables.vue' import * as CustomerApi from '@/api/crm/customer' import * as ClueApi from '@/api/crm/clue' +import * as ContractApi from '@/api/crm/contract' defineOptions({ name: 'CrmBacklog' }) const leftMenu = ref('customerTodayContact') -const customerTodayContactCount = ref(0) const clueFollowCount = ref(0) const customerFollowCount = ref(0) const customerPutPoolRemindCount = ref(0) -const checkContractCount = ref(0) +const customerTodayContactCount = ref(0) +const contractAuditCount = ref(0) +const contractRemindCount = ref(0) const checkReceivablesCount = ref(0) const remindReceivablesCount = ref(0) -const endContractCount = ref(0) const leftSides = ref([ { @@ -76,8 +77,8 @@ const leftSides = ref([ }, { name: '待审核合同', - menu: 'checkContract', - count: checkContractCount + menu: 'contractAudit', + count: contractAuditCount }, { name: '待审核回款', @@ -91,8 +92,8 @@ const leftSides = ref([ }, { name: '即将到期的合同', - menu: 'endContract', - count: endContractCount + menu: 'contractRemind', + count: contractRemindCount } ]) @@ -110,10 +111,10 @@ const getCount = () => { ) CustomerApi.getFollowCustomerCount().then((count) => (customerFollowCount.value = count)) ClueApi.getFollowClueCount().then((count) => (clueFollowCount.value = count)) - BacklogApi.getCheckContractCount().then((count) => (checkContractCount.value = count)) + ContractApi.getAuditContractCount().then((count) => (contractAuditCount.value = count)) + ContractApi.getRemindContractCount().then((count) => (contractRemindCount.value = count)) BacklogApi.getCheckReceivablesCount().then((count) => (checkReceivablesCount.value = count)) BacklogApi.getRemindReceivablePlanCount().then((count) => (remindReceivablesCount.value = count)) - BacklogApi.getEndContractCount().then((count) => (endContractCount.value = count)) } /** 激活时 */ diff --git a/src/views/crm/business/BusinessForm.vue b/src/views/crm/business/BusinessForm.vue index 0e63eb75..4c7d253f 100644 --- a/src/views/crm/business/BusinessForm.vue +++ b/src/views/crm/business/BusinessForm.vue @@ -1,113 +1,133 @@ - + @@ -66,8 +71,8 @@ import * as BusinessApi from '@/api/crm/business' import * as ContactApi from '@/api/crm/contact' import BusinessForm from './../BusinessForm.vue' import { BizTypeEnum } from '@/api/crm/permission' -import { fenToYuanFormat } from '@/utils/formatter' import BusinessListModal from './BusinessListModal.vue' +import { erpPriceTableColumnFormatter } from '@/utils' const message = useMessage() // 消息 @@ -76,6 +81,7 @@ const props = defineProps<{ bizType: number // 业务类型 bizId: number // 业务编号 customerId?: number // 关联联系人与商机时,需要传入 customerId 进行筛选 + contactId?: number // 特殊:联系人编号;在【联系人】详情中,可以传递联系人编号,默认新建的商机关联到该联系人 }>() const loading = ref(true) // 列表的加载中 @@ -125,7 +131,7 @@ const handleQuery = () => { /** 添加操作 */ const formRef = ref() const openForm = () => { - formRef.value.open('create') + formRef.value.open('create', null, props.customerId, props.contactId) } /** 打开联系人详情 */ diff --git a/src/views/crm/business/components/BusinessListModal.vue b/src/views/crm/business/components/BusinessListModal.vue index 1abfdc7c..3c21f061 100644 --- a/src/views/crm/business/components/BusinessListModal.vue +++ b/src/views/crm/business/components/BusinessListModal.vue @@ -48,8 +48,8 @@ @@ -75,7 +75,7 @@ diff --git a/src/views/crm/business/detail/BusinessDetailsHeader.vue b/src/views/crm/business/detail/BusinessDetailsHeader.vue new file mode 100644 index 00000000..50d1efea --- /dev/null +++ b/src/views/crm/business/detail/BusinessDetailsHeader.vue @@ -0,0 +1,37 @@ + + diff --git a/src/views/crm/business/detail/BusinessDetailsInfo.vue b/src/views/crm/business/detail/BusinessDetailsInfo.vue new file mode 100644 index 00000000..a2c9ce18 --- /dev/null +++ b/src/views/crm/business/detail/BusinessDetailsInfo.vue @@ -0,0 +1,61 @@ + + diff --git a/src/views/crm/business/detail/BusinessProductList.vue b/src/views/crm/business/detail/BusinessProductList.vue new file mode 100644 index 00000000..9a316659 --- /dev/null +++ b/src/views/crm/business/detail/BusinessProductList.vue @@ -0,0 +1,66 @@ + + diff --git a/src/views/crm/business/detail/index.vue b/src/views/crm/business/detail/index.vue new file mode 100644 index 00000000..6b86a41e --- /dev/null +++ b/src/views/crm/business/detail/index.vue @@ -0,0 +1,146 @@ + + diff --git a/src/views/crm/business/index.vue b/src/views/crm/business/index.vue index c1c63fa1..64445fb7 100644 --- a/src/views/crm/business/index.vue +++ b/src/views/crm/business/index.vue @@ -38,10 +38,37 @@ + + + + + - - - + + + + + + + - - - + + + + + - - - + + + diff --git a/src/views/crm/contact/components/ContactList.vue b/src/views/crm/contact/components/ContactList.vue index b41c5456..83af1e52 100644 --- a/src/views/crm/contact/components/ContactList.vue +++ b/src/views/crm/contact/components/ContactList.vue @@ -5,11 +5,32 @@ 创建联系人 + + 关联 + + + 解除关联 + - + + diff --git a/src/views/crm/contact/detail/ContactDetailsHeader.vue b/src/views/crm/contact/detail/ContactDetailsHeader.vue index 86fb42a5..12fb3bc8 100644 --- a/src/views/crm/contact/detail/ContactDetailsHeader.vue +++ b/src/views/crm/contact/detail/ContactDetailsHeader.vue @@ -16,17 +16,11 @@ - - {{ contact.customerName }} - - - {{ contact.post }} - - - {{ contact.mobile }} - + {{ contact.customerName }} + {{ contact.post }} + {{ contact.mobile }} - {{ contact.createTime ? formatDate(contact.createTime) : '空' }} + {{ formatDate(contact.createTime) }} diff --git a/src/views/crm/contact/detail/ContactDetailsInfo.vue b/src/views/crm/contact/detail/ContactDetailsInfo.vue index c9650d6f..9e8bfff1 100644 --- a/src/views/crm/contact/detail/ContactDetailsInfo.vue +++ b/src/views/crm/contact/detail/ContactDetailsInfo.vue @@ -6,60 +6,49 @@ 基本信息 - - {{ contact.name }} + {{ contact.name }} + {{ contact.customerName }} + {{ contact.mobile }} + {{ contact.telephone }} + {{ contact.email }} + {{ contact.qq }} + {{ contact.wechat }} + + {{ contact.areaName }} {{ contact.detailAddress }} - - {{ contact.customerName }} - - - {{ contact.mobile }} - - - {{ contact.telephone }} - - - {{ contact.email }} - - - {{ contact.qq }} - - - {{ contact.wechat }} - - - {{ contact.nextTime ? formatDate(contact.nextTime) : '空' }} - - - {{ contact.areaName }} - - - {{ contact.detailAddress }} + {{ contact.post }} + {{ contact.parentName }} + + - - {{ contact.remark }} + + {{ formatDate(contact.contactNextTime) }} + {{ contact.remark }} - - - {{ contact.ownerUserName }} + + {{ contact.ownerUserName }} + + {{ contact.contactLastContent }} - - {{ contact.creatorName }} + + {{ formatDate(contact.contactLastTime) }} +   + {{ contact.creatorName }} - {{ contact.createTime ? formatDate(contact.createTime) : '空' }} + {{ formatDate(contact.createTime) }} - {{ contact.updateTime ? formatDate(contact.updateTime) : '空' }} + {{ formatDate(contact.updateTime) }} diff --git a/src/views/crm/contact/detail/index.vue b/src/views/crm/contact/detail/index.vue index aee34166..21967e8c 100644 --- a/src/views/crm/contact/detail/index.vue +++ b/src/views/crm/contact/detail/index.vue @@ -9,6 +9,9 @@ + + + @@ -20,7 +23,7 @@ ref="permissionListRef" :biz-id="contact.id!" :biz-type="BizTypeEnum.CRM_CONTACT" - :show-action="!permissionListRef?.isPool || false" + :show-action="true" @quit-team="close" /> @@ -29,13 +32,14 @@ :biz-id="contact.id!" :biz-type="BizTypeEnum.CRM_CONTACT" :customer-id="contact.customerId" + :contact-id="contact.id" /> - - + + diff --git a/src/views/crm/contact/index.vue b/src/views/crm/contact/index.vue index b4f9150a..7cf5d61f 100644 --- a/src/views/crm/contact/index.vue +++ b/src/views/crm/contact/index.vue @@ -53,15 +53,6 @@ @keyup.enter="handleQuery" /> - - - + + + + +