From 8a9338f2f43bfe936124feaaa22420b4ca86eb84 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期一, 19 十月 2026 11:31:24 +0800
Subject: [PATCH] feat(qc): 完善质检流程功能

---
 src/views/mes/qc/seedQuality/index.vue |   33 ++++++++++++++++++---------------
 1 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/src/views/mes/qc/seedQuality/index.vue b/src/views/mes/qc/seedQuality/index.vue
index 6e2bc93..a034bc7 100644
--- a/src/views/mes/qc/seedQuality/index.vue
+++ b/src/views/mes/qc/seedQuality/index.vue
@@ -54,17 +54,20 @@
 const qualifiedWarehouseId = ref<number>();
 
 const indicators = ref<IndicatorForm[]>([
-  { code: 'purity', label: '绾害', unit: '%', minValue: 0, maxValue: 100 },
-  { code: 'cleanliness', label: '鍑�搴�', unit: '%', minValue: 0, maxValue: 100 },
-  { code: 'germination_rate', label: '鍙戣娊鐜�', unit: '%', minValue: 0, maxValue: 100 },
-  { code: 'moisture', label: '姘村垎', unit: '%', minValue: 0, maxValue: 100 },
+  { code: 'purity', label: '绾害', unit: '%' },
+  { code: 'cleanliness', label: '鍑�搴�', unit: '%' },
+  { code: 'germination_rate', label: '鍙戣娊鐜�', unit: '%' },
+  { code: 'moisture', label: '姘村垎', unit: '%' },
 ]);
 
 const pendingCount = computed(() => target.value?.pendingBagIds?.length ?? 0);
 const completedCount = computed(() => target.value?.completedBagIds?.length ?? 0);
 const enteredCount = computed(() => indicators.value.filter((item) => item.value !== undefined && item.value !== null).length);
 const passedCount = computed(() => indicators.value.filter(isPassed).length);
-const allEntered = computed(() => enteredCount.value === indicators.value.length);
+const allEntered = computed(() => indicators.value.every((item) =>
+  item.value !== undefined && item.value !== null
+  && item.minValue !== undefined && item.minValue !== null
+  && item.maxValue !== undefined && item.maxValue !== null));
 const overallPassed = computed(() => allEntered.value && passedCount.value === indicators.value.length);
 const isGroupScan = computed(() => scanType.value !== 'BAG');
 const qualifiedWarehouseOptions = computed(() =>
@@ -99,8 +102,8 @@
   reason.value = '';
   indicators.value.forEach((item) => {
     item.value = undefined;
-    item.minValue = 0;
-    item.maxValue = 100;
+    item.minValue = undefined;
+    item.maxValue = undefined;
   });
 }
 
@@ -163,7 +166,7 @@
     return;
   }
   if (!allEntered.value) {
-    message.warning('璇峰厛濉啓鍥涢」鎸囨爣鐨勫疄娴嬪��');
+    message.warning('璇峰~鍐欏洓椤规寚鏍囩殑瀹炴祴鍊煎強鍚堟牸涓婁笅闄�');
     return;
   }
   if (indicators.value.some((item) => item.minValue === undefined || item.maxValue === undefined || item.minValue > item.maxValue)) {
@@ -187,8 +190,8 @@
     Modal.confirm({
       title: overallPassed.value ? '纭鎻愪氦鍚堟牸缁撴灉锛�' : '纭鎻愪氦涓嶅悎鏍肩粨鏋滐紵',
       content: overallPassed.value
-        ? `鏈 ${count} 琚嬪皢缁熶竴鍒ゅ畾鍚堟牸锛屽苟浠庢殏瀛樺簱瀛樿浆鍏ユ墍閫夊悎鏍煎簱銆�${scopeNote}`
-        : `鏈 ${count} 琚嬪皢浠庢殏瀛樺簱瀛樹腑娓呴櫎骞舵爣璁颁笉鍚堟牸锛屽悓鏃朵繚鐣欎笉鍚堟牸鍘熷洜鐢ㄤ簬璐ㄩ噺鍒嗘瀽銆�${scopeNote}`,
+        ? `鏈 ${count} 琚嬪皢缁熶竴璁板綍涓哄垵妫�鍚堟牸锛屽緟鍔犲伐閮ㄥ拰鍏徃璐ㄦ瀹℃壒鍚庢墠杞叆鍚堟牸搴撱��${scopeNote}`
+        : `鏈 ${count} 琚嬪皢璁板綍涓哄垵妫�涓嶅悎鏍硷紝淇濈暀鏆傚瓨搴撳瓨骞剁瓑寰呭妫�銆�${scopeNote}`,
       okText: '纭鎻愪氦',
       cancelText: '杩斿洖淇敼',
       okButtonProps: { danger: !overallPassed.value },
@@ -216,7 +219,7 @@
       })),
     });
     submittedCount.value = result.processedCount;
