diff --git a/WebContent/WEB-INF/view/purchaseOrder/deliveryAcceptanceFormPopUp_new.jsp b/WebContent/WEB-INF/view/purchaseOrder/deliveryAcceptanceFormPopUp_new.jsp index be86d7f..ec915c4 100644 --- a/WebContent/WEB-INF/view/purchaseOrder/deliveryAcceptanceFormPopUp_new.jsp +++ b/WebContent/WEB-INF/view/purchaseOrder/deliveryAcceptanceFormPopUp_new.jsp @@ -60,7 +60,16 @@ form { //var grid; var TYPE_STANDARD = "0001069"; //발주구분코드:일반부품 var TYPE_LONG_DLV = "0001070"; //발주구분코드:장납기부품 -var TYPE_ETC = "0001538"; //발주구분코드:잡자재 +var TYPE_ETC = "0001538"; //발주구분코드:잡자재 + +// 입고창고/계정과목 select2 초기화 (동적 생성 select 대응) +function initDeliverySelect2(scope) { + var $target = scope ? $(scope) : $(document); + $target.find("select[name='LOCATION'], select[name='SUB_LOCATION']").each(function(){ + if($(this).data('select2')) $(this).select2('destroy'); + $(this).select2({ width:'resolve', placeholder:'선택', allowClear:true }); + }); +} $(document).ready(function(){ @@ -157,6 +166,11 @@ $(document).ready(function(){ fnc_datepick(); //달력 $(".select2").select2(); + $("#LOCATION_CD, #SUB_LOCATION_CD").select2({ width:'resolve', placeholder:'선택', allowClear:true }); + + // 서버 렌더링된 입고창고/계정과목 select 값 설정 + select2 초기화 + selectSetVal("data-select", true); + initDeliverySelect2("#addData"); var originalValue; @@ -333,6 +347,7 @@ function fn_addarrival(){ changeYear:true }); }); + initDeliverySelect2("#addData"); $("input[name*=RECEIPT_QTY]").trigger("change"); applyScrollHandler(); } @@ -368,6 +383,7 @@ function fn_removearrival() { var lastCell = cells.last(); // 마지막 td를 선택 var cellsToRemove = cells.slice(-5, -1); // 마지막 td(미입고수량)를 제외하고 그 앞의 4개 td를 선택 + cellsToRemove.find("select").each(function(){ if($(this).data('select2')) $(this).select2('destroy'); }); cellsToRemove.remove(); // 선택한 td를 삭제 $("input[name*=RECEIPT_QTY]").trigger("change"); /* cellsToRemove.find("input[name='OBJID']").each(function() { @@ -923,10 +939,10 @@ function fn_location_save(){