| | |
| | | const n = Number(fromApi); |
| | | if (!Number.isNaN(n)) return n; |
| | | } |
| | | const quantity = Number(form.value.quantity); |
| | | const qualified = Number(form.value.qualifiedQuantity); |
| | | if (!quantity || Number.isNaN(quantity)) return null; |
| | | const qualifiedNum = Number.isNaN(qualified) ? 0 : qualified; |
| | | return (qualifiedNum / quantity) * 100; |
| | | const qualified = Number(form.value.qualifiedQuantity) || 0; |
| | | const unqualified = Number(form.value.unqualifiedQuantity) || 0; |
| | | const total = qualified + unqualified; |
| | | if (!total || total === 0) return null; |
| | | return (qualified / total) * 100; |
| | | }); |
| | | |
| | | const passRateDisplayText = computed(() => { |
| | |
| | | if (operationType.value === "edit" || operationType.value === "view") { |
| | | // 先保存 testStandardId,避免被清空 |
| | | const savedTestStandardId = row.testStandardId; |
| | | // 先设置表单数据,但暂时清空 testStandardId,等选项加载完成后再设置 |
| | | form.value = { ...row, testStandardId: "" }; |
| | | const { passRate, ...rowWithoutPassRate } = row; |
| | | form.value = { ...rowWithoutPassRate, testStandardId: "" }; |
| | | currentProductId.value = row.productId || 0; |
| | | // 关键:编辑时加载规格型号下拉选项,才能反显 productModelId |
| | | if (currentProductId.value) { |