diff --git a/WebContent/WEB-INF/view/partMng/structureBomCopyFormPopup.jsp b/WebContent/WEB-INF/view/partMng/structureBomCopyFormPopup.jsp
index ce7101d..1d3989a 100644
--- a/WebContent/WEB-INF/view/partMng/structureBomCopyFormPopup.jsp
+++ b/WebContent/WEB-INF/view/partMng/structureBomCopyFormPopup.jsp
@@ -717,11 +717,11 @@ function fn_excel() {
|
-
+
|
|
-
+
|
|
diff --git a/WebContent/WEB-INF/view/productionplanning/mBomHeaderPopup.jsp b/WebContent/WEB-INF/view/productionplanning/mBomHeaderPopup.jsp
index ddb36dc..8c9e7cd 100644
--- a/WebContent/WEB-INF/view/productionplanning/mBomHeaderPopup.jsp
+++ b/WebContent/WEB-INF/view/productionplanning/mBomHeaderPopup.jsp
@@ -58,6 +58,7 @@ $(function(){
// 저장된 M-BOM 품번 조회 및 표시
var projectObjId = "${info.OBJID}";
+
$.ajax({
url: "/productionplanning/getLatestMbomByProjectId.do",
type: "POST",
@@ -68,7 +69,29 @@ $(function(){
if(response && response.MBOM_NO) {
console.log("저장된 M-BOM 발견:", response);
$("#search_mbom_part_no").val(response.MBOM_NO);
- $("#search_save_date").val(response.REGDATE);
+
+ // 날짜 형식 변환 (타임스탬프 또는 문자열 -> YYYY-MM-DD)
+ var regDate = response.REGDATE;
+ if(regDate) {
+ var dateStr = "";
+
+ // 타임스탬프(숫자)인 경우
+ if(typeof regDate === 'number') {
+ var date = new Date(regDate);
+ var year = date.getFullYear();
+ var month = String(date.getMonth() + 1).padStart(2, '0');
+ var day = String(date.getDate()).padStart(2, '0');
+ dateStr = year + '-' + month + '-' + day;
+ }
+ // 문자열인 경우 (YYYY-MM-DD HH:mm:ss 형식)
+ else if(typeof regDate === 'string') {
+ dateStr = regDate.split(' ')[0];
+ }
+
+ $("#search_save_date").val(dateStr);
+ } else {
+ $("#search_save_date").val("");
+ }
} else {
console.log("저장된 M-BOM 없음");
$("#search_mbom_part_no").val("");
@@ -126,7 +149,7 @@ $(function(){
// 닫기 버튼 클릭
$("#btnClose").click(function(){
- window.close();
+ fn_closeWindow();
});
// 일괄 적용 버튼 클릭
@@ -306,7 +329,7 @@ function fn_saveMbom() {
}
// 현재 창 닫기
- window.close();
+ fn_closeWindow();
} else {
alert("M-BOM 저장에 실패했습니다: " + (data.message || ""));
}
@@ -792,30 +815,30 @@ function compareItemFields(before, after) {
|
|
-
+
|
|
-
+
|
|
-
+
|
|
-
+
+ |
+ |
+
+
+
+
|
-
-
-
-
-
- |
|
@@ -827,7 +850,7 @@ function compareItemFields(before, after) {
|
-
+ |
|
@@ -1087,6 +1110,27 @@ function fn_mbomChangePart() {
function generateTempId() {
return -Math.floor(Math.random() * 1000000000);
}
+
+// 창 닫기 함수 (프레임 구조 고려)
+function fn_closeWindow() {
+ try {
+ // 최상위 창(frameset)을 닫기
+ if(window.top && window.top.opener) {
+ // 팝업으로 열린 경우
+ window.top.close();
+ } else if(window.parent && window.parent !== window) {
+ // 프레임 내부인 경우 최상위 창 닫기 시도
+ window.top.close();
+ } else {
+ // 일반 창인 경우
+ window.close();
+ }
+ } catch(e) {
+ console.error("창 닫기 오류:", e);
+ // 오류 발생 시 강제로 닫기 시도
+ window.top.close();
+ }
+}