diff --git a/WebContent/WEB-INF/dispatcher-servlet.xml b/WebContent/WEB-INF/dispatcher-servlet.xml index 0769b0a..8a5b95d 100644 --- a/WebContent/WEB-INF/dispatcher-servlet.xml +++ b/WebContent/WEB-INF/dispatcher-servlet.xml @@ -42,17 +42,6 @@ - - - - - - - - - - - diff --git a/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp b/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp index bf768b7..1948ab4 100644 --- a/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp +++ b/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp @@ -668,169 +668,21 @@ function fn_sendEstimateMail(contractObjId){ return; } - // 1단계: 견적서 템플릿 정보 조회 - Swal.fire({ - title: '견적서 조회 중...', - text: '잠시만 기다려주세요.', - allowOutsideClick: false, - onOpen: () => { - Swal.showLoading(); - } - }); - - $.ajax({ - url: "/contractMgmt/getEstimateTemplateList.do", - type: "POST", - data: { objId: contractObjId }, - dataType: "json", - success: function(data){ - if(data.result === "success" && data.list && data.list.length > 0){ - // 최종 차수 견적서 찾기 - var latestEstimate = data.list[0]; // 이미 차수 내림차순으로 정렬되어 있음 - var templateObjId = latestEstimate.OBJID || latestEstimate.objid; - var templateType = latestEstimate.TEMPLATE_TYPE || latestEstimate.template_type || latestEstimate.templateType; - - // 2단계: 견적서 페이지를 새 창으로 열고 PDF 생성 - fn_generatePdfAndSendMail(contractObjId, templateObjId, templateType); - } else { - Swal.close(); - Swal.fire({ - title: '오류', - text: '견적서를 찾을 수 없습니다.', - icon: 'error' - }); - } - }, - error: function(xhr, status, error){ - Swal.close(); - console.error("견적서 조회 오류:", xhr, status, error); - Swal.fire({ - title: '오류', - text: '견적서 조회 중 오류가 발생했습니다.', - icon: 'error' - }); - } - }); -} - -// PDF 생성 및 메일 발송 -function fn_generatePdfAndSendMail(contractObjId, templateObjId, templateType){ - Swal.fire({ - title: 'PDF 생성 중...', - text: '견적서를 PDF로 변환하고 있습니다.', - allowOutsideClick: false, - onOpen: () => { - Swal.showLoading(); - } - }); - - // 견적서 페이지 URL 생성 - var url = ""; - if(templateType === "1"){ - url = "/contractMgmt/estimateTemplate1.do?templateObjId=" + templateObjId; - } else if(templateType === "2"){ - url = "/contractMgmt/estimateTemplate2.do?templateObjId=" + templateObjId; - } - - // 숨겨진 iframe으로 페이지 로드 - var iframe = $('