diff --git a/src/main/resources/static/js/dlvylc/dlvylc.js b/src/main/resources/static/js/dlvylc/dlvylc.js index e1e51372..8185217e 100644 --- a/src/main/resources/static/js/dlvylc/dlvylc.js +++ b/src/main/resources/static/js/dlvylc/dlvylc.js @@ -133,6 +133,7 @@ const fn_move_dlvylc_regpage = function (dftDlvylcAt) { 배송지 등록 ***********************************************/ const fn_insert_dlvylc = function (msg, data, isMobile) { + $("#dlvylcUpdate").remove(); let paramData = null; const registForm = $("#dlvylcRegistForm").serialize(); if (data != null) { @@ -387,8 +388,74 @@ const fn_update_dlvylc = function (pageIndex,msg,isMobile) { if (id == 'langJp') { $('#cstmclerCd').prop('disabled', true); $('#zip').prop('readonly', false); + $('#dtlAdres').attr('placeholder', '以降の住所を入力してください。'); + $('#mbtlnb').attr('placeholder', ''); + $('#prefcode').prop('disabled', true); } else { $('#cstmclerCd').prop('disabled', false); $('#zip').prop('readonly', true); + $('#dtlAdres').attr('placeholder', '나머지 주소를 입력해 주세요'); + $('#mbtlnb').attr('placeholder', '휴대폰번호\'-\'없이 입력하세요'); + $('#prefcode').prop('disabled', false); + + $('#postcodeAlert').hide(); + } + } + + /********************************************** + ibsnet api 호출 + ***********************************************/ + const fn_select_postcodeJp = function () { + $('#postcodeAlert').hide(); + + $.ajax({ + type: 'GET', + url: 'https://zipcloud.ibsnet.co.jp/api/search?zipcode=' + $('#zip').val() + +'&callback=' + 'fn_set_postcodeJp', + dataType: 'jsonp' + }); + } + + /********************************************** + ibsnet api 호출 콜백 (화면에 주소 결과값 세팅) + ***********************************************/ + const fn_set_postcodeJp = function (Data) { + if(Data.status == 200) { + let result = Data.results[0]; + + let adres = result.address1; + let dtlAdres = [result.address2, result.address3].join(" "); + let prefcode = result.prefcode; + + $("#adres").val(adres); + $("#dtlAdres").val(dtlAdres); + $("#prefcode").val(prefcode); + } else { + $('#postcodeAlert').show(); + } + } + + /********************************************** + 배송지 관리 팝업 언어별 form 초기화 + ***********************************************/ + let dlvylcFormPreValues = {}; + const fn_clear_dlvylcForm = function () { + const tableInputs = $("#dlvylcFormTable").find("input[name]"); + + if (Object.keys(dlvylcFormPreValues).length == 0) { + tableInputs.each(function () { + const input = $(this); + const name = input.attr("name"); + dlvylcFormPreValues[name] = input.val(); + input.val(""); + }); + } else { + tableInputs.each(function () { + const input = $(this); + const name = input.attr("name"); + const currentValue = input.val(); + input.val(dlvylcFormPreValues[name] ?? ""); + dlvylcFormPreValues[name] = currentValue; + }); } } \ No newline at end of file diff --git a/src/main/resources/static/js/mngr/js/crm/dlvylc/dlvylc_2.js b/src/main/resources/static/js/mngr/js/crm/dlvylc/dlvylc_2.js index ca72fb5d..489ce982 100644 --- a/src/main/resources/static/js/mngr/js/crm/dlvylc/dlvylc_2.js +++ b/src/main/resources/static/js/mngr/js/crm/dlvylc/dlvylc_2.js @@ -150,6 +150,7 @@ const fn_move_dlvylc_regpage_pop = function (isPop, mbrInnb, mbrDvCd, dftDlvylcA 배송지 등록 ok ***********************************************/ const fn_insert_dlvylc = function (mbrInnb, mbrDvCd, msg, data) { + $("#dlvylcUpdate").remove(); let paramData = null; const registForm = $("#dlvylcRegistForm").serialize(); if (data != null) { @@ -336,8 +337,74 @@ const fn_toggle_langHeader = function () { if (id == 'langJp') { $('#cstmclerCd').prop('disabled', true); $('#zip').prop('readonly', false); + $('#dtlAdres').attr('placeholder', '以降の住所を入力してください。'); + $('#mbtlnb').attr('placeholder', ''); + $('#prefcode').prop('disabled', true); } else { $('#cstmclerCd').prop('disabled', false); $('#zip').prop('readonly', true); + $('#dtlAdres').attr('placeholder', '나머지 주소를 입력해 주세요'); + $('#mbtlnb').attr('placeholder', '휴대폰번호\'-\'없이 입력하세요'); + $('#prefcode').prop('disabled', false); + + $('#postcodeAlert').hide(); + } +} + +/********************************************** + ibsnet api 호출 + ***********************************************/ +const fn_select_postcodeJp = function () { + $('#postcodeAlert').hide(); + + $.ajax({ + type: 'GET', + url: 'https://zipcloud.ibsnet.co.jp/api/search?zipcode=' + $('#zip').val() + +'&callback=' + 'fn_set_postcodeJp', + dataType: 'jsonp' + }); +} + +/********************************************** + ibsnet api 호출 콜백 (화면에 주소 결과값 세팅) + ***********************************************/ +const fn_set_postcodeJp = function (Data) { + if(Data.status == 200) { + let result = Data.results[0]; + + let adres = result.address1; + let dtlAdres = [result.address2, result.address3].join(" "); + let prefcode = result.prefcode; + + $("#adres").val(adres); + $("#dtlAdres").val(dtlAdres); + $("#prefcode").val(prefcode); + } else { + $('#postcodeAlert').show(); + } +} + +/********************************************** + 배송지 관리 팝업 언어별 form 초기화 + ***********************************************/ +let dlvylcFormPreValues = {}; +const fn_clear_dlvylcForm = function () { + const tableInputs = $("#dlvylcFormTable").find("input[name]"); + + if (Object.keys(dlvylcFormPreValues).length == 0) { + tableInputs.each(function () { + const input = $(this); + const name = input.attr("name"); + dlvylcFormPreValues[name] = input.val(); + input.val(""); + }); + } else { + tableInputs.each(function () { + const input = $(this); + const name = input.attr("name"); + const currentValue = input.val(); + input.val(dlvylcFormPreValues[name] ?? ""); + dlvylcFormPreValues[name] = currentValue; + }); } } \ No newline at end of file diff --git a/src/main/resources/static/mngr/js/crm/dlvylc/dlvylc.js b/src/main/resources/static/mngr/js/crm/dlvylc/dlvylc.js index c3165aa2..91497d6e 100644 --- a/src/main/resources/static/mngr/js/crm/dlvylc/dlvylc.js +++ b/src/main/resources/static/mngr/js/crm/dlvylc/dlvylc.js @@ -139,6 +139,7 @@ const fn_move_dlvylc_regpage_pop = function (isPop, mbrInnb, mbrDvCd, dftDlvylcA 배송지 등록 ok ***********************************************/ const fn_insert_dlvylc = function (mbrInnb, mbrDvCd, msg, data) { + $("#dlvylcUpdate").remove(); let paramData = null; const registForm = $("#dlvylcRegistForm").serialize(); if (data != null) { @@ -326,8 +327,74 @@ const fn_toggle_langHeader = function () { if (id == 'langJp') { $('#cstmclerCd').prop('disabled', true); $('#zip').prop('readonly', false); + $('#dtlAdres').attr('placeholder', '以降の住所を入力してください。'); + $('#mbtlnb').attr('placeholder', ''); + $('#prefcode').prop('disabled', true); } else { $('#cstmclerCd').prop('disabled', false); $('#zip').prop('readonly', true); + $('#dtlAdres').attr('placeholder', '나머지 주소를 입력해 주세요'); + $('#mbtlnb').attr('placeholder', '휴대폰번호\'-\'없이 입력하세요'); + $('#prefcode').prop('disabled', false); + + $('#postcodeAlert').hide(); + } +} + +/********************************************** + ibsnet api 호출 + ***********************************************/ +const fn_select_postcodeJp = function () { + $('#postcodeAlert').hide(); + + $.ajax({ + type: 'GET', + url: 'https://zipcloud.ibsnet.co.jp/api/search?zipcode=' + $('#zip').val() + +'&callback=' + 'fn_set_postcodeJp', + dataType: 'jsonp' + }); +} + +/********************************************** + ibsnet api 호출 콜백 (화면에 주소 결과값 세팅) + ***********************************************/ +const fn_set_postcodeJp = function (Data) { + if(Data.status == 200) { + let result = Data.results[0]; + + let adres = result.address1; + let dtlAdres = [result.address2, result.address3].join(" "); + let prefcode = result.prefcode; + + $("#adres").val(adres); + $("#dtlAdres").val(dtlAdres); + $("#prefcode").val(prefcode); + } else { + $('#postcodeAlert').show(); + } +} + +/********************************************** + 배송지 관리 팝업 언어별 form 초기화 + ***********************************************/ +let dlvylcFormPreValues = {}; +const fn_clear_dlvylcForm = function () { + const tableInputs = $("#dlvylcFormTable").find("input[name]"); + + if (Object.keys(dlvylcFormPreValues).length == 0) { + tableInputs.each(function () { + const input = $(this); + const name = input.attr("name"); + dlvylcFormPreValues[name] = input.val(); + input.val(""); + }); + } else { + tableInputs.each(function () { + const input = $(this); + const name = input.attr("name"); + const currentValue = input.val(); + input.val(dlvylcFormPreValues[name] ?? ""); + dlvylcFormPreValues[name] = currentValue; + }); } } \ No newline at end of file diff --git a/src/main/resources/static/mngr/js/crm/dlvylc/dlvylc_2.js b/src/main/resources/static/mngr/js/crm/dlvylc/dlvylc_2.js index ca72fb5d..489ce982 100644 --- a/src/main/resources/static/mngr/js/crm/dlvylc/dlvylc_2.js +++ b/src/main/resources/static/mngr/js/crm/dlvylc/dlvylc_2.js @@ -150,6 +150,7 @@ const fn_move_dlvylc_regpage_pop = function (isPop, mbrInnb, mbrDvCd, dftDlvylcA 배송지 등록 ok ***********************************************/ const fn_insert_dlvylc = function (mbrInnb, mbrDvCd, msg, data) { + $("#dlvylcUpdate").remove(); let paramData = null; const registForm = $("#dlvylcRegistForm").serialize(); if (data != null) { @@ -336,8 +337,74 @@ const fn_toggle_langHeader = function () { if (id == 'langJp') { $('#cstmclerCd').prop('disabled', true); $('#zip').prop('readonly', false); + $('#dtlAdres').attr('placeholder', '以降の住所を入力してください。'); + $('#mbtlnb').attr('placeholder', ''); + $('#prefcode').prop('disabled', true); } else { $('#cstmclerCd').prop('disabled', false); $('#zip').prop('readonly', true); + $('#dtlAdres').attr('placeholder', '나머지 주소를 입력해 주세요'); + $('#mbtlnb').attr('placeholder', '휴대폰번호\'-\'없이 입력하세요'); + $('#prefcode').prop('disabled', false); + + $('#postcodeAlert').hide(); + } +} + +/********************************************** + ibsnet api 호출 + ***********************************************/ +const fn_select_postcodeJp = function () { + $('#postcodeAlert').hide(); + + $.ajax({ + type: 'GET', + url: 'https://zipcloud.ibsnet.co.jp/api/search?zipcode=' + $('#zip').val() + +'&callback=' + 'fn_set_postcodeJp', + dataType: 'jsonp' + }); +} + +/********************************************** + ibsnet api 호출 콜백 (화면에 주소 결과값 세팅) + ***********************************************/ +const fn_set_postcodeJp = function (Data) { + if(Data.status == 200) { + let result = Data.results[0]; + + let adres = result.address1; + let dtlAdres = [result.address2, result.address3].join(" "); + let prefcode = result.prefcode; + + $("#adres").val(adres); + $("#dtlAdres").val(dtlAdres); + $("#prefcode").val(prefcode); + } else { + $('#postcodeAlert').show(); + } +} + +/********************************************** + 배송지 관리 팝업 언어별 form 초기화 + ***********************************************/ +let dlvylcFormPreValues = {}; +const fn_clear_dlvylcForm = function () { + const tableInputs = $("#dlvylcFormTable").find("input[name]"); + + if (Object.keys(dlvylcFormPreValues).length == 0) { + tableInputs.each(function () { + const input = $(this); + const name = input.attr("name"); + dlvylcFormPreValues[name] = input.val(); + input.val(""); + }); + } else { + tableInputs.each(function () { + const input = $(this); + const name = input.attr("name"); + const currentValue = input.val(); + input.val(dlvylcFormPreValues[name] ?? ""); + dlvylcFormPreValues[name] = currentValue; + }); } } \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/sopmal/mpage/mbr/DlvylcRegistPopupC.jsp b/src/main/webapp/WEB-INF/views/sopmal/mpage/mbr/DlvylcRegistPopupC.jsp index 44b82f9a..48fc7a37 100644 --- a/src/main/webapp/WEB-INF/views/sopmal/mpage/mbr/DlvylcRegistPopupC.jsp +++ b/src/main/webapp/WEB-INF/views/sopmal/mpage/mbr/DlvylcRegistPopupC.jsp @@ -19,27 +19,14 @@
| 郵便番号* |
-
-
+
+
+ 郵便番号を正しく入力してください。 |
@@ -93,7 +81,8 @@
휴대전화번호* | 電話番号* |
-
+
+ 電話番号をハイフンなしで入力してください。 |
|---|
| + |
| 휴대전화번호* | 電話番号* |
- "
+ "
maxlength="13" placeholder="휴대폰번호'-'없이 입력하세요">
+ 電話番号をハイフンなしで入力してください。 |
|---|