fix : 쇼핑몰 주문결제화면 - 배송지 정합성 검사

This commit is contained in:
이대환
2026-03-27 14:26:07 +09:00
parent d4fc20fcec
commit d6927d16a2
2 changed files with 136 additions and 119 deletions

View File

@@ -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 @@
<span class="orderInfo__text recpntMbtlnb_ordrInfo_text"><c:out value="${dftDlvylc.mbtlnb}"/></span>
</td>
</tr>
<c:choose>
<c:when test="${dftDlvylc.dlvylcAreaCd eq 'KR'}">
<tr class="deliveryAddressDefault">
<th><span class="orderInfo__title">개인통관번호</span></th>
<td>
<input type="hidden" id="cstmclerCd" class="dft" value="<c:out value="${dftDlvylc.cstmclerCd}"/>">
<%-- <span class="orderInfo__text cstmclerCd_ordrInfo_text"><c:out value="${dftDlvylc.cstmclerCd}"/></span>--%>
<c:if test="${dftDlvylc.dlvylcAreaCd eq 'KR'}">
<tr class="deliveryAddressDefault">
<th><span class="orderInfo__title">개인통관번호</span></th>
<td>
<input type="hidden" id="cstmclerCd" class="dft" value="<c:out value="${dftDlvylc.cstmclerCd}"/>">
<span class="orderInfo__text cstmclerCd_ordrInfo_text">
<c:choose>
<c:when test="${not empty dftDlvylc.cstmclerCd}">
<input type="text" name="cstmclerCd" maxlength="13" class="orderInfo__text cstmclerCd_ordrInfo_text" title="개인통관번호" value="<c:out value="${dftDlvylc.cstmclerCd}"/>" placeholder="배송지 관리에서 입력하세요.">
<c:out value="${dftDlvylc.cstmclerCd}"/>
</c:when>
<c:otherwise>
<input type="text" name="cstmclerCd" maxlength="13" class="orderInfo__text cstmclerCd_ordrInfo_text" title="개인통관번호" value="<c:out value="${dftDlvylc.cstmclerCd}"/>" placeholder="배송지 관리에서 입력하세요." readonly>
배송지 관리에서 입력하세요.
</c:otherwise>
</c:choose>
</tr>
</td>
</c:when>
<c:otherwise>
<input type="hidden" id="cstmclerCd" name="cstmclerCd" class="dft" value="<c:out value="${dftDlvylc.cstmclerCd}"/>">
</c:otherwise>
</c:choose>
</span>
</td>
</tr>
</c:if>
<!-- 기본 배송지 선택 시 End -->
<!-- 신규 배송지 선택 시 Start -->
<tr class="deliveryAddressNew" style="display:none;">
@@ -3714,9 +3724,8 @@
<input type="hidden" name="dlvylcAdresDvCd" class="new">
<input type="hidden" name="dlvylcLnbAdres" class="new">
<input type="hidden" name="dlvylcRnmAdres" class="new">
<input type="hidden" name="dlvylcAreaCd" class="new">
<input type="hidden" name="prefcd" class="new">
<input type="hidden" name="cstmclerCd" class="new">
<input type="hidden" name="dlvylcAreaCd" class="new rqrd" title="배송지역코드">
<input type="hidden" name="prefcd" class="new" title="도도부현코드">
</div>
</td>
</tr>
@@ -3729,7 +3738,7 @@
<tr class="deliveryAddressNew cstmclerArea" style="display:none;">
<th> <span class="orderInfo__title">개인통관번호</span></th>
<td>
<input type="text" name="cstmclerCd" maxlength="13" class="new rqrd input-text rqrd_gift" title="개인통관번호" placeholder="배송지 관리에서 입력하세요." readonly>
<input type="text" name="cstmclerCd" maxlength="13" class="new input-text" title="개인통관번호" placeholder="배송지 관리에서 입력하세요." readonly>
</td>
</tr>
<!-- 신규 배송지 선택 시 End -->