From 9c49917bb7ec38cc4317591763f80ccf89c2e729 Mon Sep 17 00:00:00 2001
From: fcx <2246384483@qq.com>
Date: 星期三, 03 十二月 2025 19:26:58 +0800
Subject: [PATCH] 将判断上限值过大过小逻辑删除

---
 pages/QC/SJ/detail.vue |   65 +++++++++++++++++++++++---------
 1 files changed, 46 insertions(+), 19 deletions(-)

diff --git a/pages/QC/SJ/detail.vue b/pages/QC/SJ/detail.vue
index ab2e6f4..2754d7e 100644
--- a/pages/QC/SJ/detail.vue
+++ b/pages/QC/SJ/detail.vue
@@ -40,15 +40,16 @@
               <view class="info-label">妫�楠屾暟</view>
               <view class="info-value">{{ formData.levelNum }}</view>
             </view>
-            <view v-if="formData.minValue" class="info-item">
+            <!-- 淇锛氫娇鐢ㄦ洿鍑嗙‘鐨勫垽鏂潯浠讹紝閬垮厤0琚鍒や负falsy -->
+            <view v-if="formData.minValue != null" class="info-item">
               <view class="info-label">涓嬮檺</view>
               <view class="info-value">{{ formData.minValue }}</view>
             </view>
-            <view v-if="formData.standardValue" class="info-item">
+            <view v-if="formData.standardValue != null" class="info-item">
               <view class="info-label">鏍囧噯鍊�</view>
               <view class="info-value">{{ formData.standardValue }}</view>
             </view>
-            <view v-if="formData.maxValue" class="info-item">
+            <view v-if="formData.maxValue != null" class="info-item">
               <view class="info-label">涓婇檺</view>
               <view class="info-value">{{ formData.maxValue }}</view>
             </view>
@@ -69,11 +70,11 @@
         <view class="section-header">妫�楠岀粨鏋�</view>
         <view class="section-body">
           <view class="info-grid">
-            <view v-if="formData.result" class="info-item">
+            <view v-if="formData.result != null" class="info-item">
               <view class="info-label">棰勮缁撴灉</view>
               <view class="info-value">{{ formData.result }}</view>
             </view>
-            <view v-if="formData.remarks" class="info-item">
+            <view v-if="formData.remarks != null" class="info-item">
               <view class="info-label">澶囨敞</view>
               <view class="info-value danger">{{ formData.remarks }}</view>
             </view>
@@ -85,7 +86,8 @@
       <view class="section">
         <view class="section-header">妫�楠岀粨鏋滃綍鍏�</view>
         <view class="section-body">
-          <view v-if="!formData.maxValue && !formData.minValue" class="info-item edit">
+          <!-- 淇锛氫娇鐢ㄦ洿鍑嗙‘鐨勫垽鏂潯浠讹紝閬垮厤0琚鍒や负falsy -->
+          <view v-if="formData.maxValue == null && formData.minValue == null" class="info-item edit">
             <view class="info-label" style="color: #F56C6C">鎻愮ず</view>
             <view class="info-value" style="color: #F56C6C">娌℃湁鏈�澶у�煎拰鏈�灏忓�兼椂濉啓0锛堟湭閫氳繃妫�楠岋級鎴�1锛堥�氳繃妫�楠岋級</view>
           </view>
@@ -102,7 +104,7 @@
               </button>
               <input v-if="(tableData.length < formData.levelNum)" v-model="formData.fcheckResu" class="result-input"
                      placeholder="璇疯緭鍏ユ楠岀粨鏋�..." type="number"/>
-              <button v-if="(tableData.length < formData.levelNum)" class="btn primary-btn" @click="submit">淇濆瓨缁撴灉
+              <button v-if="(tableData.length < formData.levelNum)" class="btn primary-btn" @click="submit" style="margin: 0px;">淇濆瓨缁撴灉
               </button>
             </view>
           </view>
@@ -110,20 +112,21 @@
           <!-- 鍝嶅簲寮忚璁$殑绗簩涓緭鍏ョ粍 -->
           <view class="input-group input2">
             <view class="input-wrapper">
-              <button class="btn upload-btn" @click="chooseImage">
+              <button class="btn upload-btn" @click="chooseImage ">
                 <uni-icons type="upload" size="16" color="#fff"></uni-icons>
                 涓婁紶/鏌ョ湅鍥剧墖
               </button>
-              <button v-if="current" class="btn upload-btn" @click="saveRemarks">
+              <button v-if="current" class="btn upload-btn" @click="saveRemarks  ">
                 <uni-icons type="compose" size="16" color="#fff"></uni-icons>
                 澶囨敞
               </button>
             </view>
             <view class="input-wrapper" style="margin-top: 15px;">
-              <input v-if="(tableData.length < formData.levelNum)" v-model="formData.fcheckResu" class="result-input"
+              <input v-if="(tableData.length < formData.levelNum)" v-model="formData.fcheckResu" class="result-input" 
                      placeholder="璇疯緭鍏ユ楠岀粨鏋�..." type="number"/>
