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 {