From 92444bf5fb6ae0f65cf15c47d293ebc82b26989a Mon Sep 17 00:00:00 2001 From: yinq Date: Wed, 25 Feb 2026 17:11:53 +0800 Subject: [PATCH] =?UTF-8?q?1.0.69=20=E4=B8=8A=E4=BC=A0=E7=BB=88=E7=89=88?= =?UTF-8?q?=E5=90=88=E5=90=8C=E6=94=B9=E4=B8=BA=E5=90=88=E5=90=8C=E6=BF=80?= =?UTF-8?q?=E6=B4=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/oa/erp/contractInfo/index.vue | 68 +++++++++++++++++++++---- 1 file changed, 59 insertions(+), 9 deletions(-) diff --git a/src/views/oa/erp/contractInfo/index.vue b/src/views/oa/erp/contractInfo/index.vue index 5615eaf..e96b409 100644 --- a/src/views/oa/erp/contractInfo/index.vue +++ b/src/views/oa/erp/contractInfo/index.vue @@ -201,7 +201,7 @@ - + - - - + + + + + + + + @@ -281,6 +287,7 @@ import { ContractInfoVO, ContractInfoQuery } from '@/api/oa/erp/contractInfo/typ import { updateContractInfo } from '@/api/oa/erp/contractInfo'; import download from '@/plugins/download'; import ApprovalRecord from '@/components/Process/approvalRecord.vue'; +import { allListDept } from '@/api/system/dept'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; const route = useRoute(); @@ -389,6 +396,8 @@ const uploadDialog = reactive({ loading: false, form: { contractId: undefined as any, + contractDeptId: undefined as any, + contractStatus: undefined as any, oss: undefined as any } }); @@ -408,6 +417,33 @@ const maintainDialog = reactive({ } }); const maintainFormRef = ref(); +const uploadFormRef = ref(); + +// 合同激活表单校验规则 +const uploadFormRules = { + contractDeptId: [{ required: true, message: '请选择部门', trigger: 'change' }], + oss: [ + { + required: true, + validator: (_rule: any, value: any, callback: (err?: Error) => void) => { + if (value === undefined || value === null || value === '' || (Array.isArray(value) && value.length === 0)) { + callback(new Error('请上传签字合同附件')); + } else { + callback(); + } + }, + trigger: 'change' + } + ] +}; + +/** 查询部门信息下拉框结构 */ +const deptInfoList = ref([]); +const getDeptInfoListSelect = async () => { + const params = { deptCategory: '03' } as any; + const res = await allListDept(params); + deptInfoList.value = res.data; +}; /** 查询合同信息列表 */ const getList = async () => { @@ -497,6 +533,7 @@ const handleExport = () => { onMounted(() => { getList(); + getDeptInfoListSelect(); }); // 打开上传终版合同对话框 @@ -504,8 +541,11 @@ const openUploadFinalDialog = (row?: ContractInfoVO) => { const contractId = row?.contractId || ids.value[0]; if (!contractId) return; uploadDialog.form.contractId = contractId; + uploadDialog.form.contractDeptId = undefined as any; uploadDialog.form.oss = undefined as any; + uploadDialog.form.contractStatus = '5'; uploadDialog.visible = true; + nextTick(() => uploadFormRef.value?.clearValidate()); }; const openMaintainDialog = () => { @@ -549,13 +589,23 @@ const submitMaintain = async () => { // 确认上传,保存签字合同附件 const confirmUploadFinal = async () => { + try { + await uploadFormRef.value?.validate(); + } catch { + return; + } + const { contractId, contractDeptId, oss, contractStatus } = uploadDialog.form; + const ossStr = oss as unknown as string | string[]; + const finalOss = Array.isArray(ossStr) ? (ossStr[0] ?? '') : (ossStr ?? ''); uploadDialog.loading = true; try { - // 仅取单个附件 id - const ossStr = uploadDialog.form.oss as unknown as string; - const firstOssId = ossStr ? Number(String(ossStr).split(',')[0]) : undefined; - await updateContractInfo({ contractId: uploadDialog.form.contractId, signatureAppendix: ossStr } as any); - proxy?.$modal.msgSuccess('终版合同已上传'); + await updateContractInfo({ + contractId, + contractDeptId, + contractStatus, + signatureAppendix: finalOss + } as any); + proxy?.$modal.msgSuccess('合同已激活!'); uploadDialog.visible = false; await getList(); } finally {