-              <button v-if="(tableData.length < formData.levelNum) && current" class="btn primary-btn" @click="submit">淇濆瓨缁撴灉
-              </button>
+              
+              <button v-if="tableData.length < formData.levelNum" class="btn primary-btn" @click="submit" style="margin: 0px;" >淇濆瓨缁撴灉  
+			  </button>
             </view>
           </view>
         </view>
@@ -266,8 +269,8 @@
       let count = this.formData.levelNum;
       let fstand = "鈭�";
 
-      //鏈夋渶澶у�煎拰鏈�灏忓�煎氨鏍规嵁鏄惁绗﹀悎鏍囧噯鍊兼洿鏂板垽瀹氱粨鏋滐紝娌℃湁鏈�澶у�煎拰鏈�灏忓�煎氨鏍规嵁鏄惁閫氳繃妫�楠屽垽瀹氱粨鏋�
-      if (this.formData.maxValue && this.formData.minValue) {
+      // 淇锛氫娇鐢ㄦ洿鍑嗙‘鐨勫垽鏂潯浠讹紝閬垮厤0琚鍒や负falsy
+      if (this.formData.maxValue != null && this.formData.minValue != null) {
 
         if (!this.formData.fcheckResu) {
           this.$showMessage("璇疯緭鍏ユ楠屽��");
@@ -338,7 +341,8 @@
           this.isShowImg = true;
           this.base64Image = 'data:image/jpeg;base64,' + this.formData.imageData;
         }
-        if (this.formData.maxValue && this.formData.minValue && this.formData.standardValue) {
+        // 淇锛氫娇鐢ㄦ洿鍑嗙‘鐨勫垽鏂潯浠讹紝閬垮厤0琚鍒や负falsy
+        if (this.formData.maxValue != null && this.formData.minValue != null && this.formData.standardValue != null) {
           this.isNumber = true;
         }
       })
@@ -370,7 +374,8 @@
 
       let fstand = "鈭�";
 
-      if (this.formData.maxValue && this.formData.minValue) {
+      // 淇锛氫娇鐢ㄦ洿鍑嗙‘鐨勫垽鏂潯浠讹紝閬垮厤0琚鍒や负falsy
+      if (this.formData.maxValue != null && this.formData.minValue != null) {
 
         if (!this.editData.fcheckResu) {
           this.$showMessage("璇疯緭鍏ユ楠屽��");
@@ -398,9 +403,13 @@
           this.editData.fcheckResu = 1
         }
 
+        // 鏀硅繘鍚庣殑閫昏緫锛氭牴鎹楠岀粨鏋滃�兼潵鍒ゆ柇鍚堟牸涓庡惁
         if (this.editData.fcheckResu == 0 || this.editData.fcheckResu == 1) {
+          // 0琛ㄧず涓嶅悎鏍硷紝1琛ㄧず鍚堟牸
           if (this.editData.fcheckResu == 0) {
             fstand = "脳";
+          } else {
+            fstand = "鈭�";
           }
         } else {
           this.$showMessage("鏃犳爣鍑嗗�兼椂锛屾楠岀粨鏋滃彧鑳戒负0鎴�1!");
@@ -458,7 +467,7 @@
     // 涓婁紶鍥剧墖
     chooseImage() {
       uni.navigateTo({
-        url: 'ImageItem?id=' + this.formData.id + '&gid=' + this.gid
+        url: 'ImageItem?id=777' + this.formData.id + '&gid=' + this.gid
       });
     },
     saveRemarks() {
@@ -487,14 +496,16 @@
     },
     // 鍒ゆ柇鏁板瓧鏄惁鍦ㄨ寖鍥村唴
     isInRange(value) {
-      if (!this.formData.maxValue || !this.formData.minValue) return true;
+      // 淇锛氫娇鐢ㄦ洿鍑嗙‘鐨勫垽鏂潯浠讹紝閬垮厤0琚鍒や负falsy
+      if (this.formData.maxValue == null || this.formData.minValue == null) return true;
       const numValue = parseFloat(value);
       return numValue >= parseFloat(this.formData.minValue) &&
           numValue <= parseFloat(this.formData.maxValue);
     },
     // 鑾峰彇鏁板瓧缁撴灉鐨勬牱寮忕被
     getNumberResultClass(value) {
-      if (!this.formData.maxValue || !this.formData.minValue) return 'number-normal';
+      // 淇锛氫娇鐢ㄦ洿鍑嗙‘鐨勫垽鏂潯浠讹紝閬垮厤0琚鍒や负falsy
+      if (this.formData.maxValue == null || this.formData.minValue == null) return 'number-normal';
       return this.isInRange(value) ? 'number-pass' : 'number-fail';
     },
     // 鑾峰彇鐘舵�佺粨鏋滅殑鏍峰紡绫�
@@ -653,6 +664,15 @@
       border: none;
       border-radius: 4px;
     }
+    
+    .primary-btn {
+      height: 45px;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      border: none;
+      border-radius: 4px;
+    }
   }
 }
 
@@ -721,6 +741,13 @@
     &.primary-btn {
       background-color: $primary-color;
       color: #fff;
+      height: 45px;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      border: none;
+      border-radius: 4px;
+      padding: 0 20px;
     }
 
     &.cancel-btn {

--
Gitblit v1.9.3