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",