From 79126ca91aba3b49c3cc8a697b2172877587b591 Mon Sep 17 00:00:00 2001 From: zy Date: Thu, 1 May 2025 20:18:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=90=8C=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/contact/index.vue | 158 +++++++++++++ src/views/crm/contract/ContractChange.vue | 70 ++++-- .../ContractAAuthorizedPersonForm.vue | 61 +++-- .../ContractBAuthorizedPersonForm.vue | 9 +- src/views/crm/quotation/QuotationDetail.vue | 221 +++++++++++------- .../components/QuotationProductDetail.vue | 19 +- .../components/QuotationProductForm.vue | 1 - src/views/crm/quotation/index.vue | 2 +- 8 files changed, 416 insertions(+), 125 deletions(-) create mode 100644 src/components/contact/index.vue diff --git a/src/components/contact/index.vue b/src/components/contact/index.vue new file mode 100644 index 000000000..d76ed6536 --- /dev/null +++ b/src/components/contact/index.vue @@ -0,0 +1,158 @@ + + + diff --git a/src/views/crm/contract/ContractChange.vue b/src/views/crm/contract/ContractChange.vue index 9b2f1f0aa..587c67c42 100644 --- a/src/views/crm/contract/ContractChange.vue +++ b/src/views/crm/contract/ContractChange.vue @@ -72,7 +72,7 @@ - + 额度 授权人 延期 @@ -87,12 +87,12 @@ -
+
甲方现授权人信息 @@ -103,12 +103,12 @@ 甲方授权人 - +
- - - - + + + +
@@ -132,6 +132,7 @@ import ContracExtension from '@/views/crm/contract/components/ContractExtension. import ContractStop from '@/views/crm/contract/components/ContracStop.vue' import ContractProductForm from '@/views/crm/contract/components/ContractProductForm.vue' import ContractAAuthorizedCompanyForm from './components/ContractAAuthorizedCompanyForm.vue' +import ContractBAuthorizedPersonForm from './components/ContractAAuthorizedPersonForm.vue' import ContractForm from './ContractForm.vue' const { t } = useI18n() // 国际化 @@ -179,7 +180,7 @@ const formData = ref({ partnerCompanyId: undefined, deptId: undefined, quotationTimes: undefined, - radio: 1, + changeItem: 1, products: [] }) const formRules = reactive({ @@ -196,7 +197,7 @@ const contactList = ref([]) /** 子表的表单 */ const subTabsName = ref('limit') -const contractAAuthorizedCompanyFormRef = ref() +const ContractBAuthorizedPersonFormRef = ref() const contractAAuthorizedCompanyFormRef1 = ref() const limitFormRef = ref() const contractExtensionFormRef = ref() @@ -246,6 +247,16 @@ const submitForm = async () => { // const Authalid1 = await contractAAuthorizedCompanyFormRef1.value.validate() // if (!Authalid1) return +if(ContractBAuthorizedPersonFormRef.value) { + const Authalid = await ContractBAuthorizedPersonFormRef.value.validate() + if (!Authalid) return +} + +if(contractAAuthorizedCompanyFormRef1.value) { + const Authalid1 = await contractAAuthorizedCompanyFormRef1.value.validate() + if (!Authalid1) return +} + if(limitFormRef.value) { const limitValid = await limitFormRef.value.validate() if (!limitValid) return @@ -253,9 +264,20 @@ if(limitFormRef.value) { if(contractExtensionFormRef.value) { const extensionValid = await contractExtensionFormRef.value.validate() - console.log('%csrc/views/crm/contrxact/ContractChange.vue:247 123', 'color: #007acc;', extensionValid,123); if (!extensionValid) return +} + +if(contractStopFormRef.value) { + const stopValid = await contractStopFormRef.value.validate() + if (!stopValid) return + +} + +if(contractFormRef.value) { + const contractValid = await contractFormRef.value.validate() + if (!contractValid) return + } @@ -266,18 +288,30 @@ if(contractExtensionFormRef.value) { // if (!contractValid) return - return // 提交请求 formLoading.value = true try { const data = unref(JSON.parse(JSON.stringify(formData.value))) as unknown as ContractApi.ContractVO // 拼接子表的数据 - data.contractAAuthorizedCompanys = limitFormRef.value.getData() - data.contractAAuthorizedCompanys = contractExtensionFormRef.value.getData() - data.contractAAuthorizedCompanys = contractStopFormRef.value.getData() - data.contractAAuthorizedCompanys = contractFormRef.value.getData() - data.contractAAuthorizedCompanys = contractAAuthorizedCompanyFormRef.value.getData() + let proChangeObj = { + 1: limitFormRef, + 2: ContractBAuthorizedPersonFormRef, + 3: contractExtensionFormRef, + 4: contractStopFormRef, + 5: contractAAuthorizedCompanyFormRef1, + 6: contractFormRef + } + let dataFormList = proChangeObj[formData.value.changeItem].value.getData() + data[proChangeObj[formData.value.changeItem]] = dataFormList + if(formData.value.changeItem == 2) { + let ids = [] + dataFormList.map(item => { + ids.push(item.id) + }) + data.afterAuthorizerId = ids.join(',') + } + // data.contractAAuthorizedCompanys = limitFormRef.value.getData() data.contractId = data.id delete data.id await ContractApi.changeContract(data) @@ -334,7 +368,7 @@ const resetForm = () => { partnerCompanyId: undefined, deptId: undefined, quotationTimes: undefined, - radio: 1, + changeItem: 1, products: [] } formRef.value?.resetFields() diff --git a/src/views/crm/contract/components/ContractAAuthorizedPersonForm.vue b/src/views/crm/contract/components/ContractAAuthorizedPersonForm.vue index 9b6563f4e..e281de4b1 100644 --- a/src/views/crm/contract/components/ContractAAuthorizedPersonForm.vue +++ b/src/views/crm/contract/components/ContractAAuthorizedPersonForm.vue @@ -75,14 +75,18 @@ + 添加 + + \ No newline at end of file diff --git a/src/views/crm/quotation/components/QuotationProductDetail.vue b/src/views/crm/quotation/components/QuotationProductDetail.vue index a5e105cfe..821a0ae34 100644 --- a/src/views/crm/quotation/components/QuotationProductDetail.vue +++ b/src/views/crm/quotation/components/QuotationProductDetail.vue @@ -103,7 +103,9 @@ import * as BusinessApi from '@/api/crm/business' const props = defineProps<{ quotationId: undefined, // 报价编号(主表的关联字段) businessId: undefined, - billTemplateId: undefined + billTemplateId: undefined, + products: undefined + }>() const formLoading = ref(false) // 表单的加载中 const formData = ref([]) @@ -141,7 +143,6 @@ watch( formLoading.value = false } }, - { immediate: true } ) watch( @@ -169,8 +170,20 @@ watch( formLoading.value = false } }, - { immediate: true } ) +watch( + () => props.products, + (val) => { + if (!val || val.length === 0) { + return; + } + nextTick(() => { + formData.value = val + }) + }, + { immediate: true } + +); /** 新增按钮操作 */ const handleAdd = () => { diff --git a/src/views/crm/quotation/components/QuotationProductForm.vue b/src/views/crm/quotation/components/QuotationProductForm.vue index 97fdb40e7..076e21e63 100644 --- a/src/views/crm/quotation/components/QuotationProductForm.vue +++ b/src/views/crm/quotation/components/QuotationProductForm.vue @@ -213,7 +213,6 @@ watch( } try { formLoading.value = true - console.log('%csrc/views/crm/quotation/components/QuotationProductForm.vue:214 1111', 'color: #007acc;', 1111); // if(val.quotationId) { // formData.value = await QuotationApi.getQuotationProductListByQuotationId(val.quotationId) // } else if(val.businessId) { diff --git a/src/views/crm/quotation/index.vue b/src/views/crm/quotation/index.vue index b84e09d18..a94f5f756 100644 --- a/src/views/crm/quotation/index.vue +++ b/src/views/crm/quotation/index.vue @@ -265,7 +265,7 @@ const handleQuery = () => { } const openDetail = (id: number) => { - push({ name: 'QuotationDetail', params: { id } }) + router.push({ name: 'QuotationDetail', query: { id: id } }) } /** 重置按钮操作 */