| | |
| | | if (node?.id !== null && node?.id !== undefined) return String(node.id); |
| | | if (node?.nodeType === "batch") return String(node.batchNo ?? node.label ?? ""); |
| | | if (node?.nodeType === "customer") return String(node.customer ?? node.label ?? ""); |
| | | if (node?.nodeType === "model") return String(node.model ?? node.label ?? ""); |
| | | if (node?.nodeType === "model") return String(node.productModelId ?? node.model ?? node.label ?? ""); |
| | | return String(node.productName ?? node.label ?? ""); |
| | | }; |
| | | |
| | |
| | | const prevBatchNo = productForm.value.batchNo; |
| | | const prevCustomer = productForm.value.customer; |
| | | |
| | | productForm.value.productModelId = modelNode.value; |
| | | productForm.value.specificationModel = modelNode.model ?? modelNode.label ?? ""; |
| | | // 有些接口/树数据里可能不包含 unit,这种情况下不要覆盖编辑时已回显的值 |
| | | const nextUnit = modelNode.unit ?? ""; |
| | |
| | | return { |
| | | // 台账字段 |
| | | productCategory: p.product || p.productName || "", |
| | | productModelId: p.productModelId || "", |
| | | specificationModel: p.specification || "", |
| | | uidNo: p.uidNo || "", |
| | | unit: p.unit || "", |