diff --git a/WebContent/WEB-INF/classes/com/pms/salesmgmt/mapper/contractMgmt.xml b/WebContent/WEB-INF/classes/com/pms/salesmgmt/mapper/contractMgmt.xml
index dc42832..b9d6e5e 100644
--- a/WebContent/WEB-INF/classes/com/pms/salesmgmt/mapper/contractMgmt.xml
+++ b/WebContent/WEB-INF/classes/com/pms/salesmgmt/mapper/contractMgmt.xml
@@ -486,20 +486,27 @@
,CODE_NAME(AREA_CD) AS AREA_NAME
,MECHANICAL_TYPE
,OVERHAUL_ORDER
- ,PAID_TYPE
+ ,CASE
+ WHEN PAID_TYPE = 'paid' THEN '유상'
+ WHEN PAID_TYPE = 'free' THEN '무상'
+ ELSE PAID_TYPE
+ END AS PAID_TYPE
,RECEIPT_DATE
,PART_NO
,PART_NAME
,SERIAL_NO
- ,QUANTITY
- ,CUSTOMER_REQUEST
- ,EXCHANGE_RATE
- ,A.APPR_STATUS
- ,A.APPROVAL_OBJID
- ,A.ROUTE_OBJID
- FROM
- CONTRACT_MGMT AS T
- LEFT OUTER JOIN
+ ,QUANTITY
+ ,CUSTOMER_REQUEST
+ ,EXCHANGE_RATE
+ ,EST_PRICE
+ ,EST_SUPPLY_PRICE
+ ,(SELECT COUNT(1) FROM ESTIMATE_TEMPLATE WHERE CONTRACT_OBJID = T.OBJID) AS EST_STATUS
+ ,A.APPR_STATUS
+ ,A.APPROVAL_OBJID
+ ,A.ROUTE_OBJID
+ FROM
+ CONTRACT_MGMT AS T
+ LEFT OUTER JOIN
(
SELECT
B.OBJID AS ROUTE_OBJID,
@@ -3678,7 +3685,11 @@ ORDER BY ASM.SUPPLY_NAME
CUSTOMER_PROJECT_NAME,
AREA_CD,
CODE_NAME(AREA_CD) AS AREA_NAME,
- PAID_TYPE,
+ CASE
+ WHEN PAID_TYPE = 'paid' THEN '유상'
+ WHEN PAID_TYPE = 'free' THEN '무상'
+ ELSE PAID_TYPE
+ END AS PAID_TYPE,
RECEIPT_DATE,
PART_NO,
PART_NAME,
@@ -3696,7 +3707,31 @@ ORDER BY ASM.SUPPLY_NAME
FROM
CONTRACT_MGMT AS T
WHERE
- OBJID = #{objId}::NUMERIC
+ OBJID::VARCHAR = #{objId}
+
+
+
+
@@ -3724,7 +3759,7 @@ ORDER BY ASM.SUPPLY_NAME
FROM
ESTIMATE_TEMPLATE
WHERE
- CONTRACT_OBJID = #{objId}::NUMERIC
+ CONTRACT_OBJID = #{objId}
AND TEMPLATE_TYPE = #{template_type}
@@ -3732,6 +3767,56 @@ ORDER BY ASM.SUPPLY_NAME
LIMIT 1
+
+
+
+
+
+
@@ -3761,6 +3846,7 @@ ORDER BY ASM.SUPPLY_NAME
INSERT INTO ESTIMATE_TEMPLATE (
+ OBJID,
CONTRACT_OBJID,
TEMPLATE_TYPE,
EXECUTOR,
@@ -3780,7 +3866,8 @@ ORDER BY ASM.SUPPLY_NAME
CHG_USER_ID,
CHGDATE
) VALUES (
- #{objId}::NUMERIC,
+ #{template_objid},
+ #{objId},
#{template_type},
#{executor},
#{recipient},
@@ -3820,7 +3907,7 @@ ORDER BY ASM.SUPPLY_NAME
CHG_USER_ID = #{chg_user_id},
CHGDATE = NOW()
WHERE
- CONTRACT_OBJID = #{objId}::NUMERIC
+ CONTRACT_OBJID = #{objId}
AND TEMPLATE_TYPE = #{template_type}
@@ -3828,11 +3915,7 @@ ORDER BY ASM.SUPPLY_NAME
DELETE FROM ESTIMATE_TEMPLATE_ITEM
WHERE
- TEMPLATE_OBJID IN (
- SELECT OBJID
- FROM ESTIMATE_TEMPLATE
- WHERE CONTRACT_OBJID = #{objId}::NUMERIC
- )
+ TEMPLATE_OBJID = #{template_objid}
@@ -3851,17 +3934,25 @@ ORDER BY ASM.SUPPLY_NAME
REMARK
)
SELECT
- (SELECT OBJID FROM ESTIMATE_TEMPLATE WHERE CONTRACT_OBJID = #{objId}::NUMERIC AND TEMPLATE_TYPE = #{template_type}),
- (json_array_elements(#{items_json}::json)->>'seq')::INTEGER,
- json_array_elements(#{items_json}::json)->>'category',
- json_array_elements(#{items_json}::json)->>'description',
- json_array_elements(#{items_json}::json)->>'specification',
- json_array_elements(#{items_json}::json)->>'quantity',
- json_array_elements(#{items_json}::json)->>'unit',
- (json_array_elements(#{items_json}::json)->>'unit_price')::NUMERIC,
- (json_array_elements(#{items_json}::json)->>'amount')::NUMERIC,
- json_array_elements(#{items_json}::json)->>'note',
- json_array_elements(#{items_json}::json)->>'remark'
+ #{template_objid},
+ (item->>'seq')::INTEGER,
+ item->>'category',
+ item->>'description',
+ item->>'specification',
+ item->>'quantity',
+ item->>'unit',
+ CASE
+ WHEN item->>'unit_price' = '' THEN NULL
+ ELSE (item->>'unit_price')::NUMERIC
+ END,
+ CASE
+ WHEN item->>'amount' = '' THEN NULL
+ ELSE (item->>'amount')::NUMERIC
+ END,
+ item->>'note',
+ item->>'remark'
+ FROM json_array_elements(#{items_json}::json) AS item
+ WHERE COALESCE(item->>'description', '') != ''
@@ -3872,7 +3963,7 @@ ORDER BY ASM.SUPPLY_NAME
CHG_USER_ID = #{chg_user_id},
CHGDATE = NOW()
WHERE
- CONTRACT_OBJID = #{objId}::NUMERIC
+ CONTRACT_OBJID = #{objId}
AND TEMPLATE_TYPE = #{template_type}
diff --git a/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp b/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp
index 674994e..f268a12 100644
--- a/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp
+++ b/WebContent/WEB-INF/view/contractMgmt/estimateList_new.jsp
@@ -71,24 +71,25 @@ $(document).ready(function(){
// 견적서 양식 선택 팝업
Swal.fire({
title: '견적서 양식을 선택하세요',
- icon: 'question',
+ html: '
' +
+ '' +
+ '' +
+ '
',
+ showConfirmButton: false,
showCancelButton: true,
- showDenyButton: true,
- confirmButtonText: '일반 견적서',
- denyButtonText: '장비 견적서',
cancelButtonText: '취소',
- confirmButtonColor: '#3085d6',
- denyButtonColor: '#28a745',
- cancelButtonColor: '#d33',
- }).then((result) => {
- if (result.isConfirmed) {
- // 일반 견적서 (Template 1)
- fn_openEstimateTemplate(objId, "1");
- } else if (result.isDenied) {
- // 장비 견적서 (Template 2)
- fn_openEstimateTemplate(objId, "2");
- }
+ cancelButtonColor: '#d33'
});
+
+ // 전역 함수로 등록
+ window.openTemplate1 = function() {
+ Swal.close();
+ fn_openEstimateTemplate(objId, "1");
+ };
+ window.openTemplate2 = function() {
+ Swal.close();
+ fn_openEstimateTemplate(objId, "2");
+ };
}
});
@@ -158,71 +159,122 @@ var columns = [
fn_projectConceptDetail(objid);
}
},
- {title:"영업정보(상세)", headerHozAlign:'center', //고객정보
- columns:[
- {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '계약구분', field : 'CATEGORY_NAME' },
- {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '차수', field : 'OVERHAUL_ORDER'},
- {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '국내/해외', field : 'AREA_NAME' },
- {headerHozAlign : 'center', hozAlign : 'left', width : '150', title : '고객사', field : 'CUSTOMER_NAME' },
- {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '제품구분', field : 'PRODUCT_NAME' },
- {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '기계형식', field : 'MECHANICAL_TYPE' },
- {headerHozAlign : 'center', hozAlign : 'left', width : '200', title : '고객사 프로젝트명', field : 'CUSTOMER_PROJECT_NAME' },
- {headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '예상납기일', field : 'DUE_DATE' },
- {headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '입고지', field : 'LOCATION' },
- {headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '셋업지', field : 'SETUP' },
- {headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '설비방향', field : 'FACILITY_NAME' },
- {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '설비대수', field : 'FACILITY_QTY' },
- {headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '설비타입', field : 'FACILITY_TYPE' },
- {headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '설비길이', field : 'FACILITY_DEPTH' },
- {headerHozAlign : 'center', hozAlign : 'center', width : '70', title : '담당자', field : 'WRITER_NAME' },
- {headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '등록일', field : 'REG_DATE' },
- {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '첨부파일', field : 'CU01_CNT',
- formatter:fnc_subInfoValueFormatter,
- cellClick:function(e, cell){
- var objid = fnc_checkNull(cell.getData().OBJID);
- var docType = 'contractMgmt01';
- var docTypeName = 'contractMgmt01';
- fn_FileRegist(objid, docType, docTypeName);
- }
- }
- ]
- },
- {title:"진행사항", headerHozAlign:'center',
- columns:[
- {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '검토내용', field : 'CU03_CNT',
- formatter:fnc_subInfoValueFormatter,
- cellClick:function(e, cell){
- var objid = fnc_checkNull(cell.getData().OBJID);
- fn_projectConceptReviewDetail(objid);
- }
- },
- {headerHozAlign : 'center', hozAlign : 'center', width : '70', title : '상태', field : 'CONTRACT_RESULT_NAME' }
- ]
- },
- {title:"수주정보", headerHozAlign:'center',
- columns:[
- {headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '수주일', field : 'CONTRACT_DATE' },
- {headerHozAlign : 'center', hozAlign : 'center', width : '100', title : 'PO계약 No', field : 'PO_NO' },
- {headerHozAlign : 'center', hozAlign : 'center', width : '70', title : 'PM', field : 'PM_USER_NAME' },
- {headerHozAlign : 'center', hozAlign : 'center', width : '70', title : '통화', field : 'CONTRACT_CURRENCY_NAME' },
- {headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '수주가', field : 'CONTRACT_PRICE_CURRENCY',
- formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false,},
- },
- {headerHozAlign : 'center', hozAlign : 'left', width : '170', title : '당사프로젝트명', field : 'PROJECT_NAME' },
- {headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '계약납기일', field : 'CONTRACT_DEL_DATE' },
- {headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '요청납기일', field : 'REQ_DEL_DATE' },
- {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '수주회사', field : 'CONTRACT_COMPANY_NAME' },
- {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '제작공장', field : 'MANUFACTURE_PLANT_NAME' }
- ]
- },
- {headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '상태', field : 'APPR_STATUS' ,
- formatter:fnc_createGridAnchorTag,
+ {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '주문유형', field : 'CATEGORY_NAME' },
+ {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '제품구분', field : 'PRODUCT_NAME' },
+ {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '국내/해외', field : 'AREA_NAME' },
+ {headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '접수일', field : 'RECEIPT_DATE' },
+ {headerHozAlign : 'center', hozAlign : 'left', width : '150', title : '고객사', field : 'CUSTOMER_NAME' },
+ {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '유/무상', field : 'PAID_TYPE' },
+ {headerHozAlign : 'center', hozAlign : 'left', width : '100', title : '품번', field : 'PART_NO' },
+ {headerHozAlign : 'center', hozAlign : 'left', width : '100', title : '품명', field : 'PART_NAME' },
+ {headerHozAlign : 'center', hozAlign : 'center', width : '150', title : 'S/N', field : 'SERIAL_NO',
+ formatter: function(cell, formatterParams, onRendered){
+ var value = fnc_checkNull(cell.getValue());
+ if(value === '') return '';
+
+ // 쉼표로 구분된 S/N 개수 계산
+ var serialNumbers = value.split(',').map(function(s){ return s.trim(); }).filter(function(s){ return s !== ''; });
+ var count = serialNumbers.length;
+
+ if(count === 0) return '';
+ if(count === 1) return '' + serialNumbers[0] + '';
+
+ // 2개 이상이면 "첫번째 외 N개" 형식
+ var displayText = serialNumbers[0] + ' 외 ' + (count - 1) + '개';
+ return '' + displayText + '';
+ },
cellClick:function(e, cell){
- var APPROVAL_OBJID = fnc_checkNull(cell.getData().APPROVAL_OBJID);
- var ROUTE_OBJID = fnc_checkNull(cell.getData().ROUTE_OBJID);
- approval_form(APPROVAL_OBJID,ROUTE_OBJID);
- }
+ var serialNo = fnc_checkNull(cell.getData().SERIAL_NO);
+ fn_showSerialNoPopup(serialNo);
+ }
+ },
+ {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '수량', field : 'QUANTITY' },
+ {headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '요청납기', field : 'DUE_DATE' },
+ {headerHozAlign : 'center', hozAlign : 'left', width : '150', title : '고객요청사항', field : 'CUSTOMER_REQUEST' },
+ {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '견적현황', field : 'EST_STATUS',
+ formatter:fnc_subInfoValueFormatter,
+ cellClick:function(e, cell){
+ var objid = fnc_checkNull(cell.getData().OBJID);
+ fn_showEstimateList(objid);
+ }
},
+ {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '결재상태', field : 'APPR_STATUS',
+ formatter:fnc_createGridAnchorTag,
+ cellClick:function(e, cell){
+ var objid = fnc_checkNull(cell.getData().OBJID);
+ fn_projectConceptDetail(objid);
+ }
+ },
+ {headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '견적단가', field : 'EST_PRICE' },
+ {headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '견적공급가액', field : 'EST_SUPPLY_PRICE' },
+ {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '환종', field : 'CONTRACT_CURRENCY_NAME' },
+ {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '환율', field : 'EXCHANGE_RATE' },
+
+ // {title:"영업정보(상세)", headerHozAlign:'center', //고객정보
+ // columns:[
+
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '차수', field : 'OVERHAUL_ORDER'},
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '국내/해외', field : 'AREA_NAME' },
+ // {headerHozAlign : 'center', hozAlign : 'left', width : '150', title : '고객사', field : 'CUSTOMER_NAME' },
+
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '기계형식', field : 'MECHANICAL_TYPE' },
+ // {headerHozAlign : 'center', hozAlign : 'left', width : '200', title : '고객사 프로젝트명', field : 'CUSTOMER_PROJECT_NAME' },
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '예상납기일', field : 'DUE_DATE' },
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '입고지', field : 'LOCATION' },
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '셋업지', field : 'SETUP' },
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '설비방향', field : 'FACILITY_NAME' },
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '설비대수', field : 'FACILITY_QTY' },
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '설비타입', field : 'FACILITY_TYPE' },
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '설비길이', field : 'FACILITY_DEPTH' },
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '70', title : '담당자', field : 'WRITER_NAME' },
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '등록일', field : 'REG_DATE' },
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '첨부파일', field : 'CU01_CNT',
+ // formatter:fnc_subInfoValueFormatter,
+ // cellClick:function(e, cell){
+ // var objid = fnc_checkNull(cell.getData().OBJID);
+ // var docType = 'contractMgmt01';
+ // var docTypeName = 'contractMgmt01';
+ // fn_FileRegist(objid, docType, docTypeName);
+ // }
+ // }
+ // ]
+ // },
+ // {title:"진행사항", headerHozAlign:'center',
+ // columns:[
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '검토내용', field : 'CU03_CNT',
+ // formatter:fnc_subInfoValueFormatter,
+ // cellClick:function(e, cell){
+ // var objid = fnc_checkNull(cell.getData().OBJID);
+ // fn_projectConceptReviewDetail(objid);
+ // }
+ // },
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '70', title : '상태', field : 'CONTRACT_RESULT_NAME' }
+ // ]
+ // },
+ // {title:"수주정보", headerHozAlign:'center',
+ // columns:[
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '수주일', field : 'CONTRACT_DATE' },
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '100', title : 'PO계약 No', field : 'PO_NO' },
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '70', title : 'PM', field : 'PM_USER_NAME' },
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '70', title : '통화', field : 'CONTRACT_CURRENCY_NAME' },
+ // {headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '수주가', field : 'CONTRACT_PRICE_CURRENCY',
+ // formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false,},
+ // },
+ // {headerHozAlign : 'center', hozAlign : 'left', width : '170', title : '당사프로젝트명', field : 'PROJECT_NAME' },
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '계약납기일', field : 'CONTRACT_DEL_DATE' },
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '요청납기일', field : 'REQ_DEL_DATE' },
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '수주회사', field : 'CONTRACT_COMPANY_NAME' },
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '제작공장', field : 'MANUFACTURE_PLANT_NAME' }
+ // ]
+ // },
+ // {headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '상태', field : 'APPR_STATUS' ,
+ // formatter:fnc_createGridAnchorTag,
+ // cellClick:function(e, cell){
+ // var APPROVAL_OBJID = fnc_checkNull(cell.getData().APPROVAL_OBJID);
+ // var ROUTE_OBJID = fnc_checkNull(cell.getData().ROUTE_OBJID);
+ // approval_form(APPROVAL_OBJID,ROUTE_OBJID);
+ // }
+ // },
];
//var grid;
@@ -322,7 +374,97 @@ function fn_projectConceptReviewDetail(objId){
fn_centerPopup(popup_width, popup_height, url);
}
-//견적서 양식 열기
+// 견적서 목록 팝업
+function fn_showEstimateList(contractObjId){
+ $.ajax({
+ url: "/contractMgmt/getEstimateTemplateList.do",
+ type: "POST",
+ data: { objId: contractObjId },
+ dataType: "json",
+ success: function(data){
+ console.log("견적서 목록 응답:", data); // 디버깅용
+
+ if(data.result === "success" && data.list && data.list.length > 0){
+ var html = '';
+ html += '
';
+ html += '';
+ html += '| 차수 | ';
+ html += '견적서 유형 | ';
+ html += '견적번호 | ';
+ html += '작성일 | ';
+ html += '작성자 | ';
+ html += '
';
+
+ data.list.forEach(function(item){
+ console.log("견적서 항목:", item); // 디버깅용
+
+ // 대문자/소문자 모두 지원하도록 안전하게 처리
+ var objid = item.OBJID || item.objid || '';
+ var templateType = item.TEMPLATE_TYPE || item.template_type || item.templateType || '';
+ var revision = item.REVISION || item.revision || '';
+ var templateTypeName = item.TEMPLATE_TYPE_NAME || item.template_type_name || item.templateTypeName || '';
+ var estimateNo = item.ESTIMATE_NO || item.estimate_no || item.estimateNo || '-';
+ var regdate = item.REGDATE || item.regdate || '';
+ var writer = item.WRITER || item.writer || '';
+
+ html += '';
+ html += '| ' + revision + '차 | ';
+ html += '' + templateTypeName + ' | ';
+ html += '' + estimateNo + ' | ';
+ html += '' + regdate + ' | ';
+ html += '' + writer + ' | ';
+ html += '
';
+ });
+
+ html += '
';
+
+ Swal.fire({
+ title: '견적서 목록',
+ html: html,
+ width: '700px',
+ showConfirmButton: false,
+ showCancelButton: true,
+ cancelButtonText: '닫기'
+ });
+ } else {
+ Swal.fire({
+ title: '견적서가 없습니다',
+ text: '작성된 견적서가 없습니다.',
+ icon: 'info'
+ });
+ }
+ },
+ error: function(xhr, status, error){
+ console.error("견적서 목록 조회 오류:", xhr, status, error); // 디버깅용
+ Swal.fire({
+ title: '오류',
+ text: '견적서 목록 조회 중 오류가 발생했습니다.',
+ icon: 'error'
+ });
+ }
+ });
+}
+
+// OBJID로 견적서 열기
+function fn_openEstimateByObjId(templateObjId, templateType){
+ Swal.close();
+
+ var popup_width = 900;
+ var popup_height = 800;
+ var url = "";
+
+ if(templateType === "1"){
+ // 일반 견적서
+ url = "/contractMgmt/estimateTemplate1.do?templateObjId="+templateObjId;
+ } else if(templateType === "2"){
+ // 장비 견적서
+ url = "/contractMgmt/estimateTemplate2.do?templateObjId="+templateObjId;
+ }
+
+ window.open(url, "estimateTemplate_"+templateObjId, "width="+popup_width+",height="+popup_height+",menubar=no,scrollbars=yes,resizable=yes");
+}
+
+//견적서 양식 열기 (CONTRACT_OBJID로)
function fn_openEstimateTemplate(objId, templateType){
var popup_width = 900;
var popup_height = 800;
@@ -339,6 +481,36 @@ function fn_openEstimateTemplate(objId, templateType){
window.open(url, "estimateTemplate", "width="+popup_width+",height="+popup_height+",menubar=no,scrollbars=yes,resizable=yes");
}
+// S/N 목록 팝업 표시
+function fn_showSerialNoPopup(serialNoString){
+ if(!serialNoString || serialNoString === ''){
+ Swal.fire("S/N 정보가 없습니다.");
+ return;
+ }
+
+ // 쉼표로 구분된 S/N을 배열로 변환
+ var serialNumbers = serialNoString.split(',').map(function(sn){ return sn.trim(); });
+
+ // HTML 리스트 생성
+ var listHtml = '';
+ listHtml += '
';
+ serialNumbers.forEach(function(sn, index){
+ listHtml += '- ' + sn + '
';
+ });
+ listHtml += '
';
+ listHtml += '
';
+
+ // SweetAlert2로 팝업 표시
+ Swal.fire({
+ title: 'S/N 목록',
+ html: listHtml,
+ icon: 'info',
+ width: 500,
+ confirmButtonText: '확인',
+ confirmButtonColor: '#3085d6'
+ });
+}
+
//코드값을 받아와서 동적으로 selectbox 생성
function optionJobGroup(code){
var val=code;
diff --git a/WebContent/WEB-INF/view/contractMgmt/estimateTemplate1.jsp b/WebContent/WEB-INF/view/contractMgmt/estimateTemplate1.jsp
index 276ed87..443cdb5 100644
--- a/WebContent/WEB-INF/view/contractMgmt/estimateTemplate1.jsp
+++ b/WebContent/WEB-INF/view/contractMgmt/estimateTemplate1.jsp
@@ -7,6 +7,7 @@
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
String userId = CommonUtils.checkNull(person.getUserId());
String objId = CommonUtils.checkNull(request.getParameter("objId"));
+String templateObjId = CommonUtils.checkNull(request.getParameter("templateObjId"));
%>
@@ -218,8 +219,18 @@ textarea {
}