-    message.success(`鏈 ${result.processedCount} 琚嬪凡鎻愪氦锛�${passed ? '璐ㄦ鍚堟牸锛屽凡杞叆鎵�閫夊悎鏍煎簱' : '璐ㄦ涓嶅悎鏍硷紝宸茶褰曞師鍥犲苟绉婚櫎鏆傚瓨搴撳瓨'}`);
+    message.success(`鏈 ${result.processedCount} 琚嬪凡鎻愪氦锛�${passed ? '鍒濇鍚堟牸锛屽緟涓ょ骇瀹℃壒' : '鍒濇涓嶅悎鏍硷紝寰呭妫�'}`);
     if (pageRoot.value && !window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
       gsap.fromTo('.result-card', { scale: 0.97, autoAlpha: 0.5 }, { scale: 1, autoAlpha: 1, duration: 0.35, ease: 'power2.out' });
     }
@@ -263,7 +266,7 @@
       <div>
         <div class="eyebrow">MES / 璐ㄩ噺绠$悊</div>
         <h1>绉嶅瓙璐ㄦ</h1>
-        <p>閫夋嫨琚嬬爜銆佹墭鐩樼爜鎴栨壒娆$爜璇嗗埆寰呮鑼冨洿锛屽綍鍏ョ函搴︺�佸噣搴︺�佸彂鑺界巼鍜屾按鍒嗭紝绯荤粺鑷姩鍒ゅ畾妫�楠岀粨璁�</p>
+        <p>璇嗗埆寰呮鑼冨洿骞跺綍鍏ュ洓椤规寚鏍囷紱鍚堟牸缁忓姞宸ラ儴涓庡叕鍙歌川妫�瀹℃壒鍚庡叆搴擄紝涓嶅悎鏍煎厛澶嶆</p>
       </div>
       <div class="header-badge"><IconifyIcon icon="ep:checked" /> 琚嬬爜 / 鎵樼洏鐮� / 鎵规鐮�</div>
     </header>
@@ -318,14 +321,14 @@
 
           <a-divider orientation="left">鎸囨爣缁撴灉</a-divider>
           <div class="indicator-list">
-            <div v-for="item in indicators" :key="item.code" class="indicator-row" :class="{ failed: !isPassed(item) }">
+            <div v-for="item in indicators" :key="item.code" class="indicator-row" :class="{ failed: allEntered && !isPassed(item) }">
               <div class="indicator-name"><span class="indicator-dot" :class="isPassed(item) ? 'pass' : 'fail'" /><strong>{{ item.label }}</strong><small>{{ item.unit }}</small></div>
               <a-input-number v-model:value="item.value" class="indicator-input" :disabled="loading" :min="0" :precision="3" placeholder="瀹炴祴鍊�" />
               <span class="range-separator">鑼冨洿</span>
               <a-input-number v-model:value="item.minValue" class="range-input" :disabled="loading" :min="0" :precision="3" placeholder="涓嬮檺" />
               <span>鈥�</span>
               <a-input-number v-model:value="item.maxValue" class="range-input" :disabled="loading" :min="0" :precision="3" placeholder="涓婇檺" />
