diff --git a/.gitignore b/.gitignore index c7a2dac..d758c67 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,7 @@ CLAUDE.md .playwright-mcp/ .omc/ .mcp.json +db/checkpoints/ # Phoenix (런타임/로그/작업이력 — git 불필요) phoenix/ diff --git a/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp b/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp index 9e0b650..2d985cf 100644 --- a/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp +++ b/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp @@ -366,12 +366,19 @@ var orderQuantity = $row.find(".item-order-quantity").val().replace(/,/g, "").trim(); var orderUnitPrice = $row.find(".item-order-unit-price").val().replace(/,/g, "").trim(); + var product = $row.find(".item-product").val(); + if(!product || product == "") { + alert((i+1) + "번째 품목의 제품구분을 선택해주세요."); + $row.find(".item-product").focus(); + return false; + } + if(!partObjId || partObjId == "") { alert((i+1) + "번째 품목의 품번을 선택해주세요."); $row.find(".item-part-no-select").focus(); return false; } - + if(orderQuantity == "" || orderQuantity == "0") { alert((i+1) + "번째 품목의 수주수량을 입력해주세요."); $row.find(".item-order-quantity").focus(); @@ -405,6 +412,7 @@ var item = { objId: $row.find(".item-objid").val() || '', + product: $row.find(".item-product").val(), partObjId: $row.find(".item-part-objid").val(), partNo: $row.find(".item-part-no").val() ? $row.find(".item-part-no").val().trim() : "", partName: $row.find(".item-part-name").val() ? $row.find(".item-part-name").val().trim() : "", @@ -448,7 +456,14 @@ var html = ''; html += '' + (itemCounter-1) + ''; - + + // 제품구분 드롭다운 + html += ''; + html += ''; + html += ''; + // 품번 셀렉트박스 html += ''; html += ''; + html += ''; + html += ''; + html += ''; + // 품번 셀렉트박스 html += ''; html += ''; + html += ''; + html += ''; + html += ''; + html += ''; html += ''; html += ''; @@ -744,7 +783,11 @@ // 품번/품명 옵션 채우기 fn_fillPartOptions(itemId, savedPartObjId, savedPartNo, savedPartName); - + + // 제품구분 드롭다운 초기화 + fnc_getCodeListAppend("0000001", "PRODUCT_" + itemId, savedProduct); + $("#PRODUCT_" + itemId).select2({ width: '100%' }); + // datepicker 적용 $("#" + itemId + " .date_icon").datepicker({ changeMonth: true, @@ -1534,13 +1577,11 @@ - + - + - - - + @@ -1552,13 +1593,14 @@ ${code_map.category_cd} - + <%-- 제품구분: 품목정보 그리드로 이동 --%> + <%-- + --%> - + + + + + - - - - + -
-
@@ -1596,22 +1638,22 @@ ${code_map.contract_currency}
@@ -1634,22 +1676,24 @@ - - - - - - + + + + + + + - - + + - + + @@ -1667,14 +1711,14 @@ - - + diff --git a/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp b/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp index 8ac36df..45f00cc 100644 --- a/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp +++ b/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp @@ -282,21 +282,24 @@ $(document).ready(function(){ var apprStatus = fnc_checkNull(selectedData[0].APPR_STATUS); var objId = fnc_checkNull(selectedData[0].OBJID); var estStatus = fnc_checkNull(selectedData[0].EST_STATUS); - + var addEstCnt = parseInt(fnc_checkNull(selectedData[0].ADD_EST_CNT) || "0"); + // 결재완료 또는 결재불필요 상태 확인 if(apprStatus !== "결재완료" && apprStatus !== "결재불필요"){ Swal.fire("결재완료 또는 결재불필요 상태의 견적서만 발송 가능합니다."); return false; } - - // 견적서 존재 여부 확인 - if(estStatus === "0" || estStatus === 0){ - Swal.fire("작성된 견적서가 없습니다."); + + // 견적서 존재 여부 확인 (기본 견적서 또는 추가견적 PDF 하나라도 있으면 발송 가능) + var hasBaseEst = !(estStatus === "0" || estStatus === 0 || estStatus === ""); + var hasAddEst = addEstCnt > 0; + if(!hasBaseEst && !hasAddEst){ + Swal.fire("작성된 견적서가 없습니다.
기본 견적서 또는 추가견적 PDF가 필요합니다."); return false; } - + // 메일 작성 팝업 열기 - fn_openMailFormPopup(objId); + fn_openMailFormPopup(objId, hasBaseEst, hasAddEst); } }); @@ -913,16 +916,22 @@ function fn_openAmaranthApproval(estObjId, contractNo) { } // 메일 작성 팝업 열기 -function fn_openMailFormPopup(contractObjId){ +// hasBaseEst: 기본 견적서 존재 여부 (기본값: true) +// hasAddEst: 추가견적 PDF 존재 여부 (기본값: false) +function fn_openMailFormPopup(contractObjId, hasBaseEst, hasAddEst){ if(!contractObjId || contractObjId === ''){ Swal.fire("잘못된 요청입니다."); return; } - + if(typeof hasBaseEst === 'undefined') hasBaseEst = true; + if(typeof hasAddEst === 'undefined') hasAddEst = false; + var popup_width = 950; var popup_height = 800; var url = "/contractMgmt/estimateMailFormPopup.do?contractObjId=" + contractObjId; - + url += "&hasBaseEst=" + (hasBaseEst ? "Y" : "N"); + url += "&hasAddEst=" + (hasAddEst ? "Y" : "N"); + window.open(url, "estimateMailForm", "width="+popup_width+",height="+popup_height+",menubar=no,scrollbars=yes,resizable=yes"); } diff --git a/WebContent/WEB-INF/view/contractMgmt/estimateMailFormPopup.jsp b/WebContent/WEB-INF/view/contractMgmt/estimateMailFormPopup.jsp index b8c9f98..b30751d 100644 --- a/WebContent/WEB-INF/view/contractMgmt/estimateMailFormPopup.jsp +++ b/WebContent/WEB-INF/view/contractMgmt/estimateMailFormPopup.jsp @@ -7,6 +7,8 @@ PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN); String connector = person.getUserId(); String contractObjId = request.getParameter("contractObjId"); +String hasBaseEst = request.getParameter("hasBaseEst") != null ? request.getParameter("hasBaseEst") : "Y"; +String hasAddEst = request.getParameter("hasAddEst") != null ? request.getParameter("hasAddEst") : "N"; %> @@ -152,12 +154,19 @@ String contractObjId = request.getParameter("contractObjId");
+ <%if("N".equals(hasBaseEst) && "Y".equals(hasAddEst)){%> + PDF 첨부: 추가견적 PDF가 첨부됩니다. + <%}else if("Y".equals(hasBaseEst) && "Y".equals(hasAddEst)){%> + PDF 첨부: 최종 차수 견적서 + 추가견적 PDF가 합본으로 첨부됩니다. + <%}else{%> PDF 첨부: 최종 차수 견적서가 자동으로 첨부됩니다. + <%}%>
+
@@ -204,6 +213,8 @@ String contractObjId = request.getParameter("contractObjId");
No제품구분 * 품번 * 품명 * S/N
+ 품목 추가 버튼을 클릭하여 품목을 등록하세요.
TotalTotal 0 0.00