From 4a6d3a90ae6a277b1630a64ef662d63747e78d99 Mon Sep 17 00:00:00 2001 From: hjjeong Date: Thu, 15 Jan 2026 17:23:37 +0900 Subject: [PATCH] =?UTF-8?q?mbom=EC=BB=AC=EB=9F=BC=20=EB=B3=80=EA=B2=BD,=20?= =?UTF-8?q?=EA=B5=AC=EB=A7=A4=EB=A6=AC=EC=8A=A4=ED=8A=B8=EB=A1=9C=20?= =?UTF-8?q?=EB=84=98=EA=B8=B8=20=EB=95=8C=20=EC=A0=9C=EC=9E=91=EC=88=98?= =?UTF-8?q?=EB=9F=89=200=EC=9D=B8=EA=B2=83=20=EC=A0=9C=EC=99=B8=20?= =?UTF-8?q?=EB=93=B1..?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../view/productionplanning/mBomPopupFs.jsp | 2 +- .../view/productionplanning/mBomPopupLeft.jsp | 114 +++++++++++------- .../productionplanning/mBomPopupRight.jsp | 15 +-- .../view/salesMng/salesRequestMngRegList.jsp | 2 +- src/com/pms/mapper/productionplanning.xml | 12 +- src/com/pms/mapper/salesMng.xml | 1 + 6 files changed, 94 insertions(+), 52 deletions(-) diff --git a/WebContent/WEB-INF/view/productionplanning/mBomPopupFs.jsp b/WebContent/WEB-INF/view/productionplanning/mBomPopupFs.jsp index b15b1f6..b955381 100644 --- a/WebContent/WEB-INF/view/productionplanning/mBomPopupFs.jsp +++ b/WebContent/WEB-INF/view/productionplanning/mBomPopupFs.jsp @@ -1,5 +1,5 @@ <%String objId = com.pms.common.utils.CommonUtils.checkNull(request.getParameter("objId"));%> - + diff --git a/WebContent/WEB-INF/view/productionplanning/mBomPopupLeft.jsp b/WebContent/WEB-INF/view/productionplanning/mBomPopupLeft.jsp index d6a05df..6c7848a 100644 --- a/WebContent/WEB-INF/view/productionplanning/mBomPopupLeft.jsp +++ b/WebContent/WEB-INF/view/productionplanning/mBomPopupLeft.jsp @@ -372,7 +372,7 @@ function fn_initGrid() { { headerHozAlign: 'center', hozAlign: 'center', - width: 60, + width: 50, title: 'PDF', field: 'CU03_CNT', visible: true, @@ -416,7 +416,7 @@ function fn_initGrid() { { headerHozAlign: 'center', hozAlign: 'left', - width: 150, + width: 100, title: '메이커', field: 'MAKER', visible: true @@ -424,7 +424,7 @@ function fn_initGrid() { { headerHozAlign: 'center', hozAlign: 'left', - width: 100, + width: 70, title: '범주이름', field: 'PART_TYPE_TITLE', visible: true @@ -470,9 +470,9 @@ function fn_initGrid() { headerHozAlign: 'center', hozAlign: 'left', width: 100, - title: '소재', + title: '소재재질', field: 'RAW_MATERIAL', - titleFormatter: function() { return '소재'; }, + titleFormatter: function() { return '소재재질'; }, editor: function(cell, onRendered, success, cancel, editorParams) { // 소재 목록을 Select2용 형태로 변환 var options = materialList.map(function(m) { return {id: m, text: m}; }); @@ -499,9 +499,9 @@ function fn_initGrid() { headerHozAlign: 'center', hozAlign: 'left', width: 100, - title: '사이즈', + title: '규격', field: 'SIZE', - titleFormatter: function() { return '사이즈'; }, + titleFormatter: function() { return '규격'; }, editor: function(cell, onRendered, success, cancel, editorParams) { // 선택된 소재에 따라 동적으로 사이즈 목록 로드 var data = cell.getRow().getData(); @@ -578,14 +578,15 @@ function fn_initGrid() { { headerHozAlign: 'center', hozAlign: 'right', - width: 100, + width: 90, title: '소재소요량', field: 'REQUIRED_QTY', titleFormatter: function() { return '소재소요량'; }, editor: 'number', editorParams: { min: 0, - step: 0.01 // 소수 가능 + step: 0.01, + selectContents: true // 편집 시 기존 값 전체 선택 }, editable: function(cell) { return cell.getRow().getData().SUPPLY_TYPE === '사급'; @@ -600,7 +601,7 @@ function fn_initGrid() { { headerHozAlign: 'center', hozAlign: 'right', - width: 120, + width: 90, title: '소재발주수량', field: 'ORDER_QTY', editor: false, @@ -628,20 +629,22 @@ function fn_initGrid() { { headerHozAlign: 'center', hozAlign: 'right', - width: 100, + width: 80, title: '제작수량', field: 'PRODUCTION_QTY', titleFormatter: function() { return '제작수량'; }, editor: 'number', editorParams: { min: 0, - step: 1 + step: 1, + selectContents: true // 편집 시 기존 값 전체 선택 }, formatter: function(cell) { // 저장된 값이 있으면 그대로 사용, 없으면 항목수량 × 수주수량으로 계산 var value = cell.getValue(); - if(value === undefined || value === null || value === '' || value === 0) { + // 0은 유효한 값이므로 제외 (undefined, null, '' 만 기본값 계산) + if(value === undefined || value === null || value === '') { var data = cell.getRow().getData(); var itemQty = parseFloat(data.ITEM_QTY) || 0; value = itemQty * projectQuantity; @@ -681,6 +684,18 @@ function fn_initGrid() { return value; } }, + { + headerHozAlign: 'center', + hozAlign: 'right', + width: 100, + title: '가공단가', + field: 'PROCESSING_UNIT_PRICE', + editor: false, // 구매쪽에서 입력 + formatter: function(cell) { + var value = cell.getValue(); + return value ? Number(value).toLocaleString() : '-'; + } + }, /* 주석처리: 가공납기, 연삭납기 컬럼 { headerHozAlign: 'center', @@ -736,30 +751,30 @@ function fn_initGrid() { headerHozAlign: 'center', hozAlign: 'right', width: 100, - title: '단가', + title: '소재단가', field: 'UNIT_PRICE', editor: false, // 구매쪽에서 입력 formatter: function(cell) { var value = cell.getValue(); return value ? Number(value).toLocaleString() : '-'; } - }, - { - headerHozAlign: 'center', - hozAlign: 'right', - width: 100, - title: '금액', - field: 'TOTAL_PRICE', - editor: false, - formatter: function(cell) { - // 항목수량 × 단가 - var data = cell.getRow().getData(); - var itemQty = parseFloat(data.ITEM_QTY) || 0; - var unitPrice = parseFloat(data.UNIT_PRICE) || 0; - var totalPrice = itemQty * unitPrice; - return totalPrice > 0 ? totalPrice.toLocaleString() : '-'; - } } + // { + // headerHozAlign: 'center', + // hozAlign: 'right', + // width: 100, + // title: '금액', + // field: 'TOTAL_PRICE', + // editor: false, + // formatter: function(cell) { + // // 항목수량 × 단가 + // var data = cell.getRow().getData(); + // var itemQty = parseFloat(data.ITEM_QTY) || 0; + // var unitPrice = parseFloat(data.UNIT_PRICE) || 0; + // var totalPrice = itemQty * unitPrice; + // return totalPrice > 0 ? totalPrice.toLocaleString() : '-'; + // } + // } ] }); @@ -1103,7 +1118,8 @@ function getMbomTreeData() { // 구매 정보 vendor: row.VENDOR || row.VENDOR_PM, // 공급업체 코드/OBJID (기존 값 유지) - unitPrice: toNumber(row.UNIT_PRICE), + unitPrice: toNumber(row.UNIT_PRICE), // 소재단가 + processingUnitPrice: toNumber(row.PROCESSING_UNIT_PRICE), // 가공단가 // totalPrice 계산: 항목수량 × 단가 totalPrice: (function() { var itemQty = parseFloat(row.ITEM_QTY) || 0; @@ -1130,19 +1146,35 @@ function getMbomTreeData() { return mbomData; } + +// 엑셀 다운로드 (CSV 형식) +function fn_excel() { + if(!_tabulGrid) { + Swal.fire('데이터가 없습니다.'); + return; + } + + // 파일명 생성 (현재 날짜 포함) + var today = new Date(); + var dateStr = today.getFullYear() + '_' + + String(today.getMonth() + 1).padStart(2, '0') + '_' + + String(today.getDate()).padStart(2, '0') + '_' + + String(today.getHours()).padStart(2, '0') + '_' + + String(today.getMinutes()).padStart(2, '0'); + var fileName = 'M-BOM_' + dateStr + '.csv'; + + // Tabulator 내장 다운로드 기능 사용 (CSV) + _tabulGrid.download("csv", fileName, { + delimiter: ",", + bom: true // 한글 깨짐 방지 (UTF-8 BOM) + }); +} - +
+ +
diff --git a/WebContent/WEB-INF/view/productionplanning/mBomPopupRight.jsp b/WebContent/WEB-INF/view/productionplanning/mBomPopupRight.jsp index 1bdb52e..50474ff 100644 --- a/WebContent/WEB-INF/view/productionplanning/mBomPopupRight.jsp +++ b/WebContent/WEB-INF/view/productionplanning/mBomPopupRight.jsp @@ -51,8 +51,11 @@ body, html { + + + - + @@ -126,8 +127,8 @@ function initEbomTable() { {formatter:"rowSelection", titleFormatter:"rowSelection", hozAlign:"center", vertAlign:"middle", headerSort:false, width: 40}, {title: "품번", field: "PART_NO", widthGrow: 1.5, vertAlign:"middle"}, {title: "품명", field: "PART_NAME", widthGrow: 2, vertAlign:"middle"}, - {title: "재료", field: "MATERIAL", widthGrow: 1.2, vertAlign:"middle"}, - {title: "메이커", field: "MAKER", widthGrow: 1.5, vertAlign:"middle"} + //{title: "재료", field: "MATERIAL", widthGrow: 1.2, vertAlign:"middle"}, + //{title: "메이커", field: "MAKER", widthGrow: 1.5, vertAlign:"middle"} ], placeholder: "검색 결과가 없습니다." }); diff --git a/WebContent/WEB-INF/view/salesMng/salesRequestMngRegList.jsp b/WebContent/WEB-INF/view/salesMng/salesRequestMngRegList.jsp index edf6190..38e8c66 100644 --- a/WebContent/WEB-INF/view/salesMng/salesRequestMngRegList.jsp +++ b/WebContent/WEB-INF/view/salesMng/salesRequestMngRegList.jsp @@ -670,7 +670,7 @@ function fn_executeCreateProposal(salesRequestObjid, targetParts) {
- +
diff --git a/src/com/pms/mapper/productionplanning.xml b/src/com/pms/mapper/productionplanning.xml index 841269f..f79103a 100644 --- a/src/com/pms/mapper/productionplanning.xml +++ b/src/com/pms/mapper/productionplanning.xml @@ -3294,6 +3294,7 @@ 0 AS PO_QTY, '' AS VENDOR, 0 AS UNIT_PRICE, + 0 AS PROCESSING_UNIT_PRICE, 0 AS TOTAL_PRICE, 1 AS LEVEL FROM @@ -3374,6 +3375,7 @@ 0 AS PO_QTY, '' AS VENDOR, 0 AS UNIT_PRICE, + 0 AS PROCESSING_UNIT_PRICE, 0 AS TOTAL_PRICE, 1 AS LEVEL FROM @@ -3850,7 +3852,7 @@ PROCESSING_VENDOR, PROCESSING_DEADLINE, GRINDING_DEADLINE, REQUIRED_QTY, ORDER_QTY, PRODUCTION_QTY, STOCK_QTY, SHORTAGE_QTY, NET_QTY, PO_QTY, - VENDOR, UNIT_PRICE, TOTAL_PRICE, CURRENCY, LEAD_TIME, MIN_ORDER_QTY, + VENDOR, UNIT_PRICE, PROCESSING_UNIT_PRICE, TOTAL_PRICE, CURRENCY, LEAD_TIME, MIN_ORDER_QTY, PROPOSAL_DATE, @@ -3863,7 +3865,7 @@ #{processingVendor}, #{processingDeadline}, #{grindingDeadline}, #{requiredQty}, #{orderQty}, #{productionQty}, #{stockQty}, #{shortageQty}, #{netQty}, #{poQty}, - #{vendor}, #{unitPrice}, #{totalPrice}, #{currency}, #{leadTime}, #{minOrderQty}, + #{vendor}, #{unitPrice}, #{processingUnitPrice}, #{totalPrice}, #{currency}, #{leadTime}, #{minOrderQty}, #{proposalDate}, @@ -4049,6 +4051,7 @@ MD.PO_QTY, MD.VENDOR, MD.UNIT_PRICE, + MD.PROCESSING_UNIT_PRICE, MD.TOTAL_PRICE, MD.CURRENCY, MD.LEAD_TIME, @@ -4102,6 +4105,7 @@ SHORTAGE_QTY, VENDOR, UNIT_PRICE, + PROCESSING_UNIT_PRICE, TOTAL_PRICE, CURRENCY, LEAD_TIME, @@ -4146,6 +4150,7 @@ A.SHORTAGE_QTY, A.VENDOR, A.UNIT_PRICE, + A.PROCESSING_UNIT_PRICE, A.TOTAL_PRICE, A.CURRENCY, A.LEAD_TIME, @@ -4198,6 +4203,7 @@ B.SHORTAGE_QTY, B.VENDOR, B.UNIT_PRICE, + B.PROCESSING_UNIT_PRICE, B.TOTAL_PRICE, B.CURRENCY, B.LEAD_TIME, @@ -4250,6 +4256,7 @@ V.VENDOR, (SELECT CLIENT_NM FROM CLIENT_MNG WHERE OBJID::VARCHAR = V.VENDOR) AS VENDOR_NAME, V.UNIT_PRICE, + V.PROCESSING_UNIT_PRICE, V.TOTAL_PRICE, V.CURRENCY, V.LEAD_TIME, @@ -4412,6 +4419,7 @@ NULL AS SHORTAGE_QTY, NULL AS VENDOR, NULL AS UNIT_PRICE, + NULL AS PROCESSING_UNIT_PRICE, NULL AS TOTAL_PRICE, NULL AS CURRENCY, NULL AS LEAD_TIME, diff --git a/src/com/pms/mapper/salesMng.xml b/src/com/pms/mapper/salesMng.xml index 3009f6a..e2a542e 100644 --- a/src/com/pms/mapper/salesMng.xml +++ b/src/com/pms/mapper/salesMng.xml @@ -3356,6 +3356,7 @@ SELECT FROM VIEW_BOM V LEFT JOIN PART_MNG P ON P.OBJID::VARCHAR = V.PART_OBJID::VARCHAR WHERE 1=1 + AND COALESCE(V.PRODUCTION_QTY, 0) > 0 -- 제작수량이 0인 항목 제외 ORDER BY V.PATH2