-              <a-tag :color="isPassed(item) ? 'success' : 'error'">{{ isPassed(item) ? '鍚堟牸' : '瓒呭嚭鑼冨洿' }}</a-tag>
+              <a-tag :color="!allEntered ? 'default' : isPassed(item) ? 'success' : 'error'">{{ !allEntered ? '寰呭綍鍏�' : isPassed(item) ? '鍚堟牸' : '瓒呭嚭鑼冨洿' }}</a-tag>
             </div>
           </div>
 
@@ -338,7 +341,7 @@
         <template #title><div class="card-title"><IconifyIcon icon="ep:data-analysis" />鍒ゅ畾璇存槑</div></template>
         <div class="result-hero" :class="overallPassed ? 'passed' : allEntered ? 'failed-result' : 'pending-result'"><IconifyIcon :icon="overallPassed ? 'ep:circle-check-filled' : allEntered ? 'ep:warning-filled' : 'ep:edit-pen'" /><strong>{{ overallPassed ? '褰撳墠缁撴灉鍚堟牸' : allEntered ? '褰撳墠瀛樺湪涓嶅悎鏍奸」' : '绛夊緟褰曞叆鎸囨爣' }}</strong><span>{{ allEntered ? '瀹炴祴鍊奸渶澶勪簬鏈�灏忓�间笌鏈�澶у�间箣闂�' : `宸插綍鍏� ${enteredCount} / 4 椤瑰疄娴嬪�糮 }}</span></div>
         <div class="rule-list"><div><IconifyIcon icon="ep:check" /><span>鍏堣瘑鍒爜鍊煎啀褰曞叆鎸囨爣锛屽洓椤规寚鏍囧繀椤诲叏閮ㄦ彁浜�</span></div><div><IconifyIcon icon="ep:check" /><span>杈圭晫鍊兼寜鍚堟牸澶勭悊</span></div><div><IconifyIcon icon="ep:check" /><span>鎵樼洏鐮併�佹壒娆$爜鐨勭粨璁哄簲鐢ㄤ簬鏈鍏ㄩ儴寰呮琚�</span></div><div><IconifyIcon icon="ep:check" /><span>涓嶅悎鏍肩粨鏋滈渶淇濈暀鍘熷洜</span></div><div><IconifyIcon icon="ep:check" /><span>璐ㄦ鍛樹笌妫�楠屾椂闂寸敱鏈嶅姟绔褰�</span></div></div>
-        <a-alert message="搴撳瓨娴佽浆鐢卞悗绔鐞�" description="鍚堟牸琚嬪皢浠庢殏瀛樺簱瀛樿浆鍏ユ墍閫夊悎鏍煎簱锛涗笉鍚堟牸琚嬪皢鐩存帴娓呴櫎鏆傚瓨搴撳瓨骞朵繚鐣欎笉鍚堟牸鍘熷洜銆傛彁浜ゆ椂鏈嶅姟绔細閲嶆柊鏍稿鏈寰呮琚嬫竻鍗曪紝娓呭崟鍙樺寲闇�閲嶆柊璇嗗埆銆�" type="info" show-icon />
+        <a-alert message="瀹℃壒瀹屾垚鍚庢祦杞簱瀛�" description="鍒濇涓嶆敼鍙樺簱瀛橈紱涓嶅悎鏍煎緟澶嶆銆傚妫�缁撹缁忓姞宸ラ儴鍜屽叕鍙歌川妫�瀹℃壒鍚庯紝鍚堟牸琚嬫墠杞叆鍚堟牸搴擄紝涓嶅悎鏍艰鎵嶆姤搴熴��" type="info" show-icon />
         <div v-if="submittedCount" class="success-note"><IconifyIcon icon="ep:success-filled" /><span>鏈�杩戞彁浜よ川妫�锛�<strong>{{ submittedCount }} 琚�</strong></span></div>
       </a-card>
     </section>

--
Gitblit v1.9.3