From 2b0e70bb88ced210dbc693a4d2ded2d658b1da02 Mon Sep 17 00:00:00 2001
From: 啊鑫 <t2856754968@163.com>
Date: 星期一, 21 七月 2025 15:30:03 +0800
Subject: [PATCH] 111

---
 pages/QC/Laboratory/Laboratory.vue |  117 ++++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 77 insertions(+), 40 deletions(-)

diff --git a/pages/QC/Laboratory/Laboratory.vue b/pages/QC/Laboratory/Laboratory.vue
index aa6c976..67f2a34 100644
--- a/pages/QC/Laboratory/Laboratory.vue
+++ b/pages/QC/Laboratory/Laboratory.vue
@@ -4,12 +4,12 @@
     <view class="page-header">
       <view class="header-title">瀹為獙瀹ゆ娴嬭鎯�</view>
     </view>
-    
+
     <!-- 鍔犺浇鐘舵�� -->
     <view v-if="loading" class="loading-container">
-      <uni-load-more status="loading" />
+      <uni-load-more status="loading"/>
     </view>
-    
+
     <!-- 鏁版嵁灞曠ず -->
     <view v-else-if="data" class="content">
       <view class="card">
@@ -21,7 +21,7 @@
             </view>
           </view>
         </view>
-        
+
         <view class="card-body">
           <view class="info-group">
             <view class="info-row">
@@ -34,7 +34,7 @@
                 <text class="info-value">{{ data.createUser }}</text>
               </view>
             </view>
-            
+
             <view class="info-row">
               <view class="info-item">
                 <label class="info-label">鐢熶骇绾跨紪鐮�:</label>
@@ -45,21 +45,21 @@
                 <text class="info-value">{{ data.itemNo }}</text>
               </view>
             </view>
-            
+
             <view class="info-row full-width">
               <view class="info-item">
                 <label class="info-label">鐗╂枡鍚嶇О:</label>
                 <text class="info-value">{{ data.itemName }}</text>
               </view>
             </view>
-            
+
             <view class="info-row full-width">
               <view class="info-item">
                 <label class="info-label">鐗╂枡瑙勬牸:</label>
                 <text class="info-value">{{ data.itemModel }}</text>
               </view>
             </view>
-            
+
             <view class="info-row">
               <view class="info-item">
                 <label class="info-label">鐢熶骇杞﹂棿缂栫爜:</label>
@@ -70,14 +70,14 @@
                 <text class="info-value">{{ data.departmentId }}</text>
               </view>
             </view>
-            
+
             <view class="info-row full-width">
               <view class="info-item">
                 <label class="info-label">閿�鍞鍗曞彿:</label>
                 <text class="info-value">{{ data.saleOrderNoc }}</text>
               </view>
             </view>
-            
+
             <view class="info-row">
               <view class="info-item">
                 <label class="info-label">妫�楠屾椂闂�:</label>
@@ -88,36 +88,43 @@
                 <text class="info-value">{{ data.inspectionUser }}</text>
               </view>
             </view>
-            
+
             <view class="info-row">
               <view class="info-item status-item">
                 <label class="info-label">妫�楠岀粨鏋�:</label>
                 <view class="result-container">
                   <!-- 鏄剧ず褰撳墠妫�楠岀粨鏋� -->
-                  <text v-if="data.inspectionResult" class="status-badge" :class="data.inspectionResult === '鍚堟牸' ? 'success' : 'danger'">
+                  <text v-if="data.inspectionResult" :class="data.inspectionResult === '鍚堟牸' ? 'success' : 'danger'"
+                        class="status-badge">
                     {{ data.inspectionResult }}
                   </text>
                   <text v-else class="status-badge pending">
                     寰呮楠�
                   </text>
-                  
+
                   <!-- 褰曞叆/閲嶆柊褰曞叆鎸夐挳 -->
                   <button v-if="!showResultInput" class="input-btn" @click="showResultInput = true">
                     {{ data.inspectionResult ? '閲嶆柊褰曞叆' : '褰曞叆缁撴灉' }}
                   </button>
-                  
+
                   <!-- 妫�楠岀粨鏋滈�夋嫨鎸夐挳 -->
                   <view v-if="showResultInput" class="result-input-container">
-                    <button class="result-btn qualified" @click="updateInspectionResult('鍚堟牸')" :disabled="updating">
+                    <button :disabled="updating" class="result-btn qualified" @click="updateInspectionResult('鍚堟牸')">
                       鍚堟牸
                     </button>
-                    <button class="result-btn unqualified" @click="updateInspectionResult('涓嶅悎鏍�')" :disabled="updating">
+                    <button :disabled="updating" class="result-btn unqualified"
+                            @click="updateInspectionResult('涓嶅悎鏍�')">
                       涓嶅悎鏍�
                     </button>
