From aed2bc38ec622d13aa1397eb1dc0663095a4eb03 Mon Sep 17 00:00:00 2001 From: quu Date: Thu, 1 May 2025 22:37:04 +0900 Subject: [PATCH] =?UTF-8?q?crm=20=E6=8A=A5=E4=BB=B7=20=E5=95=86=E6=9C=BA?= =?UTF-8?q?=20=E5=90=88=E5=90=8C=20=E4=B8=89=E5=9D=97=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/crm/contract/ContractChange.vue | 6 ++--- .../crm/contract/components/ContracStop.vue | 4 +--- .../ContractAAuthorizedCompanyForm.vue | 23 +++++-------------- .../components/ContractAuthPersonInfo.vue | 1 - .../components/ContractChangeLimit.vue | 18 +++++++++++---- .../contract/components/ContractExtension.vue | 20 +++++++++++++--- 6 files changed, 41 insertions(+), 31 deletions(-) diff --git a/src/views/crm/contract/ContractChange.vue b/src/views/crm/contract/ContractChange.vue index 2d011e541..533ffadba 100644 --- a/src/views/crm/contract/ContractChange.vue +++ b/src/views/crm/contract/ContractChange.vue @@ -89,7 +89,7 @@
@@ -105,9 +105,9 @@
- + - + diff --git a/src/views/crm/contract/components/ContracStop.vue b/src/views/crm/contract/components/ContracStop.vue index e75dff85e..f14aadb6d 100644 --- a/src/views/crm/contract/components/ContracStop.vue +++ b/src/views/crm/contract/components/ContracStop.vue @@ -65,9 +65,7 @@ const businessList = ref([]) const deptTree = ref() // 部门树形结构 const deptList = ref() // 部门 const orgList = ref([]) -const props = defineProps({ - type: propTypes.string.def('') -}) + const invoiceTemplateList = ref([]) const { proxy }: any = getCurrentInstance(); diff --git a/src/views/crm/contract/components/ContractAAuthorizedCompanyForm.vue b/src/views/crm/contract/components/ContractAAuthorizedCompanyForm.vue index 7cabda68c..9fa4833ab 100644 --- a/src/views/crm/contract/components/ContractAAuthorizedCompanyForm.vue +++ b/src/views/crm/contract/components/ContractAAuthorizedCompanyForm.vue @@ -76,11 +76,6 @@ import * as ContractApi from '@/api/crm/contract' import { propTypes } from '@/utils/propTypes' import ContactForm from '@/components/contact/index.vue' -const props = defineProps({ - contractId: undefined, // 合同ID(主表的关联字段) - type: propTypes.string.def('') - -}) const formLoading = ref(false) // 表单的加载中 const formData = ref([]) const formRules = reactive({ @@ -124,27 +119,21 @@ const getList = (val: []) => { } +const props = defineProps<{ + data: undefined +}>() /** 监听主表的关联字段的变化,加载对应的子表数据 */ watch( - () => props.contractId, + () => props.data, async (val) => { // 1. 重置表单 - formData.value = [] - // 2. val 非空,则加载数据 - if (!val) { - return; - } - try { - formLoading.value = true - formData.value = await ContractApi.getContractAAuthorizedCompanyListByContractId(val) - } finally { - formLoading.value = false - } + formData.value = val }, { immediate: true } ) + /** 删除按钮操作 */ const handleDelete = (index) => { formData.value.splice(index, 1) diff --git a/src/views/crm/contract/components/ContractAuthPersonInfo.vue b/src/views/crm/contract/components/ContractAuthPersonInfo.vue index 94e8248bc..5e5435284 100644 --- a/src/views/crm/contract/components/ContractAuthPersonInfo.vue +++ b/src/views/crm/contract/components/ContractAuthPersonInfo.vue @@ -32,7 +32,6 @@ watch( async (val) => { // 1. 重置表单 formData.value = val - }, { immediate: true } ) diff --git a/src/views/crm/contract/components/ContractChangeLimit.vue b/src/views/crm/contract/components/ContractChangeLimit.vue index 19b2eca0e..c59d606c9 100644 --- a/src/views/crm/contract/components/ContractChangeLimit.vue +++ b/src/views/crm/contract/components/ContractChangeLimit.vue @@ -127,7 +127,7 @@ - + () + +watch( + () => props.data, + async (val) => { + // 1. 重置表单 + formData.value = val + + }, + { immediate: true } +) const onChangeAmount = async (amount: number) => { formData.value.afterAmount = Number(formData.value.creditLimit) + Number(amount); diff --git a/src/views/crm/contract/components/ContractExtension.vue b/src/views/crm/contract/components/ContractExtension.vue index 9575733bb..a1418bb6b 100644 --- a/src/views/crm/contract/components/ContractExtension.vue +++ b/src/views/crm/contract/components/ContractExtension.vue @@ -182,9 +182,8 @@ const businessList = ref([]) const deptTree = ref() // 部门树形结构 const deptList = ref() // 部门 const orgList = ref([]) -const props = defineProps({ - type: propTypes.string.def('') -}) + + const invoiceTemplateList = ref([]) const { proxy }: any = getCurrentInstance(); @@ -252,6 +251,21 @@ const formRef = ref() // 表单 Ref const subTabsName = ref('quotationProduct') const quotationProductFormRef = ref() +const props = defineProps<{ + data: undefined +}>() + +/** 监听主表的关联字段的变化,加载对应的子表数据 */ +watch( + () => props.data, + async (val) => { + // 1. 重置表单 + formData.value = val + }, + { immediate: true } +) + + const onBusinessChange = async (businessId: string) => { if (!businessId) return try {