diff --git a/WebContent/WEB-INF/view/productionplanning/mBomPopupLeft.jsp b/WebContent/WEB-INF/view/productionplanning/mBomPopupLeft.jsp index 668899a..a75d67a 100644 --- a/WebContent/WEB-INF/view/productionplanning/mBomPopupLeft.jsp +++ b/WebContent/WEB-INF/view/productionplanning/mBomPopupLeft.jsp @@ -1020,8 +1020,10 @@ function fn_initGrid() { // 서버에서 전달받은 데이터 확인 var bomTreeData = ${bomTreeListJson}; + var bomDataType = '${bomDataType}'; console.log("bomTreeData:", bomTreeData); console.log("bomTreeData length:", bomTreeData ? bomTreeData.length : 0); + console.log("bomDataType:", bomDataType); // 대소문자 무관하게 필드값 가져오기 (PostgreSQL map은 소문자, UpperKeyMap은 대문자) function fn_getField(row, upperName) { @@ -1093,9 +1095,10 @@ function fn_initGrid() { } else { row.ORDER_QTY = fn_calcOrderQty(row); } - - // 가공업체 기본값: Level 2 이상 비구매품에만 RPS 설정 (Level 1 제외) - if(!row.PROCESSING_VENDOR) { + + // 가공업체 기본값: 할당(ASSIGNED_*/TEMPLATE) 단계의 신규 표시에만 RPS 자동주입. + // SAVED는 사용자가 저장한 값(빈값 포함)을 그대로 보존. + if(bomDataType !== 'SAVED' && !row.PROCESSING_VENDOR) { var partTypeTitle = row.PART_TYPE_TITLE || row.part_type_title || ''; var level = parseInt(row.LEVEL || row.LEV || 0); if(level > 1 && partTypeTitle.indexOf('구매품') < 0) { diff --git a/src/com/pms/controller/ProductionPlanningController.java b/src/com/pms/controller/ProductionPlanningController.java index 52f26f3..9a49bb8 100644 --- a/src/com/pms/controller/ProductionPlanningController.java +++ b/src/com/pms/controller/ProductionPlanningController.java @@ -1259,6 +1259,7 @@ public class ProductionPlanningController extends BaseService { request.setAttribute("MAXLEV", maxLevel); request.setAttribute("bomTreeListJson", gson.toJson(mbomDetailList)); + request.setAttribute("bomDataType", bomDataType); return "/productionplanning/mBomPopupLeft"; } } @@ -1270,6 +1271,7 @@ public class ProductionPlanningController extends BaseService { // 데이터가 없을 때 빈 배열 설정 request.setAttribute("MAXLEV", 1); request.setAttribute("bomTreeListJson", "[]"); + request.setAttribute("bomDataType", ""); return "/productionplanning/mBomPopupLeft"; }