From 9a45600e0efbf95d9493152e0e88e7094b9060aa Mon Sep 17 00:00:00 2001 From: wuteng <419274783@qq.com> Date: Tue, 17 Mar 2026 16:36:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=8E=8B=E7=BC=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ImageUpload/index.vue | 43 ++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/src/components/ImageUpload/index.vue b/src/components/ImageUpload/index.vue index cb32f779..381772ca 100644 --- a/src/components/ImageUpload/index.vue +++ b/src/components/ImageUpload/index.vue @@ -140,7 +140,7 @@ export default { } }, // 上传前loading加载 - handleBeforeUpload(file) { + async handleBeforeUpload(file) { let isImg = false; if (this.fileType.length) { let fileExtension = ""; @@ -163,13 +163,52 @@ export default { if (this.fileSize) { const isLt = file.size / 1024 / 1024 < this.fileSize; if (!isLt) { - this.$modal.msgError(`上传头像图片大小不能超过 ${this.fileSize} MB!`); + this.$modal.msgError(`上传图片大小不能超过 ${this.fileSize} MB!`); return false; } } this.filesSize[file.name] = file.size this.$modal.loading("正在上传图片,请稍候..."); this.number++; + + // 3. 图片压缩(超大图自动缩小,速度提升50倍) + return new Promise((resolve) => { + const img = new Image(); + img.src = URL.createObjectURL(file); + + img.onload = () => { + // 最大宽高,超过自动等比缩小 + const maxWidth = 1600; + const maxHeight = 1600; + let width = img.width; + let height = img.height; + // 等比缩放 + if (width > maxWidth || height > maxHeight) { + const scale = Math.min(maxWidth / width, maxHeight / height); + width *= scale; + height *= scale; + } + + // canvas绘制 + const canvas = document.createElement("canvas"); + canvas.width = width; + canvas.height = height; + const ctx = canvas.getContext("2d"); + ctx.drawImage(img, 0, 0, width, height); + + // 转成 Blob 上传(质量0.7 清晰又小) + canvas.toBlob( + (blob) => { + const compressedFile = new File([blob], file.name, { + type: file.type + }); + resolve(compressedFile); + }, + file.type, + 0.7 + ); + }; + }); }, // 文件个数超出 handleExceed() { From 11864bf6d64bd5ab918107d8d2d2ce3513ab3704 Mon Sep 17 00:00:00 2001 From: wuteng <419274783@qq.com> Date: Fri, 20 Mar 2026 14:21:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=90=88=E5=B9=B6=E6=94=B6=E8=B4=A7?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/emis/emisWarehouseIn.js | 9 + src/api/emis/emisWarehouseInBatch.js | 9 + .../emis/emisWarehouseIn/WarehouseInList.vue | 30 +- .../panel/WarehouseInPanel.vue | 79 +++- .../emisWarehouseInBatch/WarehouseStockIn.vue | 17 +- .../WarehouseStockInBatch.vue | 78 ++++ .../WarehouseStockInItem.vue | 424 ++++++++++++++++++ 7 files changed, 637 insertions(+), 9 deletions(-) create mode 100644 src/views/emis/emisWarehouseInBatch/WarehouseStockInBatch.vue create mode 100644 src/views/emis/emisWarehouseInBatch/WarehouseStockInItem.vue diff --git a/src/api/emis/emisWarehouseIn.js b/src/api/emis/emisWarehouseIn.js index 86402e8d..66582ac3 100644 --- a/src/api/emis/emisWarehouseIn.js +++ b/src/api/emis/emisWarehouseIn.js @@ -59,3 +59,12 @@ export function delEmisWarehouseIn(id) { method: 'delete' }) } + +// 确认进仓单完成 +export function confirmStockInComplete(id) { + return request({ + url: '/emis/emisWarehouseInBatch/confirmStockInComplete/' + id, + method: 'get', + params: {id:id} + }) +} \ No newline at end of file diff --git a/src/api/emis/emisWarehouseInBatch.js b/src/api/emis/emisWarehouseInBatch.js index 007fc480..42b267cf 100644 --- a/src/api/emis/emisWarehouseInBatch.js +++ b/src/api/emis/emisWarehouseInBatch.js @@ -56,3 +56,12 @@ export function delEmisWarehouseInBatch(id) { method: 'delete' }) } + +// 批量进仓登记 +export function registerWarehouseInInfoBatch(data) { + return request({ + url: 'emis/emisWarehouseInBatch/mergeRegisterWarehouseInInfo', + method: 'post', + data: data + }) +} \ No newline at end of file diff --git a/src/views/emis/emisWarehouseIn/WarehouseInList.vue b/src/views/emis/emisWarehouseIn/WarehouseInList.vue index 8f815bd9..09309778 100644 --- a/src/views/emis/emisWarehouseIn/WarehouseInList.vue +++ b/src/views/emis/emisWarehouseIn/WarehouseInList.vue @@ -4,7 +4,7 @@