From 2e900229d329f9eca9b774f43730659ac03722e9 Mon Sep 17 00:00:00 2001 From: yinq Date: Wed, 22 Oct 2025 17:16:01 +0800 Subject: [PATCH] =?UTF-8?q?1.0.17=20=E5=90=88=E5=90=8C=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E7=BB=88=E7=89=88=E5=90=88=E5=90=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/oa/erp/contractInfo/index.vue | 108 ++++++------------------ 1 file changed, 28 insertions(+), 80 deletions(-) diff --git a/src/views/oa/erp/contractInfo/index.vue b/src/views/oa/erp/contractInfo/index.vue index 558b387..701fcc9 100644 --- a/src/views/oa/erp/contractInfo/index.vue +++ b/src/views/oa/erp/contractInfo/index.vue @@ -132,8 +132,15 @@ @@ -159,23 +166,25 @@ - - - - - - - - - + + + + + + - @@ -192,11 +201,8 @@ - - - @@ -205,6 +211,7 @@ import { listContractInfo, delContractInfo } from '@/api/oa/erp/contractInfo'; import { ContractInfoVO, ContractInfoQuery } from '@/api/oa/erp/contractInfo/types'; import { updateContractInfo } from '@/api/oa/erp/contractInfo'; import download from '@/plugins/download'; +import ApprovalRecord from '@/components/Process/approvalRecord.vue'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; const route = useRoute(); @@ -213,6 +220,7 @@ const { contract_category, business_direction, active_flag, contract_flag, contr proxy?.useDict('contract_category', 'business_direction', 'active_flag', 'contract_flag', 'contract_type', 'contract_status') ); +const approvalRecordRef = ref>(); const contractInfoList = ref([]); const loading = ref(true); const showSearch = ref(true); @@ -336,7 +344,9 @@ const handleAdd = () => { proxy.$tab.closePage(route); router.push({ path: '/contract/contractInfo/edit', - query: {} + query: { + type: 'add' + } }); }; @@ -346,7 +356,8 @@ const handleUpdate = (row?: ContractInfoVO) => { router.push({ path: '/contract/contractInfo/edit', query: { - id: _contractId + id: _contractId, + type: 'update' } }); }; @@ -405,71 +416,8 @@ const downloadFinalContract = (ossId: string | number) => { download.oss(ossId); }; -// 提交审批 -const handleSubmitApproval = async (row: ContractInfoVO) => { - try { - // 添加确认弹框 - await proxy?.$modal.confirm('确认提交该合同进行审批?'); - - // 启动审批流程 - const submitFormData: StartProcessBo = { - businessId: row.contractId.toString(), - flowCode: 'OAC', // 使用现有的流程定义,后续可以创建专门的合同审批流程 - variables: { - // 合同相关的流程变量 - contractId: row.contractId, - contractName: row.contractName, - totalPrice: row.totalPrice - }, - bizExt: { - businessTitle: '合同审批', - businessCode: row.contractId - } - }; - - // 设置任务变量 - taskVariables.value = { - contractId: row.contractId, - contractName: row.contractName, - totalPrice: row.totalPrice, - contractCode: row.contractCode - }; - - // 启动流程并获取任务ID - const resp = await startWorkFlow(submitFormData); - - // 更新合同状态为审批中 - await updateContractInfo({ - contractId: row.contractId, - contractStatus: '2', - flowStatus: 'waiting' - } as any); - - // 自动打开审批对话框,调用第一个审批节点 - if (submitVerifyRef.value && resp.data && resp.data.taskId) { - submitVerifyRef.value.openDialog(resp.data.taskId); - } else { - proxy?.$modal.msgSuccess('审批流程已启动'); - await getList(); - } - } catch (error) { - // 用户取消操作时不显示错误 - if (error === 'cancel') { - return; - } - console.error('提交审批失败:', error); - proxy?.$modal.msgError('提交审批失败,请重试'); - } -}; - // 查看审批记录 const handleApprovalRecord = (row: ContractInfoVO) => { approvalRecordRef.value?.init(row.contractId); }; - -// 审批提交回调 -const submitCallback = async () => { - proxy?.$modal.msgSuccess('审批操作成功'); - await getList(); -};