From e613d864d9d7e1993ac62b70cf998d20e623d95c Mon Sep 17 00:00:00 2001 From: zy Date: Thu, 29 May 2025 15:29:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A1=E6=89=B9=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/contract/index.ts | 5 + src/components/contact/index.vue | 2 +- .../detail/ProcessInstanceOperationButton.vue | 3 +- .../bpm/processInstance/detail/index.vue | 10 +- .../crm/business/components/BusinessList.vue | 11 +- src/views/crm/contract/ContractForm.vue | 6 +- .../crm/contract/components/QuotationList.vue | 3 + .../crm/contract/detail/ContractDetail.vue | 33 ++--- src/views/crm/contract/index.vue | 10 +- .../customercompany/CustomerCompanyForm.vue | 2 +- src/views/crm/quotation/QuotationDetail.vue | 130 ++++++++++++++---- src/views/crm/quotation/QuotationForm.vue | 19 ++- src/views/crm/quotation/index.vue | 2 +- 13 files changed, 169 insertions(+), 67 deletions(-) diff --git a/src/api/crm/contract/index.ts b/src/api/crm/contract/index.ts index 3b64d4ce0..811dd8a78 100644 --- a/src/api/crm/contract/index.ts +++ b/src/api/crm/contract/index.ts @@ -100,6 +100,11 @@ export const updateContract = async (data: ContractVO) => { return await request.put({ url: `/crm/contract/update`, data }) } +// 审批中修改 CRM 合同 +export const updateApplyContract = async (data: ContractVO) => { + return await request.put({ url: `/crm/contract/bpm/update`, data }) +} + // 删除 CRM 合同 export const deleteContract = async (id: number) => { return await request.delete({ url: `/crm/contract/delete?id=` + id }) diff --git a/src/components/contact/index.vue b/src/components/contact/index.vue index a4a753d32..d7389744b 100644 --- a/src/components/contact/index.vue +++ b/src/components/contact/index.vue @@ -39,7 +39,7 @@ - + diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue index 6641e02f1..5099097a4 100644 --- a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue +++ b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue @@ -535,7 +535,7 @@ const router = useRouter() // 路由 const message = useMessage() // 消息弹窗 const userId = useUserStoreWithOut().getUser.id // 当前登录的编号 -const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 +const emit = defineEmits(['success', 'updataData']) // 定义 success 事件,用于操作成功后的回调 const props = defineProps<{ processInstance: any // 流程实例信息 @@ -778,6 +778,7 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) => } if (pass) { + emit('updataData') const nextAssigneesValid = validateNextAssignees() if (!nextAssigneesValid) return const variables = getUpdatedProcessInstanceVariables() diff --git a/src/views/bpm/processInstance/detail/index.vue b/src/views/bpm/processInstance/detail/index.vue index c3f83cf06..2ce742741 100644 --- a/src/views/bpm/processInstance/detail/index.vue +++ b/src/views/bpm/processInstance/detail/index.vue @@ -59,7 +59,7 @@
- +
@@ -120,6 +120,7 @@ :normal-form-api="fApi" :writable-fields="writableFields" @success="refresh" + @updataData="updataData" /> @@ -184,6 +185,13 @@ const getDetail = () => { getProcessModelView() } +const BusinessFormComponentRef = ref('') + +const updataData = () => { + BusinessFormComponentRef.value.submitForm() + console.log('%csrc/views/bpm/processInstance/detail/index.vue:189 BusinessFormComponentRef', 'color: pink;', BusinessFormComponentRef); +} + /** 加载流程实例 */ const BusinessFormComponent = ref(null) // 异步组件 /** 获取审批详情 */ diff --git a/src/views/crm/business/components/BusinessList.vue b/src/views/crm/business/components/BusinessList.vue index 43f9e3f62..fe305c208 100644 --- a/src/views/crm/business/components/BusinessList.vue +++ b/src/views/crm/business/components/BusinessList.vue @@ -45,8 +45,11 @@ :formatter="erpPriceTableColumnFormatter" /> - - + + + { + getList() +}) diff --git a/src/views/crm/contract/ContractForm.vue b/src/views/crm/contract/ContractForm.vue index d07211a1c..733a6c5f2 100644 --- a/src/views/crm/contract/ContractForm.vue +++ b/src/views/crm/contract/ContractForm.vue @@ -378,7 +378,6 @@ type="date" value-format="x" disabled - format="YYYY-MM-DD" placeholder="选择合同结束时间" style="width: 100%" /> @@ -1003,8 +1002,11 @@ const changeTime = ()=> { lastMonth = remainMonth - 12 addYear = addYear + 1 } + let newMonth = lastMonth <= 10 ? ("0" + lastMonth) :lastMonth + let newDay = day <= 10 ? ("0" + day) :day let lastYear = addYear + year - formData.value.endTime = lastYear + '-' + lastMonth + '-' + day + let time = lastYear + '-' + newMonth + '-' + newDay + formData.value.endTime = new Date(time).getTime() } } diff --git a/src/views/crm/contract/components/QuotationList.vue b/src/views/crm/contract/components/QuotationList.vue index 8b95368e5..bb611b5c4 100644 --- a/src/views/crm/contract/components/QuotationList.vue +++ b/src/views/crm/contract/components/QuotationList.vue @@ -158,4 +158,7 @@ const handleDelete = async (id: number) => { onMounted(async () => { getList() }) +onActivated(()=>{ + getList() +}) \ No newline at end of file diff --git a/src/views/crm/contract/detail/ContractDetail.vue b/src/views/crm/contract/detail/ContractDetail.vue index ce3ff89a1..0b77aecd3 100644 --- a/src/views/crm/contract/detail/ContractDetail.vue +++ b/src/views/crm/contract/detail/ContractDetail.vue @@ -916,38 +916,34 @@ const validate = () => { const getData = () => { return formData.value } -defineExpose({ open, validate, getData }) // 提供 open 方法,用于打开弹窗 /** 提交表单 */ const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 const submitForm = async () => { // 校验表单 if (!formRef) return - const valid = await formRef.value.validate() + const valid = await formRef.value.innerFormRef.validate() if (!valid) return // 提交请求 if(contractAAuthorizedCompanyFormRef.value.getData().length) { - const contractAAuthorizedCompanyValid = await contractAAuthorizedCompanyFormRef.value.validate() - if (!contractAAuthorizedCompanyValid) return message.warning('请完善合同甲方关联单位') } else { return message.warning('请完善合同甲方关联单位') } - if(contractAAuthorizedPersonFormRef.value.getData().length) { + if(contractAAuthorizedPersonFormRef.value.getData().length) { const contractAAuthorizedPerson = await contractAAuthorizedPersonFormRef.value.validate() if (!contractAAuthorizedPerson) return message.warning('请完善合同甲方授权人信息') } else { return message.warning('请完善合同甲方授权人信息') } - if(contractBAuthorizedPersonFormRef.value.getData().length) { - const contractBAuthorizedPersonPerson = await contractBAuthorizedPersonFormRef.value.validate() - if (!contractBAuthorizedPersonPerson) return message.warning('请完善合同乙方授权人信息') - } else { - return message.warning('请完善合同乙方授权人信息') - } + // if(contractBAuthorizedPersonFormRef.value.getData().length) { + // const contractBAuthorizedPersonPerson = await contractBAuthorizedPersonFormRef.value.validate() + // if (!contractBAuthorizedPersonPerson) return message.warning('请完善合同乙方授权人信息') + // } else { + // return message.warning('请完善合同乙方授权人信息') + // } - return formLoading.value = true try { @@ -955,22 +951,17 @@ const submitForm = async () => { // 拼接子表的数据 data.contractAAuthorizedCompanys = contractAAuthorizedCompanyFormRef.value.getData() data.contractAAuthorizedPersons = contractAAuthorizedPersonFormRef.value.getData() - data.contractBAuthorizedPersons = contractBAuthorizedPersonFormRef.value.getData() - if (!formType.value ) { - await ContractApi.createContract(data) - message.success(t('common.createSuccess')) - } else { - await ContractApi.updateContract(data) - message.success(t('common.updateSuccess')) - } + // data.contractBAuthorizedPersons = contractBAuthorizedPersonFormRef.value.getData() + await ContractApi.updateApplyContract(data) + message.success(t('common.updateSuccess')) dialogVisible.value = false // 发送操作成功的事件 emit('success') - goBack() } finally { formLoading.value = false } } +defineExpose({ open, validate, getData, submitForm }) // 提供 open 方法,用于打开弹窗 const goBack = ()=> { proxy.$router.go(-1) diff --git a/src/views/crm/contract/index.vue b/src/views/crm/contract/index.vue index 2d8ac84a0..c32badb7e 100644 --- a/src/views/crm/contract/index.vue +++ b/src/views/crm/contract/index.vue @@ -202,7 +202,7 @@ -