From 57f334ce8c79887612fd9aafbd9618e6e43f62e4 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期四, 19 三月 2026 14:09:24 +0800
Subject: [PATCH] 库存详情中,序号改为对应的产品类型(仓库是原材料、成品,耗材对应的是耗材),下面添加备注展示

---
 src/pages/inspectionUpload/index.vue |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/src/pages/inspectionUpload/index.vue b/src/pages/inspectionUpload/index.vue
index 158441e..c0293dd 100644
--- a/src/pages/inspectionUpload/index.vue
+++ b/src/pages/inspectionUpload/index.vue
@@ -281,8 +281,9 @@
                       class="attachment-item"
                       @click="previewAttachment(file)">
                   <view class="attachment-preview-container">
+                    <!-- {{formatFileUrl(file.url || file.downloadUrl)}} -->
                     <image v-if="file.type === 'image' || isImageFile(file)"
-                           :src="file.url || file.downloadUrl"
+                           :src="formatFileUrl(file.url || file.downloadUrl)"
                            class="attachment-preview"
                            mode="aspectFill" />
                     <view v-else
@@ -1053,7 +1054,7 @@
   };
 
   // 鏂囦欢璁块棶鍩虹鍩燂紙鍚庣瑕佹眰鍓嶇紑锛�
-  const filePreviewBase = config.baseUrl;
+  const filePreviewBase = config.fileUrl;
 
   // 灏嗗悗绔繑鍥炵殑鏂囦欢鍦板潃瑙勮寖鎴愬彲璁块棶URL
   // 鍏煎鍦烘櫙锛�
@@ -1589,7 +1590,19 @@
   const uploadedSuccessfully = () => {
     // 姝ゅ嚱鏁板凡涓嶅啀浣跨敤锛屾枃浠朵笂浼犳垚鍔熷悗绔嬪嵆娣诲姞鍒板搴斿垎绫�
   };
-
+  // 鏍煎紡鍖栨枃浠禪RL
+  const formatFileUrl = url => {
+    if (!url) return "";
+    if (url.startsWith("http://") || url.startsWith("https://")) {
+      return url;
+    }
+    // const uploadsIndex = url.indexOf("uploads");
+    // if (uploadsIndex !== -1) {
+    //   const relativePath = url.substring(uploadsIndex);
+    //   return `${config.fileUrl}/${relativePath}`;
+    // }
+    return `${config.fileUrl}/${url}`;
+  };
   // 鏍煎紡鍖栨枃浠跺ぇ灏�
   const formatFileSize = size => {
     if (!size) return "";

--
Gitblit v1.9.3