From 8ec57f041d766bce608cd55f20c14b151371f547 Mon Sep 17 00:00:00 2001 From: wersd <1523826083@qq.com> Date: Sun, 22 Jun 2025 21:30:16 +0800 Subject: [PATCH] =?UTF-8?q?crm=20=E6=B7=BB=E5=8A=A0=E5=90=88=E5=90=8C?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=20=E6=B7=BB=E5=8A=A0=E5=90=88=E5=90=8C?= =?UTF-8?q?=E7=8A=B6=E6=80=81=20=E5=AE=A2=E6=88=B7=E7=AD=BE=E7=BA=A6?= =?UTF-8?q?=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/contact/index.ts | 7 +- src/api/crm/contract/index.ts | 11 +- src/utils/dict.ts | 4 + src/views/crm/contract/ContractForm.vue | 135 ++++++++++++------ .../contract/detail/ContractDetailsHeader.vue | 42 +++++- src/views/crm/contract/detail/index.vue | 10 +- src/views/crm/contract/index.vue | 114 ++++----------- .../crm/followup/components/FollowUpList.vue | 1 - 8 files changed, 169 insertions(+), 155 deletions(-) diff --git a/src/api/crm/contact/index.ts b/src/api/crm/contact/index.ts index 7c24dfa97..a53cf3c8e 100644 --- a/src/api/crm/contact/index.ts +++ b/src/api/crm/contact/index.ts @@ -4,8 +4,11 @@ import { TransferReqVO } from '@/api/crm/permission' export interface ContactVO { id: number // 编号 name: string // 联系人名称 - customerId: number // 客户编号 - customerName?: string // 客户名称 + customerId: number[] // 客户编号 + customer?: { + id: number // 客户编号 + name: string // 客户名称 + } contactLastTime: Date // 最后跟进时间 contactLastContent: string // 最后跟进内容 contactNextTime: Date // 下次联系时间 diff --git a/src/api/crm/contract/index.ts b/src/api/crm/contract/index.ts index 7028b774a..3d64c4256 100644 --- a/src/api/crm/contract/index.ts +++ b/src/api/crm/contract/index.ts @@ -5,8 +5,12 @@ export interface ContractVO { id: number name: string no: string - customerId: number - customerName?: string + customerId: number[] + customer?:{ + id: number + name: string + } + businessId: number businessName: string contactLastTime: Date @@ -14,6 +18,9 @@ export interface ContractVO { ownerUserName?: string ownerUserDeptName?: string processInstanceId: number + contractStatus: number + contractType: number + contractAttribute: number auditStatus: number orderDate: Date startTime: Date diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 02ee1ddb4..03ee71489 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -214,6 +214,10 @@ export enum DICT_TYPE { CRM_FOLLOW_UP_TYPE = 'crm_follow_up_type', // CRM 跟进方式 CRM_STATION_SITE_STATUS = 'crm_station_site_status', // CRM 场地状态 CRM_STATION_SITE_TYPE = 'crm_station_site_type', // CRM 场地类型 + CRM_CONTRACT_TYPE = 'crm_contract_type', // CRM 合同类型 + CRM_CONTRACT_STATUS = 'crm_contract_status', // CRM 合同状态 + CRM_CONTRACT_ATTRIBUTE = 'crm_contract_attribute', // CRM 合同属性 + // ========== ERP - 企业资源计划模块 ========== ERP_AUDIT_STATUS = 'erp_audit_status', // ERP 审批状态 diff --git a/src/views/crm/contract/ContractForm.vue b/src/views/crm/contract/ContractForm.vue index de1f52d24..e63fcb4cf 100644 --- a/src/views/crm/contract/ContractForm.vue +++ b/src/views/crm/contract/ContractForm.vue @@ -8,10 +8,46 @@ label-width="120px" > - + + + + + + + + + + + + + + @@ -37,29 +73,49 @@ - - + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - + @@ -185,6 +214,8 @@ import * as BusinessApi from '@/api/crm/business' import { erpPriceMultiply, erpPriceInputFormatter } from '@/utils' import { useUserStore } from '@/store/modules/user' import ContractProductForm from '@/views/crm/contract/components/ContractProductForm.vue' +import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' +import * as DeptApi from '@/api/system/dept' const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 @@ -197,7 +228,10 @@ const formData = ref({ id: undefined, no: undefined, name: undefined, - customerId: undefined, + customerId: [], + contractStatus: undefined, + contractType: undefined, + contractAttribute: undefined, businessId: undefined, orderDate: undefined, startTime: undefined, @@ -205,6 +239,7 @@ const formData = ref({ signUserId: undefined, signContactId: undefined, ownerUserId: undefined, + deptId: undefined, discountPercent: 0, totalProductPrice: undefined, remark: undefined, @@ -214,13 +249,17 @@ const formRules = reactive({ name: [{ required: true, message: '合同名称不能为空', trigger: 'blur' }], customerId: [{ required: true, message: '客户不能为空', trigger: 'blur' }], orderDate: [{ required: true, message: '下单日期不能为空', trigger: 'blur' }], - ownerUserId: [{ required: true, message: '负责人不能为空', trigger: 'blur' }] + ownerUserId: [{ required: true, message: '负责人不能为空', trigger: 'blur' }], + contractStatus: [{ required: true, message: '合同状态不能为空', trigger: 'blur' }], + contractType: [{ required: true, message: '合同类型不能为空', trigger: 'blur' }], + contractAttribute: [{ required: true, message: '合同属性不能为空', trigger: 'blur' }] }) const formRef = ref() // 表单 Ref const userOptions = ref([]) // 用户列表 const customerList = ref([]) // 客户列表的数据 const businessList = ref([]) const contactList = ref([]) +const deptList = ref([]) /** 子表的表单 */ const subTabsName = ref('product') @@ -271,6 +310,8 @@ const open = async (type: string, id?: number) => { } // 获取联系人 contactList.value = await ContactApi.getSimpleContactList() + // 加载部门列表 + deptList.value = await DeptApi.getSimpleDeptList() } defineExpose({ open }) // 提供 open 方法,用于打开弹窗 @@ -307,7 +348,10 @@ const resetForm = () => { id: undefined, no: undefined, name: undefined, - customerId: undefined, + customerId: [], + contractStatus: undefined, + contractType: undefined, + contractAttribute: undefined, businessId: undefined, orderDate: undefined, startTime: undefined, @@ -315,6 +359,7 @@ const resetForm = () => { signUserId: undefined, signContactId: undefined, ownerUserId: undefined, + deptId: undefined, discountPercent: 0, totalProductPrice: undefined, remark: undefined, diff --git a/src/views/crm/contract/detail/ContractDetailsHeader.vue b/src/views/crm/contract/detail/ContractDetailsHeader.vue index 784d79397..b5e022eb6 100644 --- a/src/views/crm/contract/detail/ContractDetailsHeader.vue +++ b/src/views/crm/contract/detail/ContractDetailsHeader.vue @@ -16,21 +16,48 @@ - - - {{ contract.customerName }} + + + {{ contract.name }} + +
+ + +
+
+ + {{ contract.ownerUserName }} {{ erpPriceInputFormatter(contract.totalPrice) }} - - {{ formatDate(contract.orderDate) }} + + {{ formatDate(contract.orderDate, 'YYYY-MM-DD') }} + + + {{ formatDate(contract.startTime, 'YYYY-MM-DD') }} + + + {{ formatDate(contract.endTime, 'YYYY-MM-DD') }} + + + + + + {{ erpPriceInputFormatter(contract.totalPrice) }} {{ erpPriceInputFormatter(contract.totalReceivablePrice) }} - - {{ contract.ownerUserName }} + + {{ contract.remark }}
@@ -38,6 +65,7 @@