From c52a0824baaa86a719da04fba3ff65fc48a70422 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期四, 19 三月 2026 17:37:05 +0800
Subject: [PATCH] fix: 入库数量必填

---
 src/pages/equipmentManagement/upkeep/detail.vue |   44 ++++++++++++++++++++++----------------------
 1 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/pages/equipmentManagement/upkeep/detail.vue b/src/pages/equipmentManagement/upkeep/detail.vue
index 3af1809..8a28dcd 100644
--- a/src/pages/equipmentManagement/upkeep/detail.vue
+++ b/src/pages/equipmentManagement/upkeep/detail.vue
@@ -80,8 +80,7 @@
           <view v-for="(item, index) in sparePartsList"
                 :key="index"
                 class="spare-part-item">
-            <text class="spare-part-name">{{ item.sparePartName || item.name || '-' }}</text>
-            <text class="spare-part-code">{{ item.sparePartCode || item.code || '-' }}</text>
+            <text class="spare-part-name">{{ item || '-' }}</text>
           </view>
         </view>
         <view v-else
@@ -107,7 +106,7 @@
                 class="file-item"
                 @click="previewFile(file)">
             <image v-if="file.type.includes('image')"
-                   :src="file.url"
+                   :src="formatFileUrl(file.url)"
                    class="file-preview"
                    mode="aspectFill" />
             <view v-else
@@ -197,12 +196,12 @@
     if (url.startsWith("http://") || url.startsWith("https://")) {
       return url;
     }
-    const uploadsIndex = url.indexOf("uploads");
-    if (uploadsIndex !== -1) {
-      const relativePath = url.substring(uploadsIndex);
-      return `${config.baseUrl}/profile/${relativePath}`;
-    }
-    return `${config.baseUrl}/profile/${url}`;
+    // const uploadsIndex = url.indexOf("uploads");
+    // if (uploadsIndex !== -1) {
+    //   const relativePath = url.substring(uploadsIndex);
+    //   return `${config.fileUrl}/${relativePath}`;
+    // }
+    return `${config.fileUrl}/${url}`;
   };
 
   // 鍒ゆ柇鏄惁涓哄浘鐗囨枃浠�
@@ -218,18 +217,18 @@
 
   // 棰勮鏂囦欢
   const previewFile = file => {
-    if (file.type.includes("image")) {
-      uni.previewImage({
-        urls: [file.url],
-        current: file.url,
-      });
-    } else {
-      // 瑙嗛棰勮
-      const videoUrl = formatFileUrl(file.url || file.downloadUrl);
-      uni.navigateTo({
-        url: `/pages/common/videoPreview?url=${encodeURIComponent(videoUrl)}`,
-      });
-    }
+    // if (file.type.includes("image")) {
+    uni.previewImage({
+      urls: [formatFileUrl(file.url)],
+      current: formatFileUrl(file.url),
+    });
+    // } else {
+    //   // 瑙嗛棰勮
+    //   const videoUrl = formatFileUrl(file.url || file.downloadUrl);
+    //   uni.navigateTo({
+    //     url: `/pages/common/videoPreview?url=${encodeURIComponent(videoUrl)}`,
+    //   });
+    // }
   };
 
   // 鑾峰彇璇︽儏鏁版嵁
@@ -257,10 +256,11 @@
     detailData.value = data;
     pageId.value = data.id;
     // 澶勭悊澶囦欢鏁版嵁 - 鏀寔澶氱鏁版嵁缁撴瀯
-    sparePartsList.value = data.spareParts || data.sparePartList || [];
+    sparePartsList.value = data.sparePartsNames.split(",") || [];
     // 澶勭悊闄勪欢鏁版嵁 - 鏀寔澶氱鏁版嵁缁撴瀯
     console.log(data.imagesFile);
     fileList.value = data.imagesFile;
+    console.log(formatFileUrl(fileList.value[0].url));
   };
 
   // 杩斿洖涓婁竴椤�

--
Gitblit v1.9.3