| | |
| | | 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(() => |
| | |
| | | reason.value = ''; |
| | | indicators.value.forEach((item) => { |
| | | item.value = undefined; |
| | | item.minValue = 0; |
| | | item.maxValue = 100; |
| | | item.minValue = undefined; |
| | | item.maxValue = undefined; |
| | | }); |
| | | } |
| | | |
| | |
| | | return; |
| | | } |
| | | if (!allEntered.value) { |
| | | message.warning('请先填写四项指标的实测值'); |
| | | message.warning('请填写四项指标的实测值及合格上下限'); |
| | | return; |
| | | } |
| | | if (indicators.value.some((item) => item.minValue === undefined || item.maxValue === undefined || item.minValue > item.maxValue)) { |
| | |
| | | Modal.confirm({ |
| | | title: overallPassed.value ? '确认提交合格结果?' : '确认提交不合格结果?', |
| | | content: overallPassed.value |
| | | ? `本次 ${count} 袋将统一判定合格,并从暂存库存转入所选合格库。${scopeNote}` |
| | | : `本次 ${count} 袋将从暂存库存中清除并标记不合格,同时保留不合格原因用于质量分析。${scopeNote}`, |
| | | ? `本次 ${count} 袋将统一记录为初检合格,待加工部和公司质检审批后才转入合格库。${scopeNote}` |
| | | : `本次 ${count} 袋将记录为初检不合格,保留暂存库存并等待复检。${scopeNote}`, |
| | | okText: '确认提交', |
| | | cancelText: '返回修改', |
| | | okButtonProps: { danger: !overallPassed.value }, |
| | |
| | | })), |
| | | }); |
| | | 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' }); |
| | | } |
| | |
| | | <div> |
| | | <div class="eyebrow">MES / 质量管理</div> |
| | | <h1>种子质检</h1> |
| | | <p>选择袋码、托盘码或批次码识别待检范围,录入纯度、净度、发芽率和水分,系统自动判定检验结论</p> |
| | | <p>识别待检范围并录入四项指标;合格经加工部与公司质检审批后入库,不合格先复检</p> |
| | | </div> |
| | | <div class="header-badge"><IconifyIcon icon="ep:checked" /> 袋码 / 托盘码 / 批次码</div> |
| | | </header> |
| | |
| | | |
| | | <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> |
| | | |
| | |
| | | <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> |