From bc16d211c5a2b31f0e3127a102748806151eaecb Mon Sep 17 00:00:00 2001 From: zouyu <2723363702@qq.com> Date: 星期四, 14 十二月 2023 16:23:19 +0800 Subject: [PATCH] modified: src/const/crud/customerOrder/customerOrderForm.js modified: src/views/plan/operationtask/operationtask-form.vue modified: src/views/product/workbench/operation-task-pane.vue modified: src/views/product/workbench/taskinfo-pane.vue modified: src/views/product/workbench/workReportCard.vue modified: src/views/quality/finishedProductInspection/finishedProduct-form.vue modified: src/views/quality/newReport/ReportForm.vue modified: src/views/quality/processInspect/processInspect-form.vue modified: src/views/quality/rawMaterial/rawMaterial-form.vue modified: src/views/quality/teststandard/standard-form.vue modified: src/views/technology/completeproductstructure/completeproductstructure-form.vue modified: src/views/technology/document/document-form.vue modified: src/views/technology/operation/operation-form.vue modified: src/views/technology/routing/routing-form.vue modified: src/views/warehouse/changestock/index.vue --- src/views/quality/exception/exception.vue | 25 +++++++++++++++++++++---- 1 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/views/quality/exception/exception.vue b/src/views/quality/exception/exception.vue index 1179697..8381c98 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> @@ -53,6 +53,9 @@ @refreshDataList="getData" ></table-form> </div> + <el-dialog title="鍥剧墖棰勮" width="60%" :visible.sync="previewVisible" top="5vh"> + <img style="width:100%;height: 70vh" :src="dialogImageUrl" alt=""> + </el-dialog> </div> </template> <style lang="scss" scoped> @@ -111,6 +114,8 @@ }, data() { return { + previewVisible: false, + dialogImageUrl: null, fileList: [], headers: { Authorization: 'Bearer ' + getStore({ name: 'access_token' }) @@ -293,7 +298,7 @@ } }, handlePreview(file) { - window.open(file.url) + this.previewVisible = true }, uploadSuccess(response, file, fileList) { this.getFileList() @@ -312,6 +317,7 @@ fileEl = {} fileEl.name = attachment.original fileEl.url = attachment.url + this.dialogImageUrl = attachment.url fileEl.id = attachment.id fileEl.fileName = attachment.fileName this.fileList.push(fileEl) @@ -320,10 +326,21 @@ }) } }, - submitUpload() { + submitUpload(file) { console.info(this.currentRow && this.currentRow.id) 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