fix: normalizacao de marca_componente para restricao check_marca_componente_range

This commit is contained in:
2026-09-16 16:30:32 +00:00
parent 94f9efeb95
commit c9e847f13f
4 changed files with 57 additions and 8 deletions
+10 -1
View File
@@ -626,8 +626,17 @@
if (isSubComp) {
currentAssembly.isComposed = 'SIM';
let cleanCompMark = itemMark;
const subMatch = itemMark.match(/-?(\d{4,})$/) || itemMark.match(/(\d{4,})/);
if (subMatch) {
cleanCompMark = subMatch[1];
} else if (itemMark === '-' || !/^\d{4}$/.test(itemMark)) {
cleanCompMark = String(1000 + currentAssembly.components.length);
}
currentAssembly.components.push({
marca: itemMark,
marca: cleanCompMark,
quantidade: itemQuant,
perfil: itemDesc || currentAssembly.descricao,
material: detectedMaterial || 'A36',