gaoluyang
2026-06-30 0cf02ae4495d9ccafe3bd7d1e8f85567366709b5
src/views/qualityManagement/processInspection/components/formDia.vue
@@ -217,7 +217,20 @@
         // 产品名称默认傻老大原味瓜子(质检试压)
         productTreeList({productName: '质量'}).then((res) => {
            productOptions.value = convertIdToValue(res);
            const target = res.find((item) => item.label === "傻老大原味瓜子(质检试压)");
            // 递归查找目标节点
               const findTarget = (nodes) => {
                  for (const node of nodes) {
                     if (node.label === "傻老大原味瓜子(质检试压)") {
                        return node;
                     }
                     if (node.children && node.children.length > 0) {
                        const found = findTarget(node.children);
                        if (found) return found;
                     }
                  }
                  return null;
               };
               const target = findTarget(res);
            if (target) {
               form.value.productId = target.id;
               form.value.productName = target.label;