Merge pull request 'V2025111901' (#77) from V2025111901 into main

Reviewed-on: #77
This commit was merged in pull request #77.
This commit is contained in:
2025-11-26 06:17:26 +00:00
9 changed files with 562 additions and 88 deletions

View File

@@ -301,13 +301,13 @@ function fn_search(){
_tabulGrid.on("renderComplete", function(){
fn_calculateTotalFromGrid();
// 그리드 렌더링 완료 후 높이 계산
fnc_calculateContentHeight("gridDiv", 20);
fnc_calculateContentHeight("gridDiv", 30);
});
}
// 윈도우 리사이즈 이벤트 (한 번만 등록)
$(window).off("resize.gridHeight").on("resize.gridHeight", function() {
fnc_calculateContentHeight("gridDiv", 20);
fnc_calculateContentHeight("gridDiv", 30);
});
}

View File

@@ -386,9 +386,32 @@ function fn_saveMbom() {
if(data && data.result === "success") {
alert("M-BOM이 저장되었습니다.");
// 부모 창 새로고침
if(window.opener && window.opener.fn_search) {
window.opener.fn_search();
// 부모 창(M-BOM 목록) 새로고침
try {
// window.opener가 있으면 (팝업으로 열린 경우)
if(window.opener && !window.opener.closed) {
console.log("window.opener 찾음");
if(window.opener.fn_search) {
console.log("window.opener.fn_search 호출");
window.opener.fn_search();
} else if(window.opener.location) {
console.log("window.opener.location.reload 호출");
window.opener.location.reload();
}
}
// window.top이 현재 창이 아니면 (iframe인 경우)
else if(window.top !== window.self && window.top.opener && !window.top.opener.closed) {
console.log("window.top.opener 찾음");
if(window.top.opener.fn_search) {
console.log("window.top.opener.fn_search 호출");
window.top.opener.fn_search();
} else if(window.top.opener.location) {
console.log("window.top.opener.location.reload 호출");
window.top.opener.location.reload();
}
}
} catch(e) {
console.error("부모 창 새로고침 실패:", e);
}
// 현재 창 닫기

View File

@@ -425,13 +425,13 @@ function fn_initGrid() {
step: 1
},
formatter: function(cell) {
// 초기값은 소재발주수량과 동일
// 저장된 값이 있으면 그대로 사용, 없으면 항목수량 × 수주수량으로 계산
var value = cell.getValue();
if(value === undefined || value === null || value === '' || value === 0) {
var data = cell.getRow().getData();
// ORDER_QTY 값을 그대로 사용
value = data.ORDER_QTY || 0;
var itemQty = parseFloat(data.ITEM_QTY) || 0;
value = itemQty * projectQuantity;
// 실제 데이터에도 저장 (getMbomTreeData에서 사용)
cell.getRow().update({PRODUCTION_QTY: value}, false);

View File

@@ -33,11 +33,14 @@
$(document).ready(function(){
_fnc_datepick();
// 그리드 높이 동적 계산 (Total 합계 영역 + 여유 공간 80px)
fnc_calculateContentHeight("gridDiv", 80);
$(window).resize(function() {
fnc_calculateContentHeight("gridDiv", 80);
});
// DOM 렌더링 완료 후 그리드 높이 계산
setTimeout(function() {
fnc_calculateContentHeight("gridDiv", 10);
}, 100);
$(window).resize(function() {
fnc_calculateContentHeight("gridDiv", 10);
});
// select2가 로드되었을 때만 초기화
if(typeof $.fn !== 'undefined' && typeof $.fn.select2 === 'function') {
@@ -200,7 +203,7 @@ var columns = [
//{headerHozAlign : 'center', hozAlign : 'center', width : '120', title : '매출마감', field : 'SALES_STATUS'},
{headerHozAlign : 'center', hozAlign : 'center', width : '120', title : '매출마감', field : 'SALES_DEADLINE_DATE'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '발주일', field : 'ORDER_DATE'},
{headerHozAlign : 'center', hozAlign : 'center', width : '120', title : '발주번호', field : 'PO_NO'},
{headerHozAlign : 'center', hozAlign : 'left', width : '120', title : '발주번호', field : 'PO_NO'},
{headerHozAlign : 'center', hozAlign : 'left', width : '150', title : '고객사', field : 'CUSTOMER'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '제품구분', field : 'PRODUCT_TYPE'},
{headerHozAlign : 'center', hozAlign : 'left', width : '180', title : '품명', field : 'PRODUCT_NAME'},
@@ -296,8 +299,8 @@ var columns = [
{headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '환율', field : 'SALES_EXCHANGE_RATE',
formatter: "money", formatterParams: {thousand: ",", symbolAfter: "", precision: 2}
},
{headerHozAlign : 'center', hozAlign : 'center', width : '120', title : 'S/N', field : 'SERIAL_NO'},
{headerHozAlign : 'center', hozAlign : 'center', width : '120', title : '품번', field : 'PRODUCT_NO'}
{headerHozAlign : 'center', hozAlign : 'left', width : '120', title : 'S/N', field : 'SERIAL_NO'},
{headerHozAlign : 'center', hozAlign : 'left', width : '120', title : '품번', field : 'PRODUCT_NO'}
// 주석처리된 컬럼들 (필요없는 항목)
// {headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '접수일', field : 'RECEIPT_DATE'},
// {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '유/무상', field : 'PAYMENT_TYPE'},

View File

@@ -12,6 +12,14 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%=Constants.SYSTEM_NAME%></title>
<style>
body, html {
overflow-x: hidden;
width: 100%;
margin: 0;
padding: 0;
}
</style>
<script>
// Excel 버튼 이벤트 등록 함수
@@ -30,19 +38,14 @@
_fnc_datepick(); // 날짜 선택기 초기화
$('.select2').select2(); // select2 초기화
// 그리드 높이 동적 계산 (Total 합계 영역 + 여유 공간 80px)
fnc_calculateContentHeight("gridDiv", 80);
// 디버그: 계산된 높이 확인
console.log("=== 그리드 높이 디버그 ===");
console.log("윈도우 높이:", $(window).height());
console.log("#gridDiv 높이:", $('#gridDiv').height());
console.log("#mainGrid 높이:", $('#mainGrid').height());
$(window).resize(function() {
fnc_calculateContentHeight("gridDiv", 80);
console.log("리사이즈 후 #gridDiv 높이:", $('#gridDiv').height());
});
// DOM 렌더링 완료 후 그리드 높이 계산
setTimeout(function() {
fnc_calculateContentHeight("gridDiv", 10);
}, 100);
$(window).resize(function() {
fnc_calculateContentHeight("gridDiv", 10);
});
// 품번/품명 Select2 AJAX 초기화
initPartSelect2Ajax("#search_partNo", "#search_partName", "#search_partObjId", {
@@ -386,9 +389,9 @@ var columns = [
{headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '환율', field : 'SALES_EXCHANGE_RATE',
formatter: "money", formatterParams: {thousand: ",", symbolAfter: "", precision: 2}
},
{headerHozAlign : 'center', hozAlign : 'center', width : '120', title : 'S/N', field : 'SERIAL_NO'},
{headerHozAlign : 'center', hozAlign : 'center', width : '120', title : '품번', field : 'PRODUCT_NO'},
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '거래명세서', field : 'TRANSACTION_STATEMENT',
{headerHozAlign : 'center', hozAlign : 'left', width : '120', title : 'S/N', field : 'SERIAL_NO'},
{headerHozAlign : 'center', hozAlign : 'left', width : '120', title : '품번', field : 'PRODUCT_NO'},
{headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '거래명세서', field : 'TRANSACTION_STATEMENT',
formatter: function(cell) {
var data = cell.getRow().getData();
var projectNo = data.PROJECT_NO;