-                    <button class="result-btn cancel" @click="showResultInput = false" :disabled="updating">
+                    <button :disabled="updating" class="result-btn cancel" @click="showResultInput = false">
                       鍙栨秷
                     </button>
                   </view>
+
+                  <!-- 鍥剧墖涓婁紶鎸夐挳 -->
+                  <button class="upload-btn" @click="uploadImage">
+                    馃摲 涓婁紶鍥剧墖
+                  </button>
                 </view>
               </view>
             </view>
@@ -125,7 +132,7 @@
         </view>
       </view>
     </view>
-    
+
     <!-- 绌虹姸鎬� -->
     <view v-else class="empty-state">
       <view class="empty-icon">馃搵</view>
@@ -145,24 +152,24 @@
       updating: false
     }
   },
-  
+
   onLoad(options) {
     this.itemId = options.id;
     if (this.itemId) {
       this.loadData();
     }
   },
-  
+
   methods: {
     loadData() {
       this.loading = true;
-      
+
       const requestData = {
         pageIndex: 1,
         limit: 1,
         id: this.itemId
       };
-      
+
       this.$post({
         url: "/MesLaboratory/GetPage",
         data: requestData
@@ -180,16 +187,16 @@
         this.loading = false;
       });
     },
-    
+
     updateInspectionResult(result) {
       this.updating = true;
-      
+
       const requestData = {
         id: this.itemId,
         inspectionResult: result,
         inspectionBy: this.$loginInfo.account
       };
-      
+
       this.$post({
         url: "/MesLaboratory/UpdateInspectionResult",
         data: requestData
@@ -207,6 +214,16 @@
         this.$showMessage('褰曞叆澶辫触锛岃閲嶈瘯');
       }).finally(() => {
         this.updating = false;
+      });
+    },
+
+    uploadImage() {
+      // 澶勭悊billNo锛屽幓鎺�"-"鍚庨潰鐨勯儴鍒�
+      const orderNo = this.data.billNo.split('-')[0];
+
+      // 璺宠浆鍒板浘鐗囦笂浼犻〉闈�
+      uni.navigateTo({
+        url: `ImageItem?id=${this.itemId}&orderNo=${orderNo}`
       });
     }
   }
@@ -273,7 +290,7 @@
 .info-row {
   display: flex;
   gap: 20px;
-  
+
   &.full-width {
     flex-direction: column;
   }
@@ -284,7 +301,7 @@
   align-items: center;
   flex: 1;
   min-width: 0;
-  
+
   &.status-item {
     align-items: center;
     gap: 10px;
@@ -312,19 +329,19 @@
   font-size: 14px;
   border-radius: 20px;
   font-weight: 500;
-  
+
   &.success {
     background-color: #e6f7ed;
     color: #36b37e;
     border: 1px solid #d1fae5;
   }
-  
+
   &.danger {
     background-color: #ffefef;
     color: #ff4d4f;
     border: 1px solid #fee2e2;
   }
-  
+
   &.pending {
     background-color: #f5f5f5;
     color: #999;
@@ -348,12 +365,12 @@
   color: #409EFF;
   cursor: pointer;
   transition: all 0.2s;
-  
+
   &:hover {
     background-color: #409EFF;
     color: #fff;
   }
-  
+
   &:active {
     transform: scale(0.95);
   }
@@ -372,50 +389,70 @@
   border: 1px solid;
   cursor: pointer;
   transition: all 0.2s;
-  
+
   &:disabled {
     opacity: 0.6;
     cursor: not-allowed;
   }
-  
+
   &.qualified {
     background-color: #e6f7ed;
     color: #36b37e;
     border-color: #36b37e;
-    
+
     &:hover:not(:disabled) {
       background-color: #36b37e;
       color: #fff;
     }
   }
-  
+
   &.unqualified {
     background-color: #ffefef;
     color: #ff4d4f;
     border-color: #ff4d4f;
-    
+
     &:hover:not(:disabled) {
       background-color: #ff4d4f;
       color: #fff;
     }
   }
-  
+
   &.cancel {
     background-color: #f5f5f5;
     color: #666;
     border-color: #ccc;
-    
+
     &:hover:not(:disabled) {
       background-color: #ccc;
       color: #fff;
     }
   }
-  
+
   &:active:not(:disabled) {
     transform: scale(0.95);
   }
 }
 
+.upload-btn {
+  padding: 8px 16px;
+  font-size: 14px;
+  border-radius: 6px;
+  border: 1px solid #67C23A;
+  background-color: #fff;
+  color: #67C23A;
+  cursor: pointer;
+  transition: all 0.2s;
+
+  &:hover {
+    background-color: #67C23A;
+    color: #fff;
+  }
+
+  &:active {
+    transform: scale(0.95);
+  }
+}
+
 .empty-state {
   display: flex;
   flex-direction: column;

--
Gitblit v1.9.3