From bb2f84a6304fa398ecbf4900206f0171aeec9132 Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Sat, 2 Sep 2023 18:34:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/contract/contractDetil.vue | 35 +++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/src/views/contract/contractDetil.vue b/src/views/contract/contractDetil.vue index d8dd0b9..c2f3af0 100644 --- a/src/views/contract/contractDetil.vue +++ b/src/views/contract/contractDetil.vue @@ -380,16 +380,21 @@ - + {{ formData.file ? "重新上传" : "上传" @@ -403,10 +408,10 @@ >合同已上传,点击查看 - + 确定 - + { + if (e?.name?.substring(e.name.length - 4, e.name.length) != ".pdf") { + ElMessage.error("仅支持上传.pdf文件"); + return false; + } + return true; +}; + +const upload = ref(null); +const handleExceed = (files: any) => { + upload.value!.clearFiles(); + const file = files[0] as UploadRawFile; + file.uid = genFileId(); + upload.value!.handleStart(file); + upload.value!.submit(); +}; + const handleAvatarSuccess_four: UploadProps["onSuccess"] = ( response, uploadFile