From 87bea556df452a4f44ddb4e56dd3bf6b676cce11 Mon Sep 17 00:00:00 2001 From: zouyu <2723363702@qq.com> Date: 星期一, 20 十一月 2023 14:51:59 +0800 Subject: [PATCH] modified: src/views/product/workbench/operation-task-pane.vue modified: src/views/quality/exception/exception.vue --- src/views/quality/exception/exception.vue | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/views/quality/exception/exception.vue b/src/views/quality/exception/exception.vue index 1179697..9f502eb 100644 --- a/src/views/quality/exception/exception.vue +++ b/src/views/quality/exception/exception.vue @@ -31,8 +31,8 @@ action="/mes/exception/upload" :headers="headers" :before-upload="submitUpload" - :on-preview="handlePreview" :on-remove="handleRemove" + :on-preview="handlePreview" :on-success="uploadSuccess" :data="paramData" :file-list="fileList" @@ -41,7 +41,7 @@ > <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button> <div slot="tip" class="el-upload__tip"> - 鍙兘涓婁紶jpg鍥剧墖锛屼笖涓嶈秴杩�2MB + 鍙兘涓婁紶jpg/png鍥剧墖锛屼笖涓嶈秴杩�5MB </div> </el-upload> </el-col> @@ -320,10 +320,22 @@ }) } }, - submitUpload() { + submitUpload(file) { console.info(this.currentRow && this.currentRow.id) + console.log(file); if (this.currentRow && this.currentRow.id) { + const maxSize = 5 * 1024 *1024 + let jpgType = 'image/jpeg' + let pngType = 'image/png' + if(file.type != jpgType && file.type != pngType){ + this.$message.error('鍙兘涓婁紶.jpg/.png绫诲瀷鐨勫浘鐗�') + return false + } + if(file.szie > maxSize){ + this.$message.error('鍥剧墖澶у皬涓嶈兘瓒呰繃5MB') + } this.paramData.exceptionId = this.currentRow.id + } else { this.$message.error('璇峰厛閫夋嫨鐢熶骇寮傚父璁板綍') return false -- Gitblit v1.9.3