diff --git a/src/main/webapp/WEB-INF/views/sopmal/ordr/MbrPurchsC.jsp b/src/main/webapp/WEB-INF/views/sopmal/ordr/MbrPurchsC.jsp index 4bab810f..9d614701 100644 --- a/src/main/webapp/WEB-INF/views/sopmal/ordr/MbrPurchsC.jsp +++ b/src/main/webapp/WEB-INF/views/sopmal/ordr/MbrPurchsC.jsp @@ -2737,11 +2737,8 @@ const title = $(this).attr('title'); if (fn_is_empty(val) && (name === 'recpntNm' || name === 'recpntMbtlnb')) { - - alert(title + '을 입력해 주십시요'); - $('#dlvylcForm').find('input[name="' + name + '"]').focus(); - + alert(title + '을 입력해 주십시오'); isValid = false; return false; @@ -2752,9 +2749,14 @@ } else { // console.log("dlvylcDvCd : ",dlvylcDvCd); + const requiredMap = { + KR: 'cstmclerCd', + JP: 'prefcd' + }; + if ('New' === dlvylcDvCd) { - const dlvylcAreaCd2 = $('#dlvylcForm').find('input[name="dlvylcAreaCd"]').val(); - console.log("dlvylcAreaCd(new) : ",dlvylcAreaCd2); + const dlvylcAreaCdNew = $('#dlvylcForm').find('input[name="dlvylcAreaCd"]').val(); + // console.log("dlvylcAreaCd(new) : ",dlvylcAreaCdNew); $('#dlvylcForm').find('.rqrd').each(function () { @@ -2762,39 +2764,51 @@ if (fn_is_empty(val)) { const name = $(this).attr('name'); - - if('JP' !== dlvylcAreaCd2 || 'cstmclerCd' !== name ) { - const title = $(this).attr('title'); - - alert(title + '을 입력해 주십시요'); - - $('#dlvylcForm').find('input[name="' + name + '"]').focus(); - - isValid = false; - - return false; - } - } - }); - } else { - const dlvylcAreaCd = $('#dlvylcAreaCd').val(); - // console.log("dlvylcAreaCd(dft) : ",dlvylcAreaCd); - - if('KR' === dlvylcAreaCd){ - // console.log("KR"); - - const val = $('#cstmclerCd').val(); - - if (fn_is_empty(val)) { - - alert('개인통관번호를 입력해 주십시요'); + const title = $(this).attr('title'); $('#dlvylcForm').find('input[name="' + name + '"]').focus(); - + alert(title + '을 입력해 주십시오'); isValid = false; return false; } + }); + + const required = requiredMap[dlvylcAreaCdNew]; + if (required) { + const $input = $('input.new[name="' + required + '"]'); + const title = $input.attr('title'); + const value = $input.val(); + + if (fn_is_empty(value)) { + alert(title + '을 입력해 주십시오'); + isValid = false; + + return false; + } + } + + } else { + const dlvylcAreaCd = $('#dlvylcAreaCd').val(); + // console.log("dlvylcAreaCd(dft) : ",dlvylcAreaCd); + + const required = requiredMap[dlvylcAreaCd]; + if (required) { + const $input = $('input.new[name="' + required + '"]'); + const title = $input.attr('title'); + const value = $input.val(); + + if (fn_is_empty(value)) { + alert(title + '을 입력해 주십시오'); + isValid = false; + + return false; + } + } else { + alert('배송지역코드를 입력해 주십시오'); + isValid = false; + + return false; } } } @@ -3672,28 +3686,24 @@ - - - - 개인통관번호 - - "> - <%-- --%> + + + 개인통관번호 + + "> + - " placeholder="배송지 관리에서 입력하세요."> + - " placeholder="배송지 관리에서 입력하세요." readonly> + 배송지 관리에서 입력하세요. - - - - - "> - - + + + + @@ -3714,9 +3724,8 @@ - - - + + @@ -3729,7 +3738,7 @@ 개인통관번호 - + diff --git a/src/main/webapp/WEB-INF/views/sopmal/ordr/SubsvcPurchsC.jsp b/src/main/webapp/WEB-INF/views/sopmal/ordr/SubsvcPurchsC.jsp index f4bd5d49..cd618134 100644 --- a/src/main/webapp/WEB-INF/views/sopmal/ordr/SubsvcPurchsC.jsp +++ b/src/main/webapp/WEB-INF/views/sopmal/ordr/SubsvcPurchsC.jsp @@ -2719,11 +2719,8 @@ const title = $(this).attr('title'); if (fn_is_empty(val) && (name === 'recpntNm' || name === 'recpntMbtlnb')) { - - alert(title + '을 입력해 주십시요'); - $('#dlvylcForm').find('input[name="' + name + '"]').focus(); - + alert(title + '을 입력해 주십시오'); isValid = false; return false; @@ -2734,49 +2731,65 @@ } else { // console.log("dlvylcDvCd : ",dlvylcDvCd); - if ('New' === dlvylcDvCd) { - const dlvylcAreaCd2 = $('#dlvylcForm').find('input[name="dlvylcAreaCd"]').val(); - console.log("dlvylcAreaCd(new) : ",dlvylcAreaCd2); + const requiredMap = { + KR: 'cstmclerCd', + JP: 'prefcd' + }; + if ('New' === dlvylcDvCd) { + const dlvylcAreaCdNew = $('#dlvylcForm').find('input[name="dlvylcAreaCd"]').val(); + // console.log("dlvylcAreaCd(new) : ",dlvylcAreaCdNew); $('#dlvylcForm').find('.rqrd').each(function () { const val = $(this).val(); if (fn_is_empty(val)) { const name = $(this).attr('name'); - - if('JP' !== dlvylcAreaCd2 || 'cstmclerCd' !== name ) { - const title = $(this).attr('title'); - - alert(title + '을 입력해 주십시요'); - - $('#dlvylcForm').find('input[name="' + name + '"]').focus(); - - isValid = false; - - return false; - } - } - }); - } else { - const dlvylcAreaCd = $('#dlvylcAreaCd').val(); - // console.log("dlvylcAreaCd(dft) : ",dlvylcAreaCd); - - if('KR' === dlvylcAreaCd){ - // console.log("KR"); - - const val = $('#cstmclerCd').val(); - - if (fn_is_empty(val)) { - - alert('개인통관번호를 입력해 주십시오'); + const title = $(this).attr('title'); $('#dlvylcForm').find('input[name="' + name + '"]').focus(); - + alert(title + '을 입력해 주십시오'); isValid = false; return false; } + }); + + const required = requiredMap[dlvylcAreaCdNew]; + if (required) { + const $input = $('input.new[name="' + required + '"]'); + const title = $input.attr('title'); + const value = $input.val(); + + if (fn_is_empty(value)) { + alert(title + '을 입력해 주십시오'); + isValid = false; + + return false; + } + } + + } else { + const dlvylcAreaCd = $('#dlvylcAreaCd').val(); + // console.log("dlvylcAreaCd(dft) : ",dlvylcAreaCd); + + const required = requiredMap[dlvylcAreaCd]; + if (required) { + const $input = $('input.new[name="' + required + '"]'); + const title = $input.attr('title'); + const value = $input.val(); + + if (fn_is_empty(value)) { + alert(title + '을 입력해 주십시오'); + isValid = false; + + return false; + } + } else { + alert('배송지역코드를 입력해 주십시오'); + isValid = false; + + return false; } } } @@ -2823,7 +2836,7 @@ let name = $(this).attr('name'); let title = $(this).attr('title'); - alert(title + '을 입력해 주십시요'); + alert(title + '을 입력해 주십시오'); $(form).find('input[name="' + name + '"]').focus(); @@ -2898,7 +2911,7 @@ const id = $(this).attr('id'); const title = $(this).attr('title'); - alert(title + ' 항목을 입력해 주십시요'); + alert(title + ' 항목을 입력해 주십시오'); $('#' + id).focus(); @@ -2950,7 +2963,7 @@ if (fn_is_empty(pgCmpnyNm)) { - alert('결제유형을 선택해 주십시요.'); + alert('결제유형을 선택해 주십시오.'); return false; } @@ -2959,7 +2972,7 @@ const div = $('#setleForm').find('.order-method-normal'); if (!$(div).find('.order-method-normal__btn-container button').hasClass('active')) { - alert('결제방법을 선택해 주십시요.'); + alert('결제방법을 선택해 주십시오.'); isValid = false; @@ -2971,7 +2984,7 @@ const input = $(div).find('#rcpmnyerNm'); if (fn_is_empty($(input).val())) { - alert($(input).attr('title') + ' 항목을 입력해 주십시요'); + alert($(input).attr('title') + ' 항목을 입력해 주십시오'); $('#' + $(input).attr('id')).focus(); @@ -2983,7 +2996,7 @@ const rcpmnyAcntnb = $(div).find('#rcpmnyAcntnb option:selected'); if (fn_is_empty($(rcpmnyAcntnb).val())) { - alert($(div).find('#rcpmnyAcntnb').attr('title') + ' 항목을 선택해 주십시요'); + alert($(div).find('#rcpmnyAcntnb').attr('title') + ' 항목을 선택해 주십시오'); return false; } @@ -3007,7 +3020,7 @@ const input = $(div).find('#' + id); if (fn_is_empty($(input).val())) { - alert($(div).find('#' + id).attr('title') + ' 항목을 입력해 주십시요'); + alert($(div).find('#' + id).attr('title') + ' 항목을 입력해 주십시오'); $(div).find('#' + id).focus(); @@ -3028,7 +3041,7 @@ const input = $(content).find('#' + id); if (fn_is_empty($(input).val())) { - alert($(content).find('#' + id).attr('title') + ' 항목을 입력해 주십시요'); + alert($(content).find('#' + id).attr('title') + ' 항목을 입력해 주십시오'); $(content).find('#' + id).focus(); @@ -3087,7 +3100,7 @@ const input = $(content).find('#' + id); if (fn_is_empty($(input).val())) { - alert($(content).find('#' + id).attr('title') + ' 항목을 입력해 주십시요'); + alert($(content).find('#' + id).attr('title') + ' 항목을 입력해 주십시오'); $(content).find('#' + id).focus(); @@ -3653,28 +3666,24 @@ - - - - 개인통관번호 - - "> - <%-- --%> + + + 개인통관번호 + + "> + - - " placeholder="배송지 관리에서 입력하세요."> - - - " placeholder="배송지 관리에서 입력하세요." readonly> - + + + + + 배송지 관리에서 입력하세요. + - + - - - "> - - + + @@ -3695,9 +3704,8 @@ - - - + + @@ -3710,7 +3718,7 @@ 개인통관번호 - +