From fdbcc559d884e619c7f13fcc92f81f2d29bf7d41 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 23 Feb 2024 00:20:14 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20CRM=EF=BC=9A=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E5=90=88=E5=90=8C=E7=9A=84=E6=96=B0=E5=A2=9E=E3=80=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 3bfdb2df3301147d919e359ba11ab8883014a3a3) --- src/views/crm/contract/ContractForm.vue | 36 ++++++++++++++++++++----- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/src/views/crm/contract/ContractForm.vue b/src/views/crm/contract/ContractForm.vue index e962d525..3dac598c 100644 --- a/src/views/crm/contract/ContractForm.vue +++ b/src/views/crm/contract/ContractForm.vue @@ -38,7 +38,12 @@ - + - + { formRef.value?.resetFields() } -// TODO 芋艿:切换客户时,需要 reset 关联的几个字段 -// TODO 芋艿:选择商机时,需要自动设置 +/** 处理切换客户 */ +const handleCustomerChange = () => { + formData.value.businessId = undefined + formData.value.signContactId = undefined + formData.value.products = [] +} + +/** 处理商机变化 */ +const handleBusinessChange = async (businessId: number) => { + const business = await BusinessApi.getBusiness(businessId) + business.products.forEach((item) => { + item.contractPrice = item.businessPrice + }) + formData.value.products = business.products +} /** 动态获取客户联系人 */ const getContactOptions = computed(() => - contactList.value.filter((item) => item.customerId === formData.value.customerId) + contactList.value.filter((item) => item.customerId == formData.value.customerId) ) /** 动态获取商机 */ const getBusinessOptions = computed(() => - businessList.value.filter((item) => item.customerId === formData.value.customerId) + businessList.value.filter((item) => item.customerId == formData.value.customerId) )