From 4f24e21ee76e07650c932b5f9a704d3d5a283c6e Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Fri, 19 Jan 2024 17:44:12 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=ED=8E=B8?= =?UTF-8?q?=EC=A7=91=EA=B8=B0=20=EC=B0=A8=EC=A0=81=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/jsp/fims/cvlc/cvlc01020-info.jsp | 87 ++++++++++++++++++- .../WEB-INF/jsp/fims/sprt/sprt03020-main.jsp | 33 +++---- 2 files changed, 103 insertions(+), 17 deletions(-) diff --git a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01020-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01020-info.jsp index 0861f658..aa7410ce 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01020-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01020-info.jsp @@ -1015,7 +1015,92 @@ $(document).ready(function(){ //사진영역 설정 - settingPhotoMain("${pageName}", "crdnId--${pageName}"); + settingPhotoMain("${pageName}", "crdnId--${pageName}", + function(){ + return { + vhrno : $("#vhrno--${pageName}").val(), + vhclNm : $("#vhclNm--${pageName}").val(), + vhclColor : $("#vhclColor--${pageName}").val() + }; + }, + async function(vhrno){ + var resp = await getVhclInfo($("#sggCd--${pageName}").val(), vhrno, $("#crdnYmd--${pageName}").val()); + + $("#vhrno--${pageName}").val(vhrno); + + if(!resp.found){ + + $("#rtpyrId--${pageName}").val(""); + $("#rtpyrNm--${pageName}").val(""); + $("#rtpyrSeCd--${pageName}").val(""); + $("#rtpyrNo--${pageName}").val(""); + $("#vin--${pageName}").val(""); + $("#vhclNm--${pageName}").val(""); + $("#vhclColor--${pageName}").val(""); + $("#useFuelCd--${pageName}").val(""); + $("#ffnlgCarmdlCd--${pageName}").val(""); + $("#zip--${pageName}").val(""); + $("#addr--${pageName}").val(""); + $("#dtlAddr--${pageName}").val(""); + + return { + vhrno : "", + vhclNm : "", + vhclColor : "" + }; + } else { + $("#rtpyrId--${pageName}").val(resp.rtpyrId); + + var vehicle = resp.vehicle; + + $("#rtpyrNm--${pageName}").val(vehicle.mber_nm); + + var pyrSeCd = ""; + switch(vehicle.mber_se_code){ + case "11" : pyrSeCd = "01"; break; + case "12" : pyrSeCd = "02"; break; + case "13" : pyrSeCd = "03"; break; + case "14" : pyrSeCd = "04"; break; + case "15" : pyrSeCd = "05"; break; + } + $("#rtpyrSeCd--${pageName}").val(pyrSeCd); + + $("#rtpyrNo--${pageName}").val(vehicle.mber_se_no); + + $("#vin--${pageName}").val(vehicle.vin); + $("#vhclNm--${pageName}").val(vehicle.cnm); + $("#vhclColor--${pageName}").val(vehicle.color_nm); + $("#useFuelCd--${pageName}").val(vehicle.use_fuel_code); + + if(vehicle.vhcty_asort_code == "1"){ //승용 + $("#ffnlgCarmdlCd--${pageName}").val("11"); + } else if(vehicle.vhcty_asort_code == "2"){ //승합 + $("#ffnlgCarmdlCd--${pageName}").val("12"); + } else if(vehicle.vhcty_asort_code == "3"){ //화물 + if(vehicle.mxmm_ldg <= 4000){ + $("#ffnlgCarmdlCd--${pageName}").val("13"); + } else { + $("#ffnlgCarmdlCd--${pageName}").val("14"); + } + } else if(vehicle.vhcty_asort_code == "4"){ //특수 + $("#ffnlgCarmdlCd--${pageName}").val("15"); + } else { + $("#ffnlgCarmdlCd--${pageName}").val(""); + } + + $("#zip--${pageName}").val(vehicle.zip_code); //우편번호 + $("#addr--${pageName}").val(vehicle.road_nm_adres); //주소 + $("#dtlAddr--${pageName}").val(vehicle.use_strnghld_adres_nm); //상세주소 + + return { + vhrno : resp.vehicle.vhrno, + vhclNm : resp.vehicle.cnm, + vhclColor : resp.vehicle.color_nm + }; + } + + } + ); //사진영역 초기화 var existVideo = false; diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt03020-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt03020-main.jsp index 5fe41df3..616a970b 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt03020-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt03020-main.jsp @@ -112,6 +112,21 @@ function fnAfterImageSave(){ window.close(); }; +async function fnCarLink(vhrno){ + result = await window.opener.pageObject[openerPageName].carLinkFunc(vhrno); + + if(result.vhrno == null || result.vhrno == ""){ + $("input[name='vhclNm']").val(""); + $("input[name='vhclColor']").val(""); + alert("차량조회 결과가 없습니다."); + } else { + $("input[name='vhrno']").val(result.vhrno); + $("input[name='vhclNm']").val(result.vhclNm); + $("input[name='vhclColor']").val(result.vhclColor); + } + +} + $(document).ready(function(){ var fileInfo = [${fileInfo}]; @@ -133,23 +148,9 @@ $(document).ready(function(){ $("input[name='vhclNm']").val(vhclInfo.vhclNm); $("input[name='vhclColor']").val(vhclInfo.vhclColor); - $("input[name='vhrno']").on("keyup",function(e){ + $("input[name='vhrno']").on("keyup", function(e){ if(e.key == "Enter"){ - - window.opener.pageObject[openerPageName].carLinkFunc(this.value).then(function(result){ - - if(result.vhrno == null || result.vhrno == ""){ - $("input[name='vhclNm']").val(""); - $("input[name='vhclColor']").val(""); - alert("차량조회 결과가 없습니다."); - } else { - $("input[name='vhrno']").val(result.vhrno); - $("input[name='vhclNm']").val(result.vhclNm); - $("input[name='vhclColor']").val(result.vhclColor); - } - - }); - + fnCarLink(this.value); } }); }