From 2183c0f914517a8d9c15a8cae16797b2a27c63eb Mon Sep 17 00:00:00 2001 From: water_xu Date: Fri, 12 Jul 2024 14:21:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E7=AE=A1=E7=90=86=20-=20?= =?UTF-8?q?=E8=A1=8C=E4=B8=9A=E8=B5=84=E8=B4=A8=E5=9B=BE=E7=89=87=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../information/qualifications/components/edit.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/views/corpInfo/information/qualifications/components/edit.vue b/src/views/corpInfo/information/qualifications/components/edit.vue index 8ec6e4c..f17ae67 100644 --- a/src/views/corpInfo/information/qualifications/components/edit.vue +++ b/src/views/corpInfo/information/qualifications/components/edit.vue @@ -86,7 +86,15 @@ export default { NAME: [{ required: true, message: '名称不能为空', trigger: 'blur' }], VALIDITYTIME: [{ required: true, message: '证书有效期不能为空', trigger: 'blur' }], NUMBER: [{ required: true, message: '证书编号不能为空', trigger: 'blur' }], - FILE: [{ required: true, message: '图片不能为空', trigger: 'blur' }] + FILE: [ + { validator: (rule, value, callback) => { + if (this.certificate_files.length > 0) { + callback() + } else { + callback(new Error('图片不能为空')) + } + }, trigger: 'blur' } + ] } } }, @@ -191,6 +199,8 @@ export default { if (!isImage) { this.$message.error('上传图片只能是 JPG、JPEG、PNG 格式!') fileList.pop() + } else { + this.beforeFileUpload(file) } }, handlePictureCardPreview(file) {