diff --git a/inventory-web/src/views/purchase/index.vue b/inventory-web/src/views/purchase/index.vue index bb8df41..de83970 100644 --- a/inventory-web/src/views/purchase/index.vue +++ b/inventory-web/src/views/purchase/index.vue @@ -147,7 +147,7 @@ - + { if (res.code === 200) { const newUrl = res.data.url form.value.images!.push(newUrl) + // 同步更新 fileList,触发 el-upload UI 刷新 + fileList.value.push({ name: newUrl.split('/').pop(), url: getImageUrl(newUrl) }) onSuccess(res) } else { ElMessage.error(res.msg || '上传失败') @@ -512,6 +515,12 @@ const handleRemoveImage = async (uploadFile: any) => { } } +// 粘贴上传处理器(PC 端:鼠标悬停 + Ctrl+V 直接粘贴图片) +const handlePasteLink = (link: string, field: string) => { + // 采购单没有独立的外链输入框,暂不支持网页图片链接自动填入 +} +usePasteUpload(customUpload, 'images', '#upload-purchase-images', handlePasteLink) + // --- 提交 --- const submitForm = async () => { if (!form.value.name.trim()) { ElMessage.warning('请选择或填写采购物品'); return } diff --git a/inventory-web/src/views/stock/inbound/buy.vue b/inventory-web/src/views/stock/inbound/buy.vue index 2dd8772..c162ac2 100644 --- a/inventory-web/src/views/stock/inbound/buy.vue +++ b/inventory-web/src/views/stock/inbound/buy.vue @@ -447,7 +447,7 @@ -
+
-
+
{ + if (field === 'inspection_report') { + inspection_report_url.value = link + } +} +usePasteUpload(customUpload, 'arrival_photo', '#upload-arrival_photo', handlePasteLink) +usePasteUpload(customUpload, 'inspection_report', '#upload-inspection_report', handlePasteLink) + const handlePreviewPicture = (uploadFile: any) => { dialogImageUrl.value = uploadFile.url!; dialogVisibleImage.value = true } const triggerCamera = (field: 'arrival_photo' | 'inspection_report') => { currentCameraField.value = field; diff --git a/inventory-web/src/views/stock/inbound/product.vue b/inventory-web/src/views/stock/inbound/product.vue index 8fd8bd1..1a20cc7 100644 --- a/inventory-web/src/views/stock/inbound/product.vue +++ b/inventory-web/src/views/stock/inbound/product.vue @@ -388,7 +388,7 @@ -
+
@@ -402,7 +402,7 @@ -
+