From 3650bea744aa624cf7e7cfa74fce6890ba2fba43 Mon Sep 17 00:00:00 2001 From: zhangqi <2794379662@qq.com> Date: Tue, 8 Jun 2021 10:10:41 +0800 Subject: [PATCH] =?UTF-8?q?update:=E6=96=87=E4=BB=B6=E4=B8=8D=E7=AC=A6?= =?UTF-8?q?=E5=90=88=E8=A7=84=E8=8C=83=E4=B8=8D=E4=BC=9A=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=88=B0=E5=88=97=E8=A1=A8=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/CA/UnitApply.vue | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/views/CA/UnitApply.vue b/src/views/CA/UnitApply.vue index e1af035..0a6a09a 100644 --- a/src/views/CA/UnitApply.vue +++ b/src/views/CA/UnitApply.vue @@ -119,7 +119,9 @@ accept="application/pdf" action="/api2/upload/uploadfile" v-model:fileList="loaPicFileList" - :beforeUpload="file => beforeUpload(file, true)" + :beforeUpload=" + (file, fileList) => beforeUpload(file, fileList, true) + " @change="info => handleChange(info, 'loaPicId')" :disabled="disabledUpload" > @@ -255,7 +257,11 @@ - 查询 提交 @@ -530,8 +536,10 @@ export default { 1; } }; + const loading = ref(false); const onSubmit = async e => { e.preventDefault(); + loading.value = true; if (progressingId.value == 0) { if (modelRef.orderNo) { await modifyUnitApply(); @@ -548,21 +556,26 @@ export default { await queryUnitApply(progressingId.value); } } + loading.value = false; }; - const beforeUpload = (file, isPdf) => { - console.log(file, isPdf); + const beforeUpload = (file, fileList, isPdf) => { + console.log(file, fileList, isPdf); const isValid = isPdf === true ? file.type === "application/pdf" : file.type === "image/jpeg" || file.type === "image/png"; if (!isValid) { message.error("只能上传受支持格式的文件"); + fileList.pop(); + return false; } const isLt2M = file.size / 1024 / 1024 < 2; if (!isLt2M) { message.error("文件大小超过2MB!"); + fileList.pop(); + return false; } - return isValid && isLt2M; + return true; }; const handleChange2 = (info, v) => { console.log(info.file.status, info.file, info.fileList); @@ -784,6 +797,7 @@ export default { router: useRouter(), progressingId, addSealApply, + loading, status: { 0: { color: "orange",