From 6f81691ab09d586470426ee0bfa99cec83797f7b Mon Sep 17 00:00:00 2001
From: 董国庆 <364620639@qq.com>
Date: 星期一, 23 六月 2025 15:52:24 +0800
Subject: [PATCH] 实验运行模块 图片换真实上传

---
 laboratory/src/views/dataManagement/sampleManage/addSample.vue |   32 +++++++++++++-------------------
 1 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/laboratory/src/views/dataManagement/sampleManage/addSample.vue b/laboratory/src/views/dataManagement/sampleManage/addSample.vue
index e23be57..81dc6ac 100644
--- a/laboratory/src/views/dataManagement/sampleManage/addSample.vue
+++ b/laboratory/src/views/dataManagement/sampleManage/addSample.vue
@@ -141,8 +141,8 @@
                   <el-image
                     v-for="(url, index) in scope.row.pictures.split(',')" 
                     :key="index"
-                    src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
-                    :preview-src-list="[url]"
+                    :src="getFullUrl(url)"
+                    :preview-src-list="[getFullUrl(url)]"
                     style="width: 50px; height: 50px;"
                   />
                 </template>
@@ -253,6 +253,7 @@
 import addTime from "./components/addTime.vue";
 import ReceiveConfirmDialog from "./components/receiveConfirmDialog.vue";
 import { add, getDetail, update, batchCollectSamples } from "./service";
+import {getFullUrl} from '@/utils/utils.js'
 
 export default {
   name: "AddSample",
@@ -327,14 +328,13 @@
     },
   },
   methods: {
+    getFullUrl,
     // 获取详情数据
     async getDetailData(id) {
       try {
         const res = await getDetail({ id });
         if (res) {
           const detail = res;
-          console.log('获取到的详情数据:', detail);
-          
           // 设置表单数据
           this.form = {
             ...this.form,
@@ -386,14 +386,14 @@
           }
 
           // 如果是详情模式,禁用所有输入
-          if (this.pageType == 'detail') {
-            this.$nextTick(() => {
-              const inputs = document.querySelectorAll('input, textarea, select');
-              inputs.forEach(input => {
-                input.disabled = true;
-              });
-            });
-          }
+          // if (this.pageType == 'detail') {
+          //   this.$nextTick(() => {
+          //     const inputs = document.querySelectorAll('input, textarea, select');
+          //     inputs.forEach(input => {
+          //       input.disabled = true;
+          //     });
+          //   });
+          // }
         }
       } catch (error) {
         console.error('获取详情失败:', error);
@@ -507,8 +507,6 @@
         };
 
         // 打印提交数据
-        console.log('草稿提交数据:', submitData);
-
         let res;
         if (this.pageType == 'edit') {
           // 编辑模式调用update接口
@@ -530,7 +528,6 @@
       }
     },
     handlePendingSelectionChange(selection) {
-      console.log("pending selection change:", selection);
       console.log("pending samples data:", this.pendingSamples);
       this.selectedSamples = selection;
       // 强制更新视图
@@ -554,7 +551,7 @@
     },
     confirmReceive(signature) {
       // 获取选中样品的ID并拼接
-      const recordOperationIds = this.selectedSamples.map(item => item.id).join(',');
+      const recordOperationIds = this.selectedSamples.map(item => item.id);
       
       // 调用批量收样接口
       batchCollectSamples({
@@ -591,10 +588,7 @@
       
     },
     isSelectable(row) {
-      console.log('isSelectable row:', row);
-      console.log('row status:', row.status, typeof row.status);
       const result = String(row.status) == '2';
-      console.log('isSelectable result:', result);
       return result;
     },
   },

--
Gitblit v1.7.1